Android: Merge run configuration into base class

The base AndroidRunConfiguration as such is buildsystem agnostic now,
it is, however not usable with other buildsystems as the apk build
step relies on qmake specific information, so the run configuration
factory stays on the buildsystem specific side for now.

Change-Id: I00538846028cc060aceea15ffd2e63068450f1e8
Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
This commit is contained in:
hjk
2018-05-04 11:13:43 +02:00
parent 95d7be1b28
commit a67b1e97de
11 changed files with 71 additions and 210 deletions

View File

@@ -30,7 +30,9 @@
#include "androidrunconfigurationwidget.h"
#include <projectexplorer/kitinformation.h>
#include <projectexplorer/project.h>
#include <projectexplorer/target.h>
#include <qtsupport/qtoutputformatter.h>
#include <qtsupport/qtkitinformation.h>
@@ -49,6 +51,9 @@ AndroidRunConfiguration::AndroidRunConfiguration(Target *target, Core::Id id)
: RunConfiguration(target, id)
{
setOutputFormatter<QtSupport::QtOutputFormatter>();
connect(target->project(), &Project::parsingFinished, this, [this] {
updateTargetInformation();
});
}
void AndroidRunConfiguration::setPreStartShellCommands(const QStringList &cmdList)
@@ -115,4 +120,29 @@ const QStringList &AndroidRunConfiguration::postFinishShellCommands() const
return m_postFinishShellCommands;
}
void AndroidRunConfiguration::updateTargetInformation()
{
const BuildTargetInfo bti = buildTargetInfo();
setDisplayName(bti.displayName);
setDefaultDisplayName(bti.displayName);
}
QString AndroidRunConfiguration::disabledReason() const
{
const BuildTargetInfo bti = buildTargetInfo();
const QString projectFileName = bti.projectFilePath.toString();
if (project()->isParsing())
return tr("The project file \"%1\" is currently being parsed.").arg(projectFileName);
if (!project()->hasParsingData()) {
if (!bti.projectFilePath.exists())
return tr("The project file \"%1\" does not exist.").arg(projectFileName);
return tr("The project file \"%1\" could not be parsed.").arg(projectFileName);
}
return QString();
}
} // namespace Android