aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/api/testdata/multiplexing/multiplexing.qbs
blob: 9027743b4d0e559e21f771501f843439a9e7c63f (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
114
115
116
117
118
119
120
121
122
123
124
import qbs
import qbs.TextFile

Project {
    Product {
        name: "no-multiplexing"
        type: ["reversed-text"]
        files: ["foo.txt"]
    }
    Product {
        name: "multiplex-without-aggregator-2"
        type: ["reversed-text"]
        files: ["foo.txt"]
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
    }
    Product {
        name: "multiplex-with-export"
        type: ["reversed-text"]
        files: ["foo.txt"]
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
        Export { Depends { name: "multiplex-without-aggregator-2" } }
    }
    Product {
        name: "nonmultiplex-with-export"
        type: ["reversed-text"]
        files: ["foo.txt"]
        Export { Depends { name: "multiplex-without-aggregator-2" } }
    }
    Product {
        name: "nonmultiplex-exporting-aggregation"
        type: ["reversed-text"]
        files: ["foo.txt"]
        Export { Depends { name: "multiplex-with-aggregator-2" } }
    }
    Product {
        name: "multiplex-using-export"
        type: ["reversed-text"]
        files: ["foo.txt"]
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
        Depends { name: "multiplex-with-export" }
    }
    Product {
        name: "multiplex-without-aggregator-2-depend-on-non-multiplexed"
        type: ["reversed-text"]
        files: ["foo.txt"]
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
        Depends { name: "no-multiplexing" }
    }
    Product {
        name: "multiplex-without-aggregator-4"
        type: ["reversed-text"]
        files: ["foo.txt"]
        multiplexByQbsProperties: ["architectures", "buildVariants"]
        qbs.architectures: ["TRS-80", "C64"]
        qbs.buildVariants: ["debug", "release"]
    }
    Product {
        name: "multiplex-with-aggregator-2"
        type: ["reversed-text"]
        files: ["foo.txt"]
        aggregate: true
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
        qbs.architecture: "Atari ST"
    }
    Product {
        name: "multiplex-with-aggregator-2-dependent"
        Depends { name: "multiplex-with-aggregator-2" }
        type: ["something"]
        files: ["foo.txt"]
    }
    Product {
        name: "non-multiplexed-with-dependencies-on-multiplexed"
        Depends { name: "multiplex-without-aggregator-2" }
    }
    Product {
        name: "non-multiplexed-with-dependencies-on-multiplexed-via-export1"
        Depends { name: "multiplex-with-export" }
    }
    Product {
        name: "non-multiplexed-with-dependencies-on-multiplexed-via-export2"
        Depends { name: "nonmultiplex-with-export" }
    }
    Product {
        name: "non-multiplexed-with-dependencies-on-aggregation-via-export"
        Depends { name: "nonmultiplex-exporting-aggregation" }
    }
    Product {
        name: "aggregate-with-dependencies-on-aggregation-via-export"
        Depends { name: "nonmultiplex-exporting-aggregation" }
        aggregate: true
        multiplexByQbsProperties: ["architectures"]
        qbs.architectures: ["TRS-80", "C64"]
        qbs.architecture: "Atari ST"
    }
    FileTagger {
        patterns: ["*.txt"]
        fileTags: ["text"]
    }
    Rule {
        inputs: ["text"]
        Artifact {
            filePath: input.baseName + ".txet"
            fileTags: ["reversed-text"]
        }
        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.description = "reversing text";
            cmd.sourceCode = function() {
                var tf = new TextFile(input.filePath, TextFile.ReadOnly);
                var content = tf.readAll();
                tf.close();
                tf = new TextFile(output.filePath, TextFile.WriteOnly);
                tf.write(content.split("").reverse().join(""));
                tf.close();
            };
            return cmd;
        }
    }
}