blob: ab68d30118edc92e438d9e67163392638035b332 (
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
|
import qbs.TextFile
Project {
InnoSetup {
property bool _test: {
var present = qbs.targetOS.contains("windows") && innosetup.present;
console.info("has innosetup: " + present);
}
Depends { name: "app" }
Depends { name: "lib" }
name: "QbsSetup"
targetName: "qbs.setup.test"
version: "1.5"
files: [
"test.iss"
]
innosetup.verboseOutput: true
innosetup.defines: [
"MyProgram=" + name,
"MyProgramVersion=" + version,
"buildDirectory=" + project.buildDirectory
]
innosetup.compilerFlags: ["/V9"]
destinationDirectory: project.buildDirectory
}
Application {
Depends { name: "cpp" }
name: "app"
files: ["main.c"]
Group {
fileTagsFilter: product.type
qbs.install: true
}
destinationDirectory: project.buildDirectory
}
DynamicLibrary {
Depends { name: "cpp" }
name: "lib"
files: ["main.c"]
Group {
fileTagsFilter: product.type
qbs.install: true
}
Rule {
// This rule tries to provoke the installer into building too early (and the test
// verifies that it does not) by causing the build of the installables to take
// a lot longer.
multiplex: true
outputFileTags: ["c"]
outputArtifacts: {
var artifacts = [];
for (var i = 0; i < 96; ++i)
artifacts.push({ filePath: "c" + i + ".c", fileTags: ["c"] });
return artifacts;
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.silent = true;
cmd.sourceCode = function() {
for (var i = 0; i < outputs["c"].length; ++i) {
var tf;
try {
tf = new TextFile(outputs["c"][i].filePath, TextFile.WriteOnly);
tf.writeLine("int main" + i + "() { return 0; }");
} finally {
if (tf)
tf.close();
}
}
};
return [cmd];
}
}
destinationDirectory: project.buildDirectory
}
}
|