diff options
author | Raphaël Cotty <raphael.cotty@gmail.com> | 2020-10-16 22:44:41 +0200 |
---|---|---|
committer | Raphaël Cotty <raphael.cotty@gmail.com> | 2020-11-17 19:22:18 +0000 |
commit | e8b186610738a16fe8ddaacd39797d863828c7aa (patch) | |
tree | 1d9e2d60012739ccdfd5375b208580092ef8bc80 /share | |
parent | f4c76e08f24b48e142683cea54b4c64a75083f17 (diff) |
Android: Update for Qt 6
Manage the new directory layout of Qt6.
Update generation of the input file for androiddeployqt.
Fixes: QBS-1613
Fixes: QBS-1609
Change-Id: Ie633fad467f310bfc4cd42e9c32d9cfc2e734582
Reviewed-by: Ivan Komissarov <ABBAPOH@gmail.com>
Diffstat (limited to 'share')
4 files changed, 45 insertions, 7 deletions
diff --git a/share/qbs/module-providers/Qt/setup-qt.js b/share/qbs/module-providers/Qt/setup-qt.js index c7b722563..a50770b18 100644 --- a/share/qbs/module-providers/Qt/setup-qt.js +++ b/share/qbs/module-providers/Qt/setup-qt.js @@ -246,8 +246,8 @@ function getQtProperties(qmakeFilePath, qbs) { qtProps.includePath = pathQueryValue(queryResult, "QT_INSTALL_HEADERS"); qtProps.libraryPath = pathQueryValue(queryResult, "QT_INSTALL_LIBS"); qtProps.hostLibraryPath = pathQueryValue(queryResult, "QT_HOST_LIBS"); - qtProps.binaryPath = pathQueryValue(queryResult, "QT_HOST_BINS") - || pathQueryValue(queryResult, "QT_INSTALL_BINS"); + qtProps.binaryPath = pathQueryValue(queryResult, "QT_HOST_BINS"); + qtProps.installPath = pathQueryValue(queryResult, "QT_INSTALL_BINS"); qtProps.documentationPath = pathQueryValue(queryResult, "QT_INSTALL_DOCS"); qtProps.pluginPath = pathQueryValue(queryResult, "QT_INSTALL_PLUGINS"); qtProps.qmlPath = pathQueryValue(queryResult, "QT_INSTALL_QML"); @@ -1329,6 +1329,7 @@ function replaceSpecialValues(content, module, qtProps, abi) { config: ModUtils.toJSLiteral(qtProps.configItems), qtConfig: ModUtils.toJSLiteral(qtProps.qtConfigItems), binPath: ModUtils.toJSLiteral(qtProps.binaryPath), + installPath: ModUtils.toJSLiteral(qtProps.installPath), libPath: ModUtils.toJSLiteral(qtProps.libraryPath), pluginPath: ModUtils.toJSLiteral(qtProps.pluginPath), incPath: ModUtils.toJSLiteral(qtProps.includePath), diff --git a/share/qbs/module-providers/Qt/templates/android_support.qbs b/share/qbs/module-providers/Qt/templates/android_support.qbs index 1deedb0a7..bdbb0e43b 100644 --- a/share/qbs/module-providers/Qt/templates/android_support.qbs +++ b/share/qbs/module-providers/Qt/templates/android_support.qbs @@ -15,8 +15,9 @@ Module { property stringList extraLibs // qmake: ANDROID_EXTRA_LIBS property bool verboseAndroidDeployQt: false - property string _androidDeployQtFilePath: FileInfo.joinPaths(_qtInstallDir, "bin", + property string _androidDeployQtFilePath: FileInfo.joinPaths(_qtBinaryDir, "bin", "androiddeployqt") + property string _qtBinaryDir property string _qtInstallDir // TODO: Remove in 1.20 // From 1.20 product property used from an export item will point to the @@ -54,9 +55,14 @@ Module { } Properties { condition: _enableSdkSupport && Utilities.versionCompare(version, "5.15") >= 0 + && Utilities.versionCompare(version, "6.0") < 0 java.additionalClassPaths: [FileInfo.joinPaths(_qtInstallDir, "jar", "QtAndroid.jar")] } Properties { + condition: _enableSdkSupport && Utilities.versionCompare(version, "6.0") >= 0 + java.additionalClassPaths: [FileInfo.joinPaths(_qtInstallDir, "jar", "Qt6Android.jar")] + } + Properties { condition: _enableNdkSupport && (Android.ndk.abi === "armeabi-v7a" || Android.ndk.abi === "x86") cpp.defines: "ANDROID_HAS_WSTRING" } @@ -65,11 +71,19 @@ Module { Android.sdk._archInName: _multiAbi Android.sdk._bundledInAssets: _multiAbi } + Properties { + condition: _enableSdkSupport && Utilities.versionCompare(version, "6.0") < 0 + Android.sdk.minimumVersion: "21" + } + Properties { + condition: _enableSdkSupport && Utilities.versionCompare(version, "6.0") >= 0 + Android.sdk.minimumVersion: "23" + } Rule { condition: _enableSdkSupport multiplex: true - property stringList inputTags: "android.nativelibrary" + property stringList inputTags: ["android.nativelibrary", "qrc"] inputsFromDependencies: inputTags inputs: product.aggregate ? [] : inputTags Artifact { @@ -180,6 +194,21 @@ Module { if (Array.isArray(product.qmlImportPaths) && product.qmlImportPaths.length > 0) f.writeLine('"qml-import-paths": "' + product.qmlImportPaths.join(',') + '",'); + if (Utilities.versionCompare(product.Qt.android_support.version, "6.0") >= 0) { + f.writeLine('"qml-importscanner-binary": "' + + product.Qt.core.qmlImportScannerFilePath + '",'); + f.writeLine('"rcc-binary": "' + product.Qt.core.binPath + '/rcc' + '",'); + + if (inputs["qrc"] && inputs["qrc"].length > 0) { + var qrcFiles = []; + var qrcInputs = inputs["qrc"]; + for (i = 0; i < qrcInputs.length; ++i) { + qrcFiles.push(qrcInputs[i].filePath); + } + f.writeLine('"qrcFiles": "' + qrcFiles.join(',') + '",'); + } + } + // QBS-1429 if (!product.Qt.android_support._multiAbi) { f.writeLine('"stdcpp-path": "' + (product.cpp.sharedStlFilePath @@ -191,6 +220,7 @@ Module { '/toolchains/llvm/prebuilt/' + hostArch + '/sysroot/usr/lib/",'); f.writeLine('"application-binary": "' + theBinary.product.targetName + '"'); } + f.writeLine("}"); f.close(); }; diff --git a/share/qbs/module-providers/Qt/templates/core.qbs b/share/qbs/module-providers/Qt/templates/core.qbs index 10359e751..113f868cf 100644 --- a/share/qbs/module-providers/Qt/templates/core.qbs +++ b/share/qbs/module-providers/Qt/templates/core.qbs @@ -21,9 +21,15 @@ Module { Depends { name: "Qt.android_support"; condition: qbs.targetOS.contains("android") } Properties { condition: qbs.targetOS.contains("android") - Qt.android_support._qtInstallDir: FileInfo.path(binPath) + Qt.android_support._qtBinaryDir: FileInfo.path(binPath) + Qt.android_support._qtInstallDir: FileInfo.path(installPath) Qt.android_support.version: version } + // qmlImportScanner is required by androiddeployqt even if the project doesn't + // depend on qml. That's why the scannerName must be defined here and not in the + // qml module + property string qmlImportScannerName: "qmlimportscanner" + property string qmlImportScannerFilePath: binPath + '/' + qmlImportScannerName version: @version@ property stringList architectures: @archs@ @@ -32,6 +38,7 @@ Module { property stringList config: @config@ property stringList qtConfig: @qtConfig@ property path binPath: @binPath@ + property path installPath: @installPath@ property path incPath: @incPath@ property path libPath: @libPath@ property path pluginPath: @pluginPath@ diff --git a/share/qbs/module-providers/Qt/templates/qml.qbs b/share/qbs/module-providers/Qt/templates/qml.qbs index c63937649..f608ba4dd 100644 --- a/share/qbs/module-providers/Qt/templates/qml.qbs +++ b/share/qbs/module-providers/Qt/templates/qml.qbs @@ -6,8 +6,8 @@ QtModule { qtModuleName: "Qml" Depends { name: "Qt"; submodules: @dependencies@} - property string qmlImportScannerName: "qmlimportscanner" - property string qmlImportScannerFilePath: Qt.core.binPath + '/' + qmlImportScannerName + property string qmlImportScannerName: Qt.core.qmlImportScannerName + property string qmlImportScannerFilePath: Qt.core.qmlImportScannerFilePath property string qmlPath: @qmlPath@ property bool generateCacheFiles: false |