Android: Fix opening of package location after build

Fixes and consolidates into one common function the package path
retrieval for the eight combinations of:

(apk|aab)(debug|release)(signed|unsigned)

Fixes: QTCREATORBUG-28791
Change-Id: I6e8c54f555b95aca448032783938f9f7f89bc653
Reviewed-by: Assam Boudjelthia <assam.boudjelthia@qt.io>
This commit is contained in:
Alessandro Portale
2023-02-21 18:13:02 +01:00
parent 5c4cf2d018
commit b9a24753a0
4 changed files with 31 additions and 18 deletions

View File

@@ -533,15 +533,7 @@ bool AndroidBuildApkStep::init()
m_openPackageLocationForRun = m_openPackageLocation;
const FilePath outputDir = AndroidManager::androidBuildDirectory(target());
if (m_buildAAB) {
const QString bt = buildType() == BuildConfiguration::Release ? QLatin1String("release")
: QLatin1String("debug");
m_packagePath = outputDir.pathAppended(
QString("build/outputs/bundle/%1/android-build-%1.aab").arg(bt));
} else {
m_packagePath = AndroidManager::apkPath(target());
}
m_packagePath = AndroidManager::packagePath(target());
qCDebug(buildapkstepLog).noquote() << "APK or AAB path:" << m_packagePath.toUserOutput();