aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androidmanager.cpp
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-08-01 10:12:34 +0200
committerhjk <hjk@qt.io>2019-10-01 08:15:55 +0000
commitfc2e22dad247445ed4134afbbaff7d9960fd18e2 (patch)
tree5eb80fb6192cba013bfb24806bba55f52a61bb9e /src/plugins/android/androidmanager.cpp
parente90081cd8817716914d139f9b6888c39926df61a (diff)
Android: Move logic to trigger AndroidManager::updateGradleProperties
Previously, AndroidManager::updateGradleProperties operated always on a project node found using target->activeRunConfiguration() which might or might not be the one that will actually be used after the build. This here still does not address the problem that the activeRunConfiguration may change but introduces a way to specify the relevant node, and tries to use the right one when available. At some time, this could be developed into a real solution, e.g. by invalidating the cache on build key changes. Change-Id: I37a3d73e9ad3615025e4def2493f683d11add3c6 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
Diffstat (limited to 'src/plugins/android/androidmanager.cpp')
-rw-r--r--src/plugins/android/androidmanager.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/android/androidmanager.cpp b/src/plugins/android/androidmanager.cpp
index 2ce27e5d26a..b0f887a74da 100644
--- a/src/plugins/android/androidmanager.cpp
+++ b/src/plugins/android/androidmanager.cpp
@@ -683,13 +683,22 @@ static bool mergeGradleProperties(const QString &path, GradleProperties properti
}
-bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target)
+bool AndroidManager::updateGradleProperties(ProjectExplorer::Target *target, const QString &buildKey)
{
QtSupport::BaseQtVersion *version = QtSupport::QtKitAspect::qtVersion(target->kit());
if (!version)
return false;
- const ProjectNode *node = currentProjectNode(target);
+ QString key = buildKey;
+ if (key.isEmpty()) {
+ // FIXME: This case is triggered from AndroidBuildApkWidget::createApplicationGroup
+ // and should be avoided.
+ if (RunConfiguration *rc = target->activeRunConfiguration())
+ key = rc->buildKey();
+ }
+
+ QTC_ASSERT(!key.isEmpty(), return false);
+ const ProjectNode *node = target->project()->findNodeForBuildKey(key);
if (!node)
return false;