aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJake Petroules <jake.petroules@qt.io>2017-12-05 17:57:59 -0800
committerJake Petroules <jake.petroules@qt.io>2017-12-12 09:25:26 +0000
commit7701e27eb3d93e8d9f599ce766898e7874a45a3a (patch)
treeff4213f58ba5b98394326d9f78b371a5988372e2
parent7c4d27eec0dbfc2df8a38af4cf11a86f6601a839 (diff)
Allow running multiplexed iOS application bundles via `qbs run`
This does not solve the whole problem of multiplex instance selection generically, but at least solves the immediate issue of correctly selecting the default instance for iOS apps, which is the application instance which also has a bundle.content tag (if it is bundled). Task-number: QBS-1207 Change-Id: Ibdefc85679be292c1f9c518ce1e8b15b689a13b5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
-rw-r--r--src/lib/corelib/api/project.cpp4
-rw-r--r--src/lib/corelib/api/projectdata.cpp5
-rw-r--r--src/lib/corelib/api/projectdata_p.h6
3 files changed, 11 insertions, 4 deletions
diff --git a/src/lib/corelib/api/project.cpp b/src/lib/corelib/api/project.cpp
index f9d4f43d8..214c864ce 100644
--- a/src/lib/corelib/api/project.cpp
+++ b/src/lib/corelib/api/project.cpp
@@ -760,7 +760,9 @@ RuleCommandList ProjectPrivate::ruleCommands(const ProductData &product,
static bool productIsRunnable(const ResolvedProductConstPtr &product)
{
- return isRunnableArtifact(product->fileTags);
+ const bool isBundle = product->moduleProperties->moduleProperty(
+ QStringLiteral("bundle"), QStringLiteral("isBundle")).toBool();
+ return isRunnableArtifact(product->fileTags, isBundle);
}
static bool productIsMultiplexed(const ResolvedProductConstPtr &product)
diff --git a/src/lib/corelib/api/projectdata.cpp b/src/lib/corelib/api/projectdata.cpp
index 03aa95f60..4167969d8 100644
--- a/src/lib/corelib/api/projectdata.cpp
+++ b/src/lib/corelib/api/projectdata.cpp
@@ -261,7 +261,10 @@ bool ArtifactData::isGenerated() const
*/
bool ArtifactData::isExecutable() const
{
- return Internal::isRunnableArtifact(Internal::FileTags::fromStringList(d->fileTags));
+ const bool isBundle = d->properties.getModuleProperty(
+ QStringLiteral("bundle"), QStringLiteral("isBundle")).toBool();
+ return Internal::isRunnableArtifact(
+ Internal::FileTags::fromStringList(d->fileTags), isBundle);
}
/*!
diff --git a/src/lib/corelib/api/projectdata_p.h b/src/lib/corelib/api/projectdata_p.h
index 41617fc81..e81e04147 100644
--- a/src/lib/corelib/api/projectdata_p.h
+++ b/src/lib/corelib/api/projectdata_p.h
@@ -139,9 +139,11 @@ public:
QString buildDir;
};
-static inline bool isRunnableArtifact(const FileTags &fileTags)
+static inline bool isRunnableArtifact(const FileTags &fileTags,
+ bool isBundle)
{
- return fileTags.contains("application")
+ return (fileTags.contains("application")
+ && (!isBundle || fileTags.contains("bundle.content")))
|| fileTags.contains("android.apk")
|| fileTags.contains("msi");
}