forked from qt-creator/qt-creator
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 <assam.boudjelthia@qt.io> Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -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;
|
||||
|
Reference in New Issue
Block a user