aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/blackbox/find
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-06-08 20:48:47 -0700
committerJake Petroules <jake.petroules@qt.io>2017-06-09 09:52:37 +0000
commit47f5c8f5d58e6dda33fa1c6229800bee2791dd89 (patch)
tree31ce5d7d7747fa3ef1a3d47860f1fea1a78ddf4c /tests/auto/blackbox/find
parentec3ef366a389ec9e6b23d9e3adf38988f2cceac2 (diff)
Find Xcode module properties using the standard mechanism
This is compatible with older versions of Xcode. Change-Id: I7828e7aa44ab7d29a62255bb0e3e891a97202f5e Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'tests/auto/blackbox/find')
-rw-r--r--tests/auto/blackbox/find/find-xcode.qbs41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/auto/blackbox/find/find-xcode.qbs b/tests/auto/blackbox/find/find-xcode.qbs
new file mode 100644
index 000000000..b42b2deb7
--- /dev/null
+++ b/tests/auto/blackbox/find/find-xcode.qbs
@@ -0,0 +1,41 @@
+import qbs
+import qbs.TextFile
+
+Product {
+ Depends { name: "xcode"; required: false }
+ type: ["json"]
+ Rule {
+ multiplex: true
+ Artifact {
+ filePath: ["xcode.json"]
+ fileTags: ["json"]
+ }
+ prepare: {
+ var cmd = new JavaScriptCommand();
+ cmd.description = output.filePath;
+ cmd.sourceCode = function() {
+ var tools = {};
+ if (product.moduleProperty("xcode", "present")) {
+ var keys = [
+ "developerPath",
+ "version"
+ ];
+ for (var i = 0; i < keys.length; ++i) {
+ var key = keys[i];
+ tools[key] = product.xcode[key];
+ }
+ }
+
+ var tf;
+ try {
+ tf = new TextFile(output.filePath, TextFile.WriteOnly);
+ tf.writeLine(JSON.stringify(tools, undefined, 4));
+ } finally {
+ if (tf)
+ tf.close();
+ }
+ };
+ return cmd;
+ }
+ }
+}