forked from qt-creator/qt-creator
Android: Make sign package orthogonal to the debug vs release
This enables signing debug packages and creating unsigned release packages. Task-number: QTCREATORBUG-10060 Change-Id: I57d094972b451538e8e9e5104e803e50a4ba2336 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
@@ -39,7 +39,9 @@
|
||||
|
||||
#include <coreplugin/messagemanager.h>
|
||||
#include <projectexplorer/buildconfiguration.h>
|
||||
#include <projectexplorer/deployconfiguration.h>
|
||||
#include <projectexplorer/projectexplorerconstants.h>
|
||||
#include <projectexplorer/buildsteplist.h>
|
||||
#include <projectexplorer/target.h>
|
||||
#include <qt4projectmanager/qt4buildconfiguration.h>
|
||||
#include <qt4projectmanager/qt4project.h>
|
||||
@@ -133,8 +135,16 @@ bool AndroidDeployStep::init()
|
||||
if (!bc)
|
||||
return false;
|
||||
|
||||
m_signPackage = false;
|
||||
// find AndroidPackageCreationStep
|
||||
foreach (BuildStep *step, target()->activeDeployConfiguration()->stepList()->steps()) {
|
||||
if (AndroidPackageCreationStep *apcs = qobject_cast<AndroidPackageCreationStep *>(step)) {
|
||||
m_signPackage = apcs->signPackage();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
m_qtVersionSourcePath = version->qmakeProperty("QT_INSTALL_PREFIX");
|
||||
m_qtVersionQMakeBuildConfig = bc->qmakeBuildConfiguration();
|
||||
m_androidDirPath = AndroidManager::dirPath(target());
|
||||
m_apkPathDebug = AndroidManager::apkPath(target(), AndroidManager::DebugBuild).toString();
|
||||
m_apkPathRelease = AndroidManager::apkPath(target(), AndroidManager::ReleaseBuildSigned).toString();
|
||||
@@ -544,8 +554,7 @@ bool AndroidDeployStep::deployPackage()
|
||||
AndroidDeviceInfo::adbSelector(m_deviceSerialNumber) << QLatin1String("uninstall") << m_packageName);
|
||||
QString package = m_apkPathDebug;
|
||||
|
||||
if (!(m_qtVersionQMakeBuildConfig & QtSupport::BaseQtVersion::DebugBuild)
|
||||
&& QFile::exists(m_apkPathRelease))
|
||||
if (m_signPackage && QFile::exists(m_apkPathRelease))
|
||||
package = m_apkPathRelease;
|
||||
|
||||
if (!runCommand(deployProc, AndroidConfigurations::instance().adbToolPath().toString(),
|
||||
|
||||
Reference in New Issue
Block a user