aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api/testdata/excluded-inputs/excluded-inputs.qbs
blob: 7633b3ebec467cd87ebb8ae1ae954e8935a77067 (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
import qbs.File
import qbs.TextFile

Project {
    Product {
        name: "dep"
        type: "the_tag"
        Rule {
            multiplex: true
            Artifact {
                filePath: "file1.txt"
                fileTags: "the_tag"
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = "creating " + output.fileName;
                cmd.sourceCode = function() {
                    var f = new TextFile(output.filePath, TextFile.WriteOnly);
                    f.writeLine("the_content");
                    f.close();
                };
                return cmd;
            }
        }
        Rule {
            inputs: "the_tag"
            excludedInputs: "the_other_tag"
            Artifact {
                filePath: "file2.txt"
                fileTags: "the_other_tag"
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = "creating " + output.fileName;
                cmd.sourceCode = function() {
                    File.copy(input.filePath, output.filePath);
                    var f = new TextFile(output.filePath, TextFile.Append);
                    f.writeLine("the_other_content");
                    f.close();
                };
                return cmd;
            }
        }
        Group {
            fileTagsFilter: "the_other_tag"
            fileTags: "the_tag"
        }
    }
    Product {
        name: "p"
        type: "p_type"
        Depends { name: "dep" }
        Rule {
            multiplex: true
            inputsFromDependencies: "the_tag"
            Artifact {
                filePath: "dummy1.txt"
                fileTags: "p_type"
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = "creating " + output.fileName;;
                if (!inputs["the_tag"] || inputs["the_tag"].length != 2)
                    throw "Huch?";
                cmd.sourceCode = function() {
                    var f = new TextFile(output.filePath, TextFile.WriteOnly);
                    f.close();
                };
                return cmd;
            }
        }
        Rule {
            multiplex: true
            inputsFromDependencies: "the_tag"
            excludedInputs: "the_other_tag"
            Artifact {
                filePath: "dummy2.txt"
                fileTags: "p_type"
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = "creating " + output.fileName;;
                if (!inputs["the_tag"] || inputs["the_tag"].length != 1)
                    throw "Huch?";
                cmd.sourceCode = function() {
                    var f = new TextFile(output.filePath, TextFile.WriteOnly);
                    f.close();
                };
                return cmd;
            }
        }
        Rule {
            multiplex: true
            explicitlyDependsOnFromDependencies: "the_tag"
            excludedAuxiliaryInputs: "the_other_tag"
            Artifact {
                filePath: "dummy3.txt"
                fileTags: "p_type"
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = "creating " + output.fileName;
                if (!explicitlyDependsOn["the_tag"] || explicitlyDependsOn["the_tag"].length != 1)
                    throw "Huch?";
                cmd.sourceCode = function() {
                    var f = new TextFile(output.filePath, TextFile.WriteOnly);
                    f.close();
                };
                return cmd;
            }
        }
    }
}