blob: 37b5b3778f881585ea27b3a775b507081b163ba8 (
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
|
import qbs.FileInfo
import qbs.Host
Product {
name: "the-product"
type: "output"
Group {
files: "input.bin"
fileTags: "binary"
}
Group {
files: "input.txt"
fileTags: "text"
}
Rule {
inputs: ["text", "binary"]
Artifact {
filePath: "output." + FileInfo.completeSuffix(input.filePath)
fileTags: "output"
}
prepare: {
var binary;
var prefixArgs;
if (Host.os().contains("windows")) {
binary = product.qbs.windowsShellPath;
prefixArgs = ["/c", "type"];
} else {
binary = "cat";
prefixArgs = [];
}
var inputPath = FileInfo.toNativeSeparators(input.filePath);
var cmd = new Command(binary, prefixArgs.concat([inputPath, inputPath]));
cmd.stdoutFilePath = output.filePath;
cmd.highlight = "filegen";
return cmd;
}
}
}
|