blob: 6a9e9823d9be031ba516a17a592314b4fdc76d55 (
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
|
import qbs.File
import qbs.TextFile
import "util.js" as Utils
Project {
CppApplication {
name: "app"
files: ["main.cpp"]
Depends { name: "dep" }
}
Product {
name: "p"
type: ["p.out"]
Depends { name: "dep" }
Rule {
multiplex: true
explicitlyDependsOnFromDependencies: ["hpp"]
Artifact {
filePath: "dummy.out"
fileTags: ["p.out"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating dummy.out";
cmd.sourceCode = function() {
File.copy(project.buildDirectory + "/dummy.h", output.filePath);
};
return [cmd];
}
}
}
Product {
name: "dep"
type: ["hpp"]
property bool sleep: true
Rule {
inputs: ["blubb.in"]
Artifact {
filePath: project.buildDirectory + "/dummy.h"
fileTags: ["hpp"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating header";
cmd.sourceCode = function() {
if (product.sleep)
Utils.sleep(1000);
File.copy(input.filePath, output.filePath);
}
return [cmd];
}
}
Rule {
multiplex: true
Artifact {
filePath: "dummy.blubb"
fileTags: ["blubb.in"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating blubb.in";
cmd.sourceCode = function() {
if (product.sleep)
Utils.sleep(1000);
var f = new TextFile(output.filePath, TextFile.WriteOnly);
f.close();
}
return [cmd];
}
}
Export {
Depends { name: "cpp" }
cpp.includePaths: [project.buildDirectory]
}
}
}
|