blob: 8bfd66d539b9a76fda18a6bcb12e42b378f44ce5 (
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
|
import qbs 1.0
import qbs.TextFile
Project {
Product {
name: 'someapp'
type: 'application'
Depends { name: 'cpp' }
Group {
files: [ "main.cpp" ]
fileTags: [ "cpp" ]
}
}
Rule {
inputs: ["foosource"]
Artifact {
fileName: input.baseName + ".foo"
fileTags: ["foo"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);";
cmd.sourceCode += "file.truncate();"
cmd.sourceCode += "file.write(\"There's nothing to see here!\");"
cmd.sourceCode += "file.close();"
cmd.description = "generating something";
return cmd;
}
}
Rule {
inputs: ["foo"]
Artifact {
fileName: input.baseName + "_foo.cpp"
fileTags: ["cpp"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.sourceCode = "var file = new TextFile(output.filePath, TextFile.WriteOnly);";
cmd.sourceCode += "file.truncate();";
cmd.sourceCode += "file.write(\"// There's nothing to see here!\\n\");";
cmd.sourceCode += "file.write(\"int foo() { return 15; }\\n\");";
cmd.sourceCode += "file.close();";
cmd.description = "generating something";
return cmd;
}
}
}
|