blob: ef2c5c55b38c1aa21bea263baf21af4c05fd4715 (
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
|
import qbs.TextFile
Product {
name: "p"
type: "p_tag"
property string generateInput
Group {
condition: generateInput == "no"
files: "input.txt"
fileTags: ["txt", "empty"]
}
Rule {
condition: generateInput == "static"
multiplex: true
Artifact { filePath: "input.txt"; fileTags: ["txt", "empty"] }
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating " + output.fileName;
cmd.sourceCode = function() {
var out = new TextFile(output.filePath, TextFile.WriteOnly);
out.close();
};
return cmd;
}
}
Rule {
condition: generateInput == "dynamic"
multiplex: true
outputFileTags: ["txt", "empty"]
outputArtifacts: [{filePath: "input.txt", fileTags: ["txt", "empty"]}]
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating " + output.fileName;
cmd.sourceCode = function() {
var out = new TextFile(output.filePath, TextFile.WriteOnly);
out.close();
};
return cmd;
}
}
Rule {
inputs: "txt"
outputFileTags: "p_tag"
outputArtifacts: {
if (input.fileTags.contains("empty"))
return [];
return [{
filePath: input.fileTags.contains("y") ? "y.out" : "x.out",
fileTags: "p_tag"
}]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = "generating " + output.fileName;
cmd.sourceCode = function() {
var out = new TextFile(output.filePath, TextFile.WriteOnly);
out.close();
};
return cmd;
}
}
}
|