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();
|
QString outputDir = bc->buildDirectory().appendPath(QLatin1String(Constants::ANDROID_BUILDDIRECTORY)).toString();
|
||||||
|
|
||||||
const auto *pro = static_cast<QmakeProjectManager::QmakeProject *>(project());
|
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);
|
const QmakeProjectManager::QmakeProFileNode *node = pro->rootQmakeProjectNode()->findProFileFor(m_proFilePathForInputFile);
|
||||||
if (!node) { // should never happen
|
if (!node) { // should never happen
|
||||||
emit addOutput(tr("Internal Error: Could not find .pro file."), BuildStep::ErrorMessageOutput);
|
emit addOutput(tr("Internal Error: Could not find .pro file."), BuildStep::ErrorMessageOutput);
|
||||||
@@ -270,6 +274,17 @@ bool QmakeAndroidBuildApkStep::init()
|
|||||||
return true;
|
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,
|
void QmakeAndroidBuildApkStep::setupProcessParameters(ProjectExplorer::ProcessParameters *pp,
|
||||||
ProjectExplorer::BuildConfiguration *bc,
|
ProjectExplorer::BuildConfiguration *bc,
|
||||||
const QStringList &arguments,
|
const QStringList &arguments,
|
||||||
|
@@ -69,6 +69,7 @@ public:
|
|||||||
QString proFilePathForInputFile() const;
|
QString proFilePathForInputFile() const;
|
||||||
void setProFilePathForInputFile(const QString &path);
|
void setProFilePathForInputFile(const QString &path);
|
||||||
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class QmakeAndroidBuildApkStepFactory;
|
friend class QmakeAndroidBuildApkStepFactory;
|
||||||
QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc,
|
QmakeAndroidBuildApkStep(ProjectExplorer::BuildStepList *bc,
|
||||||
@@ -79,6 +80,7 @@ protected:
|
|||||||
protected:
|
protected:
|
||||||
void ctor();
|
void ctor();
|
||||||
bool init();
|
bool init();
|
||||||
|
void run(QFutureInterface<bool> &fi);
|
||||||
void processStarted();
|
void processStarted();
|
||||||
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
ProjectExplorer::BuildStepConfigWidget *createConfigWidget();
|
||||||
bool fromMap(const QVariantMap &map);
|
bool fromMap(const QVariantMap &map);
|
||||||
@@ -98,6 +100,7 @@ private:
|
|||||||
QString m_proFilePathForInputFile;
|
QString m_proFilePathForInputFile;
|
||||||
QString m_command;
|
QString m_command;
|
||||||
QString m_argumentsPasswordConcealed;
|
QString m_argumentsPasswordConcealed;
|
||||||
|
bool m_skipBuilding;
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
Reference in New Issue
Block a user