Android: allow setting javac build version from the configure script
The configure options -android-javac-source and -android-javac-target can be used to set the version numbers. Fixes: QTBUG-86282 Pick-to: 5.15 Change-Id: I36b0665de2c31e16bf6d138859b5503455eb8e66 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Andy Shaw <andy.shaw@qt.io>
This commit is contained in:
parent
5ce24fab73
commit
675805e9eb
@ -210,6 +210,8 @@ Build environment:
|
||||
[$ANDROID_NDK_HOST]
|
||||
-android-abis ....... Comma separated Android abis, default is:
|
||||
armeabi-v7a,arm64-v8a,x86,x86_64
|
||||
-android-javac-target Set the javac build target version [7]
|
||||
-android-javac-source Set the javac build source version [7]
|
||||
-android-style-assets Automatically extract style assets from the device at
|
||||
run time. This option makes the Android style behave
|
||||
correctly, but also makes the Android platform plugin
|
||||
|
@ -55,6 +55,8 @@
|
||||
"android-ndk-host": "string",
|
||||
"android-ndk-platform": "string",
|
||||
"android-sdk": "string",
|
||||
"android-javac-target": "string",
|
||||
"android-javac-source": "string",
|
||||
|
||||
"android-style-assets": "boolean",
|
||||
"appstore-compliant": "boolean",
|
||||
|
@ -627,12 +627,17 @@ defineTest(qtConfOutput_prepareOptions) {
|
||||
isEmpty(platform): \
|
||||
platform = android-23
|
||||
|
||||
android_javac_target = $$eval(config.input.android-javac-target)
|
||||
android_javac_source = $$eval(config.input.android-javac-source)
|
||||
|
||||
$${currentConfig}.output.devicePro += \
|
||||
"DEFAULT_ANDROID_SDK_ROOT = $$val_escape(sdk_root)" \
|
||||
"DEFAULT_ANDROID_NDK_ROOT = $$val_escape(ndk_root)" \
|
||||
"DEFAULT_ANDROID_PLATFORM = $$platform" \
|
||||
"DEFAULT_ANDROID_NDK_HOST = $$ndk_host" \
|
||||
"DEFAULT_ANDROID_ABIS = $$split(android_abis, ',')"
|
||||
"DEFAULT_ANDROID_ABIS = $$split(android_abis, ',')" \
|
||||
"ANDROID_JAVAC_TARGET_VERSION = $$android_javac_target" \
|
||||
"ANDROID_JAVAC_SOURCE_VERSION = $$android_javac_source"
|
||||
}
|
||||
|
||||
export($${currentConfig}.output.devicePro)
|
||||
|
@ -20,7 +20,16 @@ CONFIG += plugin no_plugin_name_prefix
|
||||
javac.input = JAVASOURCES
|
||||
javac.output = $$CLASS_DIR
|
||||
javac.CONFIG += combine
|
||||
javac.commands = javac -source 7 -target 7 -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEPARATOR))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
|
||||
|
||||
# Check for user defined javac build version
|
||||
javac_target_version = $$ANDROID_JAVAC_TARGET_VERSION
|
||||
isEmpty(javac_target_version): javac_target_version = 7
|
||||
|
||||
javac_source_version = $$ANDROID_JAVAC_SOURCE_VERSION
|
||||
isEmpty(javac_source_version): javac_source_version = 7
|
||||
|
||||
javac.commands = javac -source $$javac_source_version -target $$javac_target_version -Xlint:unchecked -bootclasspath $$ANDROID_JAR_FILE -cp $$shell_quote($$system_path($$join(JAVACLASSPATH, $$DIRLIST_SEPARATOR))) -d $$shell_quote($$CLASS_DIR) ${QMAKE_FILE_IN}
|
||||
|
||||
# Force rebuild every time, because we don't know the paths of the destination files
|
||||
# as they depend on the code.
|
||||
javac.depends = FORCE
|
||||
|
Loading…
Reference in New Issue
Block a user