aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/android/androidplugin.cpp
diff options
context:
space:
mode:
authorhjk <[email protected]>2018-12-05 13:00:36 +0100
committerhjk <[email protected]>2019-01-16 11:00:45 +0000
commitd52af488830b48a8fa699ff71b85466887847df8 (patch)
tree7933c1bba0adce4d34ac28f2a45304d4f0ca0655 /src/plugins/android/androidplugin.cpp
parenta2d5ebccd2d28d339eda18d0d5c0ebbe698e381c (diff)
QmakeAndroidSupport: Remove plugin
The remaining dependency is hacked into QmakeProjectManager by using a compile time-only dependency on androidconstants.h. Change-Id: Id78125137bc75c145a072bc753276abbf0029647 Reviewed-by: Vikas Pachdha <[email protected]>
Diffstat (limited to 'src/plugins/android/androidplugin.cpp')
-rw-r--r--src/plugins/android/androidplugin.cpp33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/plugins/android/androidplugin.cpp b/src/plugins/android/androidplugin.cpp
index 70d247476d6..7fdb28cad52 100644
--- a/src/plugins/android/androidplugin.cpp
+++ b/src/plugins/android/androidplugin.cpp
@@ -50,8 +50,11 @@
#endif
#include <projectexplorer/devicesupport/devicemanager.h>
+#include <projectexplorer/buildconfiguration.h>
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/kitmanager.h>
+#include <projectexplorer/project.h>
+#include <projectexplorer/session.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtversionmanager.h>
@@ -77,9 +80,37 @@ public:
}
};
-class AndroidPluginPrivate
+class AndroidPluginPrivate : public QObject
{
public:
+ AndroidPluginPrivate()
+ {
+ connect(SessionManager::instance(), &SessionManager::projectAdded, this, [=](Project *project) {
+ for (Target *target : project->targets())
+ handleNewTarget(target);
+ connect(project, &Project::addedTarget, this, &AndroidPluginPrivate::handleNewTarget);
+ });
+ }
+
+ void handleNewTarget(Target *target)
+ {
+ if (DeviceTypeKitInformation::deviceTypeId(target->kit()) != Android::Constants::ANDROID_DEVICE_TYPE)
+ return;
+
+ for (BuildConfiguration *bc : target->buildConfigurations())
+ handleNewBuildConfiguration(bc);
+
+ connect(target, &Target::addedBuildConfiguration,
+ this, &AndroidPluginPrivate::handleNewBuildConfiguration);
+ }
+
+ void handleNewBuildConfiguration(BuildConfiguration *bc)
+ {
+ connect(bc->target()->project(), &Project::parsingFinished, bc, [bc] {
+ AndroidManager::updateGradleProperties(bc->target());
+ });
+ }
+
AndroidConfigurations androidConfiguration;
AndroidSettingsPage settingsPage;
AndroidDeployQtStepFactory deployQtStepFactory;