From 2033b438ca41538f81d9d649d47146e1152c7f9e Mon Sep 17 00:00:00 2001 From: hjk Date: Fri, 3 Apr 2020 11:20:42 +0200 Subject: [PATCH] Android: Use BuildSystem to access some build related data ... that's currently stored in ProjectNodes. Plan is still to adapt all user code like this, and finally move the data storage from ProjectNode to BuildSystem. Change-Id: Ida9b47c4a3013b857d00e7792eaf78d9f91b3c9a Reviewed-by: Assam Boudjelthia Reviewed-by: Christian Kandeler --- src/plugins/android/androidbuildapkstep.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/plugins/android/androidbuildapkstep.cpp b/src/plugins/android/androidbuildapkstep.cpp index c4341ab1e9b..99427be5409 100644 --- a/src/plugins/android/androidbuildapkstep.cpp +++ b/src/plugins/android/androidbuildapkstep.cpp @@ -384,16 +384,13 @@ void AndroidBuildApkStep::doRun() } const QString buildKey = target()->activeBuildKey(); - const ProjectNode *node = target()->project()->findNodeForBuildKey(buildKey); - - if (!node) - return false; + BuildSystem *bs = buildSystem(); bool inputExists = QFile::exists(m_inputFile); if (inputExists && !AndroidManager::isQtCreatorGenerated(FilePath::fromString(m_inputFile))) return true; // use the generated file if it was not generated by qtcreator - auto targets = node->data(Android::Constants::AndroidTargets).toStringList(); + auto targets = bs->extraData(buildKey, Android::Constants::AndroidTargets).toStringList(); if (targets.isEmpty()) return inputExists; // qmake does this job for us @@ -440,19 +437,19 @@ void AndroidBuildApkStep::doRun() } deploySettings["application-binary"] = applicationBinary; - QString extraLibs = node->data(Android::Constants::AndroidExtraLibs).toString(); + QString extraLibs = bs->extraData(buildKey, Android::Constants::AndroidExtraLibs).toString(); if (!extraLibs.isEmpty()) deploySettings["android-extra-libs"] = extraLibs; - QString androidSrcs = node->data(Android::Constants::AndroidPackageSourceDir).toString(); + QString androidSrcs = bs->extraData(buildKey, Android::Constants::AndroidPackageSourceDir).toString(); if (!androidSrcs.isEmpty()) deploySettings["android-package-source-directory"] = androidSrcs; - QString qmlImportPath = node->data("QML_IMPORT_PATH").toString(); + QString qmlImportPath = bs->extraData(buildKey, "QML_IMPORT_PATH").toString(); if (!qmlImportPath.isEmpty()) deploySettings["qml-import-paths"] = qmlImportPath; - QString qmlRootPath = node->data("QML_ROOT_PATH").toString(); + QString qmlRootPath = bs->extraData(buildKey, "QML_ROOT_PATH").toString(); if (qmlRootPath.isEmpty()) qmlRootPath = target()->project()->rootProjectDirectory().toString(); deploySettings["qml-root-path"] = qmlRootPath;