aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/testdata/export-rule/export-rule.qbs
blob: 455ccba0ded13942fc672cf39173581d3c5b2910 (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
import qbs.File

Project {
    Application {
        name: "MyApp"
        files: ["myapp.blubb"]
        Depends { name: "blubber" }
    }
    StaticLibrary {
        name: "blubber"
        files: ["blubber.cpp"]
        Depends { name: "cpp" }
        Export {
            Depends { name: "cpp" }
            property bool enableTagger
            property string description: "creating C++ source file.";
            FileTagger {
                condition: enableTagger
                patterns: ["*.blubb"]
                fileTags: ["blubb"]
            }
            Rule {
                inputs: ["blubb"]
                Artifact {
                    filePath: input.completeBaseName + ".cpp"
                    fileTags: ["cpp"]
                }
                prepare: {
                    var cmd = new JavaScriptCommand();
                    cmd.description = product.blubber.description;
                    cmd.sourceCode = function() {
                        File.copy(input.filePath, output.filePath);
                    }
                    return [cmd];
                }
            }
        }
    }
}