Scanner

Creates custom dependency scanners in modules. More...

Properties

Detailed Description

A Scanner item can appear inside a Module item, and allows to extract dependencies for artifacts from the artifacts' file contents. For example, this is what a scanner for "qrc" files might look like:

 import qbs.Xml

 Module {
   Scanner {
     inputs: 'qrc'
     scan: {
       var xml = new Xml.DomDocument(input.filePath);
       dependencies = [];
       // retrieve <file> entries from the XML document
       return dependencies;
     }
   }
 }

Property Documentation

condition : bool

If true, the scanner is enabled, otherwise it does nothing.

Default: true


inputs : stringList

A list of file tags the input artifacts must match.

Default: Undefined


recursive : bool

Determines whether to scan the returned dependencies using the same scanner.

Default: false


scan : script

A script that reads the input artifact and returns a string list with dependencies.

The code in this script is treated as a function with the signature function(project, product, input, filePath), where input is the artifact at which the scan originated, and filePath is the currently scanned file. For non-recursive scans, filePath is always equal to input.filePath.

Default: Undefined


searchPaths : script

A script that returns the paths where to look for dependencies.

The code in this script is treated as a function with the signature function(project, product, input).

Default: Undefined