forked from qt-creator/qt-creator
Android: Handle library building in a more user friendly way
Task-number: QTCREATORBUG-13566 Change-Id: I47bf76d1f559bf1addae0e3d577e0207b4de4150 Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
@@ -205,6 +205,10 @@ bool QmakeAndroidBuildApkStep::init()
|
||||
QString outputDir = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
|
||||
|
||||
const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
|
||||
m_skipBuilding = m_proFilePathForInputFile.isEmpty();
|
||||
if (m_skipBuilding)
|
||||
return true;
|
||||
|
||||
const QmakeProjectManager::QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePathForInputFile);
|
||||
if (!node) { // should never happen
|
||||
emit addOutput(tr("Internal Error: Could not find .pro file."), BuildStep::ErrorMessageOutput);
|
||||
@@ -270,6 +274,17 @@ bool QmakeAndroidBuildApkStep::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
void QmakeAndroidBuildApkStep::run(QFutureInterface<bool> &fi)
|
||||
{
|
||||
if (m_skipBuilding) {
|
||||
emit addOutput(tr("No application .pro file found, not building an APK."), BuildStep::ErrorMessageOutput);
|
||||
fi.reportResult(true);
|
||||
emit finished();
|
||||
return;
|
||||
}
|
||||
AndroidBuildApkStep::run(fi);
|
||||
}
|
||||
|
||||
void QmakeAndroidBuildApkStep::setupProcessParameters(ProjectExplorer::ProcessParameters *pp,
|
||||
ProjectExplorer::BuildConfiguration *bc,
|
||||
const QStringList &arguments,
|
||||
|
@@ -69,6 +69,7 @@ public:
|
||||
QString proFilePathForInputFile() const;
|
||||
void setProFilePathForInputFile(const QString &path);
|
||||
|
||||
|
||||
protected:
|
||||
friend class QmakeAndroidBuildApkStepFactory;
|
||||
QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc,
|
||||
@@ -79,6 +80,7 @@ protected:
|
||||
protected:
|
||||
void ctor();
|
||||
bool init();
|
||||
void run(QFutureInterface<bool> &fi);
|
||||
void processStarted();
|
||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
||||
bool fromMap(const QVariantMap &map);
|
||||
@@ -98,6 +100,7 @@ private:
|
||||
QString m_proFilePathForInputFile;
|
||||
QString m_command;
|
||||
QString m_argumentsPasswordConcealed;
|
||||
bool m_skipBuilding;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
|
Reference in New Issue
Block a user