aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/ruleConditions/modules/narfzort/narfzort.qbs
blob: 8e79895732d33146b4c2e784f067a39bb6a1763e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import qbs 1.0
import qbs.FileInfo
import qbs.TextFile

Module {
    property bool buildZort: true
    FileTagger {
        patterns: "*.narf"
        fileTags: ["narf"]
    }
    Rule {
        condition: product.moduleProperty("narfzort", "buildZort");
        inputs: ["narf"]
        outputFileTags: ["zort"]
        outputArtifacts: [{
            filePath: product.name + "." + input.fileName + ".zort",
            fileTags: ["zort"]
        }]
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "generating " + FileInfo.fileName(output.filePath);
            cmd.sourceCode = function() {
                    var f = new TextFile(output.filePath, TextFile.WriteOnly);
                    f.write("NARF! ZORT!");
                    f.close();
                }
            return cmd;
        }
    }
}