From 0d17c9617e1478951ea8e967937adb7d16a8e3b3 Mon Sep 17 00:00:00 2001 From: Christian Kandeler Date: Mon, 26 May 2014 16:50:15 +0200 Subject: Properly treat "usings" as inputs when applying rules. This allows non-multiplex rules with only "usings" and no "inputs" to work as expected, that is they create one transformer per "usings" element. Change-Id: Iba5144f81b082043878f3eefc111846b6d05646a Reviewed-by: Joerg Bornemann --- .../blackbox/testdata/build-directories/input.txt | 0 .../testdata/build-directories/project.qbs | 5 -- .../custom1.in | 0 .../custom2.in | 0 .../project.qbs | 62 ++++++++++++++++++++++ 5 files changed, 62 insertions(+), 5 deletions(-) delete mode 100644 tests/auto/blackbox/testdata/build-directories/input.txt create mode 100644 tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom1.in create mode 100644 tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom2.in create mode 100644 tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/project.qbs (limited to 'tests/auto/blackbox/testdata') diff --git a/tests/auto/blackbox/testdata/build-directories/input.txt b/tests/auto/blackbox/testdata/build-directories/input.txt deleted file mode 100644 index e69de29bb..000000000 diff --git a/tests/auto/blackbox/testdata/build-directories/project.qbs b/tests/auto/blackbox/testdata/build-directories/project.qbs index 025340a0a..cb83999e2 100644 --- a/tests/auto/blackbox/testdata/build-directories/project.qbs +++ b/tests/auto/blackbox/testdata/build-directories/project.qbs @@ -23,12 +23,7 @@ Project { name: "p2" type: "blubb2" Depends { name: "p1" } - Group { - files: "input.txt" - fileTags: "input" - } Rule { - inputs: "input" usings: "blubb1" Artifact { fileName: "dummy2.txt" diff --git a/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom1.in b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom1.in new file mode 100644 index 000000000..e69de29bb diff --git a/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom2.in b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/custom2.in new file mode 100644 index 000000000..e69de29bb diff --git a/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/project.qbs b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/project.qbs new file mode 100644 index 000000000..bf34cc8e6 --- /dev/null +++ b/tests/auto/blackbox/testdata/usings-as-sole-inputs-non-multiplexed/project.qbs @@ -0,0 +1,62 @@ +import qbs +import qbs.FileInfo +import qbs.TextFile + +Project { + Product { + name: "p1" + type: "custom" + Group { + files: "custom1.in" + fileTags: "custom.in" + } + } + Product { + name: "p2" + type: "custom" + Group { + files: "custom2.in" + fileTags: "custom.in" + } + } + + Rule { + inputs: "custom.in" + Artifact { + fileName: FileInfo.baseName(input.filePath) + ".out" + fileTags: "custom" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + } + return cmd; + } + } + + Product { + name: "p3" + type: "custom-plus" + Depends { name: "p1" } + Depends { name: "p2" } + Rule { + usings: "custom" + Artifact { + fileName: FileInfo.baseName(input.filePath) + ".plus" + fileTags: "custom-plus" + } + prepare: { + var cmd = new JavaScriptCommand(); + cmd.description = "generating " + output.fileName; + cmd.sourceCode = function() { + var f = new TextFile(output.filePath, TextFile.WriteOnly); + f.close(); + } + return cmd; + } + } + } +} -- cgit v1.2.3