diff options
author | Jake Petroules <jake.petroules@theqtcompany.com> | 2015-11-22 16:19:14 -0800 |
---|---|---|
committer | Jake Petroules <jake.petroules@theqtcompany.com> | 2016-01-11 16:52:28 +0000 |
commit | 56f1d95716f1af57d63f51df6fcc3a1bd8ca3ee4 (patch) | |
tree | 0878b6a27f1d20fbaf676d6c76d715c293da5410 /tests/auto/blackbox/testdata/find | |
parent | bb1eee72fd0224736bb4bdbb7f0be4fbbbe96f24 (diff) |
Search for Android SDK/NDK in standard location(s).
The latest Android SDK actually includes the NDK as a component, at
sdkPath + "/ndk-bundle", and the official Android IDE, Android Studio,
installs the SDK at ~/Library/Android/sdk on OS X.
Change-Id: I557f01899c264adfb8bdf731cec690703866b899
Reviewed-by: Christian Kandeler <christian.kandeler@theqtcompany.com>
Diffstat (limited to 'tests/auto/blackbox/testdata/find')
-rw-r--r-- | tests/auto/blackbox/testdata/find/find-android.qbs | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/find/find-android.qbs b/tests/auto/blackbox/testdata/find/find-android.qbs new file mode 100644 index 000000000..4b39afeea --- /dev/null +++ b/tests/auto/blackbox/testdata/find/find-android.qbs @@ -0,0 +1,41 @@ +import qbs +import qbs.TextFile + +Product { + property string packageName: "" + + Depends { name: "Android.sdk"; required: false } + Depends { name: "Android.ndk"; required: false } + type: ["json"] + Rule { + inputs: ["qbs"] + 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"); + } + + if (product.moduleProperty("Android.ndk", "present")) { + tools["ndk"] = product.moduleProperty("Android.ndk", "ndkDir"); + } + + var tf; + try { + tf = new TextFile(output.filePath, TextFile.WriteOnly); + tf.writeLine(JSON.stringify(tools, undefined, 4)); + } finally { + if (tf) + tf.close(); + } + }; + return cmd; + } + } +} |