aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/dependenciesProperty/dependenciesProperty.qbs
blob: 052829c1b23a9868575716fe71ba3f3e15966c26 (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
import qbs 1.0
import qbs.TextFile
import qbs.FileInfo

Project {
    Product {
        type: "deps"
        name: "product1"
        Depends { name: "product2" }
        Transformer {
            Artifact {
                fileTags: ["deps"]
                fileName: product.name + '.deps'
            }
            prepare: {
                var cmd = new JavaScriptCommand();
                cmd.description = 'generate ' + FileInfo.fileName(output.fileName);
                cmd.highlight = 'codegen';
                cmd.content = JSON.stringify(product.dependencies);
                cmd.sourceCode = function() {
                    file = new TextFile(output.fileName, TextFile.WriteOnly);
                    file.truncate();
                    file.write(content);
                    file.close();
                }
                return cmd;
            }
        }
    }
    Product {
        type: "application"
        name: "product2"
        property string narf: "zort"
        Depends { name: "cpp" }
        cpp.defines: ["SMURF"]
        files: ["product2.cpp"]
    }
}