diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2018-02-14 14:14:20 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2018-02-15 09:24:24 +0000 |
commit | 229a889342de306a51fb6c13787708085f631e03 (patch) | |
tree | 6659af3c7a085ccc8f763803228bffa1c975356c /tests/auto/blackbox/testdata/installable-as-auxiliary-input | |
parent | 63535355c257fb7d7283db0797068a5df451865b (diff) |
Fix connection to rules of dependencies
... for the case that auxiliaryInputs or explicitlyDependsOn contains
"installable". They must be considered in addition to
inputsFromDependencies, because they also match target artifacts of
dependencies.
Change-Id: Ib960001a8e67034d6d1382bacc385bdcd9ddfb99
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'tests/auto/blackbox/testdata/installable-as-auxiliary-input')
-rw-r--r-- | tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs | 78 |
1 files changed, 78 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs new file mode 100644 index 000000000..822473157 --- /dev/null +++ b/tests/auto/blackbox/testdata/installable-as-auxiliary-input/installable-as-auxiliary-input.qbs @@ -0,0 +1,78 @@ +import qbs +import qbs.File +import qbs.FileInfo +import qbs.TextFile + +Project { + name: "p" + CppApplication { + name: "app" + Depends { name: "installed-header" } + Rule { + multiplex: true + auxiliaryInputs: ["installable"] + Artifact { filePath: "main.cpp"; fileTags: "cpp" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "creating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.writeLine("#include <theheader.h>"); + f.writeLine("int main() {"); + f.writeLine(" f();"); + f.writeLine("}"); + f.close(); + }; + return cmd; + } + } + } + + Product { + name: "installed-header" + type: ["header"] + + property string installDir: "include" + + Group { + fileTagsFilter: "header" + qbs.install: true + qbs.installDir: installDir + } + + Export { + Depends { name: "cpp" } + cpp.includePaths: FileInfo.joinPaths(qbs.installRoot, product.installDir); + } + + Rule { + multiplex: true + Artifact { filePath: "theheader.h.in"; fileTags: "header.in" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Creating " + output.fileName; + cmd.sourceCode = function() { + for (var i = 0; i < 1000; ++i) { // Artificial delay. + var file = new TextFile(output.filePath, TextFile.WriteOnly); + file.writeLine("#include <iostream>"); + file.writeLine("inline void f() {"); + file.writeLine(' std::cout << "f-impl" << std::endl;'); + file.writeLine("}"); + file.close(); + } + }; + return [cmd]; + } + } + Rule { + inputs: "header.in" + Artifact { filePath: "theheader.h"; fileTags: "header" } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "Creating " + output.fileName; + cmd.sourceCode = function() { File.copy(input.filePath, output.filePath); }; + return [cmd]; + } + } + } +} |