Fix apkPath for gradle 4.0+

This change keeps the compatibility with old gradle.
It is needed for projects that must use the old gradle version.

src/tools/androiddeployqt/main.cpp was moved from qttools into
qtbase in 5.11. So re-apply c03f5673 in qttools here.

Change-Id: Iaa669c6bf12277cb0cde422228a5c653b6bcf433
Reviewed-by: Volker Krause <volker.krause@kdab.com>
bb10
BogDan Vatra 2018-03-15 09:08:30 +02:00 committed by Liang Qi
parent ed7f86cb07
commit e2f4193112
1 changed files with 8 additions and 3 deletions

View File

@ -2331,10 +2331,15 @@ enum PackageType {
QString apkPath(const Options &options, PackageType pt)
{
QString path(options.outputDirectory);
if (options.gradle)
path += QLatin1String("/build/outputs/apk/") + QDir(options.outputDirectory).dirName() + QLatin1Char('-');
else
if (options.gradle) {
path += QLatin1String("/build/outputs/apk/");
QString buildType(options.releasePackage ? QLatin1String("release/") : QLatin1String("debug/"));
if (QDir(path + buildType).exists())
path += buildType;
path += QDir(options.outputDirectory).dirName() + QLatin1Char('-');
} else {
path += QLatin1String("/bin/QtApp-");
}
if (options.releasePackage) {
path += QLatin1String("release-");
if (pt == UnsignedAPK)