summaryrefslogtreecommitdiff
path: root/tests/auto/api/testdata/check-outputs/project.qbs
blob: 27eada48f6e924abff6e818a97ff2cfcd64573b8 (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
import qbs
import qbs.File

Project {
    Product {
        type: 'application'
        consoleApplication: true
        Group {
            files: 'foo.txt'
            fileTags: ['text']
        }
        Depends { name: 'cpp' }
    }

    Rule {
        inputs: ['text']
        Artifact {
            fileTags: ['cpp']
            filePath: input.baseName + '.cpp'
        }
        Artifact {
            fileTags: ['ghost']
            filePath: input.baseName + '.ghost'
        }

        prepare: {
            var cmd = new JavaScriptCommand();
            cmd.inp = inputs["text"][0].filePath;
            cmd.out = outputs["cpp"][0].filePath;
            cmd.description = "generating " + outputs["cpp"][0].fileName;
            cmd.sourceCode = function() {
                File.copy(inp, out);
            };
            return cmd;
        }
    }
}