summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Komissarov <abbapoh@gmail.com>2020-10-26 12:53:36 +0100
committerIvan Komissarov <abbapoh@gmail.com>2020-10-26 12:53:36 +0100
commit6bceb1b73945e636087ca5afda431172b02ae0af (patch)
tree8250b53caad6b07692a980f54edfc29559caab75
parentf4d1c96b9aa73a5c215c7f76551df1ae4e7d9d54 (diff)
parent6668da028ba9a3854a2190191a899efc6bccb2f8 (diff)
downloadqbs-6bceb1b73945e636087ca5afda431172b02ae0af.tar.gz
Merge branch '1.17'
Change-Id: Ifcd65b201f060506d53dcffc0031d186a6dc227e
-rw-r--r--changelogs/changes-1.17.1.md10
-rw-r--r--doc/reference/modules/android-sdk-module.qdoc16
-rw-r--r--share/qbs/imports/qbs/base/QtApplication.qbs4
-rw-r--r--share/qbs/module-providers/Qt/templates/android_support.qbs9
-rw-r--r--share/qbs/modules/Android/sdk/sdk.qbs20
-rw-r--r--share/qbs/modules/cpp/ios-gcc.qbs8
-rw-r--r--src/lib/corelib/jsextensions/process.cpp4
-rw-r--r--tests/auto/blackbox/tst_blackboxandroid.cpp75
8 files changed, 97 insertions, 49 deletions
diff --git a/changelogs/changes-1.17.1.md b/changelogs/changes-1.17.1.md
new file mode 100644
index 000000000..ef5a39f83
--- /dev/null
+++ b/changelogs/changes-1.17.1.md
@@ -0,0 +1,10 @@
+# Important bugfixes
+
+* Android: Fix support for Qt 5.15 (QBS-1580).
+* Android: Allow exporting of Qt modules in Export items (QBS-1576)
+* Darwin: Fix ios-simulator builds with XCode 12
+
+# Contributors
+
+* Raphaƫl Cotty
+* Ivan Komissarov
diff --git a/doc/reference/modules/android-sdk-module.qdoc b/doc/reference/modules/android-sdk-module.qdoc
index a57eb8f93..76a10f69e 100644
--- a/doc/reference/modules/android-sdk-module.qdoc
+++ b/doc/reference/modules/android-sdk-module.qdoc
@@ -249,3 +249,19 @@
\defaultvalue \c "apk"
*/
+
+/*!
+ \qmlproperty string Android.sdk::minimumVersion
+
+ Minimum API Level required for the application to run.
+
+ \defaultvalue \c "21"
+*/
+
+/*!
+ \qmlproperty string Android.sdk::targetVersion
+
+ API Level that the application targets.
+
+ \defaultvalue \c platformVersion
+*/
diff --git a/share/qbs/imports/qbs/base/QtApplication.qbs b/share/qbs/imports/qbs/base/QtApplication.qbs
index b6776dca0..32800d294 100644
--- a/share/qbs/imports/qbs/base/QtApplication.qbs
+++ b/share/qbs/imports/qbs/base/QtApplication.qbs
@@ -30,8 +30,4 @@
CppApplication {
Depends { name: "Qt.core" }
- Properties {
- condition: isForAndroid && Qt.android_support._multiAbi
- targetName: name + "_" + Android.ndk.abi
- }
}
diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs
index a7eb8fdcf..1deedb0a7 100644
--- a/share/qbs/module-providers/Qt/templates/android_support.qbs
+++ b/share/qbs/module-providers/Qt/templates/android_support.qbs
@@ -53,6 +53,10 @@ Module {
java._tagJniHeaders: false // prevent rule cycle
}
Properties {
+ condition: _enableSdkSupport && Utilities.versionCompare(version, "5.15") >= 0
+ java.additionalClassPaths: [FileInfo.joinPaths(_qtInstallDir, "jar", "QtAndroid.jar")]
+ }
+ Properties {
condition: _enableNdkSupport && (Android.ndk.abi === "armeabi-v7a" || Android.ndk.abi === "x86")
cpp.defines: "ANDROID_HAS_WSTRING"
}
@@ -185,7 +189,7 @@ Module {
} else {
f.writeLine('"stdcpp-path": "' + product.Android.sdk.ndkDir +
'/toolchains/llvm/prebuilt/' + hostArch + '/sysroot/usr/lib/",');
- f.writeLine('"application-binary": "' + theBinary.product.name + '"');
+ f.writeLine('"application-binary": "' + theBinary.product.targetName + '"');
}
f.writeLine("}");
f.close();
@@ -292,7 +296,8 @@ Module {
FileInfo.joinPaths(product.Qt.android_support._deployQtOutDir,
"libs",
input.Android.ndk.abi,
- input.fileName));
+ input.baseName + "_" + input.Android.ndk.abi +
+ ".so"));
}
}
};
diff --git a/share/qbs/modules/Android/sdk/sdk.qbs b/share/qbs/modules/Android/sdk/sdk.qbs
index 31f3ed465..32aae89d9 100644
--- a/share/qbs/modules/Android/sdk/sdk.qbs
+++ b/share/qbs/modules/Android/sdk/sdk.qbs
@@ -67,6 +67,8 @@ Module {
property int buildToolsVersionMinor: buildToolsVersionParts[1]
property int buildToolsVersionPatch: buildToolsVersionParts[2]
property string platform: sdkProbe.platform
+ property string minimumVersion: "21"
+ property string targetVersion: platformVersion.toString()
property path bundletoolFilePath: bundletoolProbe.filePath
@@ -337,6 +339,20 @@ Module {
}
}
+ var usedSdkElem = rootElem.firstChild("uses-sdk");
+ if (!usedSdkElem || !usedSdkElem.isElement()) {
+ usedSdkElem = manifestData.createElement("uses-sdk");
+ rootElem.appendChild(usedSdkElem);
+ } else {
+ if (!usedSdkElem.isElement())
+ throw "Tag uses-sdk is not an element in '" + input.filePath + "'.";
+ }
+ usedSdkElem.setAttribute("android:minSdkVersion",
+ product.Android.sdk.minimumVersion);
+ usedSdkElem.setAttribute("android:targetSdkVersion",
+ product.Android.sdk.targetVersion);
+
+ rootElem.appendChild(usedSdkElem);
manifestData.save(output.filePath, 4);
}
return cmd;
@@ -460,7 +476,9 @@ Module {
inputs: product.aggregate ? [] : inputTags
Artifact {
filePath: FileInfo.joinPaths(product.Android.sdk.packageContentsDir, "lib",
- input.Android.ndk.abi, input.fileName)
+ input.Android.ndk.abi, product.Android.sdk._archInName ?
+ input.baseName + "_" + input.Android.ndk.abi + ".so" :
+ input.fileName)
fileTags: "android.nativelibrary_deployed"
}
prepare: {
diff --git a/share/qbs/modules/cpp/ios-gcc.qbs b/share/qbs/modules/cpp/ios-gcc.qbs
index 0ff99679f..2d73c8125 100644
--- a/share/qbs/modules/cpp/ios-gcc.qbs
+++ b/share/qbs/modules/cpp/ios-gcc.qbs
@@ -39,6 +39,14 @@ DarwinGCC {
condition: qbs.targetOS.contains('ios') &&
qbs.toolchain && qbs.toolchain.contains('gcc')
+ minimumIosVersion: {
+ if (qbs.architecture == "armv7a")
+ return "6.0";
+ // XCode 12 requres version (at least 8.0) to be present in the -target triplet
+ // when compiling for ios-simulator
+ if (xcode.present && Utilities.versionCompare(xcode.version, "12.0") >= 0)
+ return "8.0";
+ }
targetSystem: "ios" + (minimumIosVersion || "")
minimumDarwinVersion: minimumIosVersion
diff --git a/src/lib/corelib/jsextensions/process.cpp b/src/lib/corelib/jsextensions/process.cpp
index 064297a32..a91084b4a 100644
--- a/src/lib/corelib/jsextensions/process.cpp
+++ b/src/lib/corelib/jsextensions/process.cpp
@@ -213,8 +213,8 @@ int Process::exec(const QString &program, const QStringList &arguments, bool thr
} else if (m_qProcess->exitStatus() == QProcess::CrashExit || m_qProcess->exitCode() != 0) {
QString errorMessage = m_qProcess->error() == QProcess::Crashed
? Tr::tr("Error running '%1': %2").arg(program, m_qProcess->errorString())
- : Tr::tr("Process '%1' finished with exit code %2.").arg(program).arg(
- m_qProcess->exitCode());
+ : Tr::tr("Process '%1 %2' finished with exit code %3.").arg(program).
+ arg(arguments.join(QStringLiteral(" "))).arg(m_qProcess->exitCode());
const QString stdOut = readStdOut();
if (!stdOut.isEmpty())
errorMessage.append(Tr::tr(" The standard output was:\n")).append(stdOut);
diff --git a/tests/auto/blackbox/tst_blackboxandroid.cpp b/tests/auto/blackbox/tst_blackboxandroid.cpp
index 86c74cf08..f3d960ece 100644
--- a/tests/auto/blackbox/tst_blackboxandroid.cpp
+++ b/tests/auto/blackbox/tst_blackboxandroid.cpp
@@ -218,17 +218,15 @@ void TestBlackboxAndroid::android_data()
const QByteArray path = "lib/${ARCH}/";
return path + (usesClang ? "libc++_shared.so" : oldcxxLib);
};
- bool usingOldQt = true;
+ qbs::Version version(5, 13);
QStringList qmakeFilePaths = pQt.value(QStringLiteral("moduleProviders.Qt.qmakeFilePaths")).
toStringList();
- if (qmakeFilePaths.size() == 1) {
- qbs::Version version = TestBlackboxBase::qmakeVersion(qmakeFilePaths[0]);
- if (version.isValid() && version >= qbs::Version(5, 14))
- usingOldQt = false;
- }
+ if (qmakeFilePaths.size() == 1)
+ version = TestBlackboxBase::qmakeVersion(qmakeFilePaths[0]);
+ bool singleArchQt = (version < qbs::Version(5, 14));
QByteArrayList archsForQt;
- if (usingOldQt) {
+ if (singleArchQt) {
archsForQt = { pQt.value("qbs.architecture").toString().toUtf8() };
if (archsStringList.empty())
archsStringList << QStringLiteral("armv7a"); // must match default in common.qbs
@@ -298,7 +296,7 @@ void TestBlackboxAndroid::android_data()
auto qtAppExpectedFiles = [&](bool generateAab) {
QByteArrayList expectedFile;
- if (usingOldQt) {
+ if (singleArchQt) {
expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
cxxLibPath("libgnustl_shared.so", true),
"assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list",
@@ -422,7 +420,7 @@ void TestBlackboxAndroid::android_data()
<< enableAapt2 << generateAab << isIncrementalBuild;
auto qmlAppExpectedFiles = [&](bool generateAab) {
QByteArrayList expectedFile;
- if (usingOldQt) {
+ if (singleArchQt) {
expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
"assets/--Added-by-androiddeployqt--/qml/QtQuick.2/plugins.qmltypes",
"assets/--Added-by-androiddeployqt--/qml/QtQuick.2/qmldir",
@@ -491,11 +489,19 @@ void TestBlackboxAndroid::android_data()
"lib/${ARCH}/libQt5Gui_${ARCH}.so",
"lib/${ARCH}/libQt5Network_${ARCH}.so",
"lib/${ARCH}/libQt5Qml_${ARCH}.so",
- "lib/${ARCH}/libQt5QuickParticles_${ARCH}.so",
"lib/${ARCH}/libQt5Quick_${ARCH}.so",
"lib/${ARCH}/libQt5QmlModels_${ARCH}.so",
"lib/${ARCH}/libQt5QmlWorkerScript_${ARCH}.so",
"lib/${ARCH}/libqmlapp_${ARCH}.so"}, generateAab);
+ if (version < qbs::Version(5, 15))
+ expectedFile << expandArchs(ndkArchsForQt, {
+ "lib/${ARCH}/libQt5QuickParticles_${ARCH}.so"}, generateAab);
+ if (version >= qbs::Version(5, 15))
+ expectedFile << expandArchs(ndkArchsForQt, {
+ "lib/${ARCH}/libqml_QtQml_StateMachine_qtqmlstatemachine_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_WorkerScript.2_workerscriptplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_Models.2_modelsplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_qmlplugin_${ARCH}.so"}, generateAab);
}
if (generateAab)
expectedFile << "base/resources.pb" << "base/assets.pb" << "base/native.pb";
@@ -506,7 +512,7 @@ void TestBlackboxAndroid::android_data()
auto qmlAppMinistroExpectedFiles = [&](bool generateAab) {
QByteArrayList expectedFile;
- if (usingOldQt) {
+ if (singleArchQt) {
expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
"assets/--Added-by-androiddeployqt--/qt_cache_pregenerated_file_list",
cxxLibPath("libgnustl_shared.so", true),
@@ -525,7 +531,7 @@ void TestBlackboxAndroid::android_data()
};
auto qmlAppCustomMetaDataExpectedFiles = [&](bool generateAab) {
QByteArrayList expectedFile;
- if (usingOldQt) {
+ if (singleArchQt) {
expectedFile << commonFiles(generateAab) + expandArchs(ndkArchsForQt, {
"assets/--Added-by-androiddeployqt--/qml/QtQuick.2/plugins.qmltypes",
"assets/--Added-by-androiddeployqt--/qml/QtQuick.2/qmldir",
@@ -596,11 +602,19 @@ void TestBlackboxAndroid::android_data()
"lib/${ARCH}/libQt5Gui_${ARCH}.so",
"lib/${ARCH}/libQt5Network_${ARCH}.so",
"lib/${ARCH}/libQt5Qml_${ARCH}.so",
- "lib/${ARCH}/libQt5QuickParticles_${ARCH}.so",
"lib/${ARCH}/libQt5Quick_${ARCH}.so",
"lib/${ARCH}/libQt5QmlModels_${ARCH}.so",
"lib/${ARCH}/libQt5QmlWorkerScript_${ARCH}.so",
"lib/${ARCH}/libqmlapp_${ARCH}.so"}, generateAab);
+ if (version < qbs::Version(5, 15))
+ expectedFile << expandArchs(ndkArchsForQt, {
+ "lib/${ARCH}/libQt5QuickParticles_${ARCH}.so"}, generateAab);
+ if (version >= qbs::Version(5, 15))
+ expectedFile << expandArchs(ndkArchsForQt, {
+ "lib/${ARCH}/libqml_QtQml_StateMachine_qtqmlstatemachine_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_WorkerScript.2_workerscriptplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_Models.2_modelsplugin_${ARCH}.so",
+ "lib/${ARCH}/libqml_QtQml_qmlplugin_${ARCH}.so"}, generateAab);
}
if (generateAab)
expectedFile << "base/resources.pb" << "base/assets.pb" << "base/native.pb";
@@ -609,7 +623,7 @@ void TestBlackboxAndroid::android_data()
return expectedFile;
};
QStringList qmlAppCustomProperties;
- if (usingOldQt) {
+ if (singleArchQt) {
qmlAppCustomProperties = QStringList{"modules.Android.sdk.automaticSources:false",
"modules.qbs.architecture:" + archsForQt.first()};
} else {
@@ -705,30 +719,6 @@ void TestBlackboxAndroid::android_data()
isIncrementalBuild = false;
enableAapt2 = false;
generateAab = false;
- QTest::newRow("no native")
- << "no-native"
- << QStringList("com.example.android.basicmediadecoder")
- << (QList<QByteArrayList>() << commonFiles(generateAab) + expandArchs(archs, {
- "resources.arsc",
- "res/drawable-hdpi-v4/ic_action_play_disabled.png",
- "res/drawable-hdpi-v4/ic_action_play.png",
- "res/drawable-hdpi-v4/ic_launcher.png",
- "res/drawable-hdpi-v4/tile.9.png",
- "res/drawable-mdpi-v4/ic_action_play_disabled.png",
- "res/drawable-mdpi-v4/ic_action_play.png",
- "res/drawable-mdpi-v4/ic_launcher.png",
- "res/drawable/selector_play.xml",
- "res/drawable-xhdpi-v4/ic_action_play_disabled.png",
- "res/drawable-xhdpi-v4/ic_action_play.png",
- "res/drawable-xhdpi-v4/ic_launcher.png",
- "res/drawable-xxhdpi-v4/ic_launcher.png",
- "res/layout/sample_main.xml",
- "res/menu/action_menu.xml",
- "res/menu-v11/action_menu.xml",
- "res/raw/vid_bigbuckbunny.mp4"}, generateAab))
- << QStringList{aaptVersion(enableAapt2), packageType(generateAab)}
- << enableAapt2 << generateAab << isIncrementalBuild;
- enableAapt2 = true;
auto noNativeExpectedFiles = [&](bool generateAab) {
QByteArrayList expectedFile;
expectedFile << commonFiles(generateAab) + expandArchs(archs, {
@@ -746,8 +736,6 @@ void TestBlackboxAndroid::android_data()
"res/drawable-xxhdpi-v4/ic_launcher.png",
"res/layout/sample_main.xml",
"res/menu/action_menu.xml",
- // I have no idea why this file is generated with aapt and not with aapt2
- //"res/menu-v11/action_menu.xml",
"res/raw/vid_bigbuckbunny.mp4"}, generateAab);
if (generateAab)
expectedFile << "base/resources.pb";
@@ -755,6 +743,13 @@ void TestBlackboxAndroid::android_data()
expectedFile << "resources.arsc";
return expectedFile;
};
+ QTest::newRow("no native")
+ << "no-native"
+ << QStringList("com.example.android.basicmediadecoder")
+ << (QList<QByteArrayList>() << noNativeExpectedFiles(generateAab))
+ << QStringList{aaptVersion(enableAapt2), packageType(generateAab)}
+ << enableAapt2 << generateAab << isIncrementalBuild;
+ enableAapt2 = true;
QTest::newRow("no native aapt2")
<< "no-native"
<< QStringList("com.example.android.basicmediadecoder")