From 0c498153331d79715ecfe431eb27065748628ba8 Mon Sep 17 00:00:00 2001 From: BogDan Vatra Date: Mon, 28 Jan 2019 17:11:35 +0200 Subject: Fix llvm-strip error In NDKr19 they removed "-strip-all-gnu" argument, now llvm-strip prints tons of: .../llvm-strip: error: unknown argument '-strip-all-gnu'. Change-Id: I11bb2d6abcc5f236730c57b5b93cc932c7ba58c6 Reviewed-by: Andy Shaw --- src/tools/androiddeployqt/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/tools') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index 587ae21e4f..76c521ca8f 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -1880,7 +1880,7 @@ bool stripFile(const Options &options, const QString &fileName) } if (options.useLLVM) - strip = QString::fromLatin1("%1 -strip-all -strip-all-gnu %2").arg(shellQuote(strip), shellQuote(fileName)); + strip = QString::fromLatin1("%1 -strip-all %2").arg(shellQuote(strip), shellQuote(fileName)); else strip = QString::fromLatin1("%1 %2").arg(shellQuote(strip), shellQuote(fileName)); -- cgit v1.2.3 From 9435526d507611b8b54f7c65df9febdde193c7bf Mon Sep 17 00:00:00 2001 From: Andy Shaw Date: Mon, 15 Oct 2018 09:23:26 +0200 Subject: qmake: Add variables for setting the version number and name in Android This makes it much easier to have the version information set for an Android APK without having to manually modify the AndroidManifest.xml each time. [ChangeLog][Android][qmake] Can now set the version name and code for Android using ANDROID_VERSION_NAME and ANDROID_VERSION_CODE respectively in the pro file. Change-Id: Ie6813bc3a7444f7baa5e772b93bc2695d9b81e57 Done-with: Markus Maier Reviewed-by: Markus Maier Reviewed-by: BogDan Vatra --- src/tools/androiddeployqt/main.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'src/tools') diff --git a/src/tools/androiddeployqt/main.cpp b/src/tools/androiddeployqt/main.cpp index af3a3ae39a..9402a1a881 100644 --- a/src/tools/androiddeployqt/main.cpp +++ b/src/tools/androiddeployqt/main.cpp @@ -148,6 +148,10 @@ struct Options QString rootPath; QStringList qmlImportPaths; + // Versioning + QString versionName; + QString versionCode; + // lib c++ path QString stdCppPath; QString stdCppName = QStringLiteral("gnustl_shared"); @@ -756,6 +760,22 @@ bool readInputFile(Options *options) options->androidSourceDirectory = androidSourcesDirectory.toString(); } + { + const QJsonValue androidVersionName = jsonObject.value(QStringLiteral("android-version-name")); + if (!androidVersionName.isUndefined()) + options->versionName = androidVersionName.toString(); + else + options->versionName = QStringLiteral("1.0"); + } + + { + const QJsonValue androidVersionCode = jsonObject.value(QStringLiteral("android-version-code")); + if (!androidVersionCode.isUndefined()) + options->versionCode = androidVersionCode.toString(); + else + options->versionCode = QStringLiteral("1"); + } + { const QJsonValue applicationBinary = jsonObject.value(QStringLiteral("application-binary")); if (applicationBinary.isUndefined()) { @@ -1324,6 +1344,8 @@ bool updateAndroidManifest(Options &options) replacements[QLatin1String("-- %%INSERT_LOCAL_LIBS%% --")] = localLibs.join(QLatin1Char(':')); replacements[QLatin1String("-- %%INSERT_LOCAL_JARS%% --")] = options.localJars.join(QLatin1Char(':')); replacements[QLatin1String("-- %%INSERT_INIT_CLASSES%% --")] = options.initClasses.join(QLatin1Char(':')); + replacements[QLatin1String("-- %%INSERT_VERSION_NAME%% --")] = options.versionName; + replacements[QLatin1String("-- %%INSERT_VERSION_CODE%% --")] = options.versionCode; replacements[QLatin1String("package=\"org.qtproject.example\"")] = QString::fromLatin1("package=\"%1\"").arg(options.packageName); replacements[QLatin1String("-- %%BUNDLE_LOCAL_QT_LIBS%% --")] = (options.deploymentMechanism == Options::Bundled) ? QString::fromLatin1("1") : QString::fromLatin1("0"); -- cgit v1.2.3