Scanner Item

An Scanner item can appear inside a Module Item, and allows to define artifacts dependency, according to the artifacts contents. For example scanner for "qrc" files:

import qbs.Xml

Module {
  Scanner {
    condition: true
    inputs: 'qrc'
    scan: {
      xml = XmlDomDocument(input.fileName);
      dependencies = [];
      // do something with the xml
      return dependencies;
    }
  }
}

Scanner Properties

PropertyTypeDefaultDescription
conditionbooltrueIf true, the scanner is enabled, otherwise it does nothing.
inputsstring listundefinedFile tags the input artifacts must match.
recursiveboolfalseDetermines whether to scan dependencies recursively.
searchPathsscriptundefinedScript that returns paths to look for dependencies. The code in this script is treated as a function with the signature function(project, product, input).
scanscriptundefinedScript that reads the input artifact and returns string list with dependencies. The code in this script is treated as a function with the signature function(project, product, input).

© 2015 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.