Android: Fix deployment of release builds with Qt 5.3 and earlier

Since unsigned packages are not deployable, we always make
packages signed with the debug key when there's no signing requested,
even if the native code is built as release. This was already
fixed for Qt 5.4, where we use androiddeployqt to deploy the apk,
but for earlier versions, we need to use the correct apk name.
We also need to use the apk name which is used by androiddeployqt
in Qt 5.3, which does not contain the "-signed" suffix.

Change-Id: I87f7936002946acd80bc245935c44cf148f9630d
Reviewed-by: Daniel Teske <daniel.teske@theqtcompany.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt
2014-11-21 15:01:38 +01:00
parent cb30a1ae10
commit ed2e963a15

View File

@@ -51,17 +51,11 @@ Utils::FileName Android::AndroidQtSupport::apkPath(ProjectExplorer::Target *targ
apkPath = QLatin1String("/build/outputs/apk/android-build-");
else
apkPath = QLatin1String("/bin/QtApp-");
if (buildApkStep->buildConfiguration()->buildType() == ProjectExplorer::BuildConfiguration::Release) {
apkPath += QLatin1String("release-");
if (!buildApkStep->signPackage())
apkPath += QLatin1String("un");
apkPath += QLatin1String("signed.apk");
} else {
apkPath += QLatin1String("debug");
if (buildApkStep->signPackage())
apkPath += QLatin1String("-signed");
apkPath += QLatin1String(".apk");
}
if (buildApkStep->signPackage())
apkPath += QLatin1String("release.apk");
else
apkPath += QLatin1String("debug.apk");
return target->activeBuildConfiguration()->buildDirectory()
.appendPath(QLatin1String(Android::Constants::ANDROID_BUILDDIRECTORY))
.appendPath(apkPath);