blob: e164d6863eb0b1a16d79093a534f8c34988a5376 (
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
|
import qbs
import qbs.TextFile
Product {
property string packageName: ""
Depends { name: "Android.sdk"; required: false }
Depends { name: "Android.ndk"; required: false }
type: ["json"]
Rule {
multiplex: true
Artifact {
filePath: ["android.json"]
fileTags: ["json"]
}
prepare: {
var cmd = new JavaScriptCommand();
cmd.description = output.filePath;
cmd.sourceCode = function() {
var tools = {};
if (product.moduleProperty("Android.sdk", "present")) {
tools["sdk"] = product.moduleProperty("Android.sdk", "sdkDir");
tools["sdk-build-tools-dx"] = product.Android.sdk.dxFilePath;
}
if (product.moduleProperty("Android.ndk", "present")) {
tools["ndk"] = product.moduleProperty("Android.ndk", "ndkDir");
tools["ndk-samples"] = product.Android.ndk.ndkSamplesDir;
}
var tf;
try {
tf = new TextFile(output.filePath, TextFile.WriteOnly);
tf.writeLine(JSON.stringify(tools, undefined, 4));
} finally {
if (tf)
tf.close();
}
};
return cmd;
}
}
}
|