summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2016-03-21 11:38:05 +0100
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2016-04-11 15:38:36 +0000
commit0a1c8cc6686cb80cb5c35509c9eaa1fe9e27c495 (patch)
treef3723d9ddbdddafbefe431e19baad6d8fdb93bc8
parentb9d386f2ccd69c7f6a766a6d90a6024eeb48e90a (diff)
Android: Support build with latest available SDK version
To make custom builds of Qt possible, we no longer require the minimum SDK platform to be present on the system. Instead we will look for any version higher than the minimum requirement if the minimum is not available. If the minimum required platform is available, then it will still be preferred. Change-Id: I3e804af89aba36e27a7da1e46a25c0c5798aeaf2 Reviewed-by: BogDan Vatra <bogdan@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
-rw-r--r--mkspecs/features/java.prf13
1 files changed, 12 insertions, 1 deletions
diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf
index 54dced2865..6b9bbd3409 100644
--- a/mkspecs/features/java.prf
+++ b/mkspecs/features/java.prf
@@ -6,7 +6,18 @@ android {
ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
!exists($$ANDROID_JAR_FILE) {
- error("The Path $$ANDROID_JAR_FILE does not exist. Make sure the ANDROID_SDK_ROOT and ANDROID_API_VERSION environment variables are correctly set.")
+ ANDROID_API_VERSION = $$section(API_VERSION_TO_USE, -, 1, 1) # Get version number from android-XY to ensure numeric comparison
+ ANDROID_API_VERSIONS = $$files($$ANDROID_SDK_ROOT/platforms/*)
+ for (VERSION, ANDROID_API_VERSIONS) {
+ BASENAME = $$basename(VERSION)
+ BASENAME = $$section(BASENAME, -, 1, 1)
+ greaterThan(BASENAME, $$ANDROID_API_VERSION): ANDROID_API_VERSION = $$BASENAME
+ }
+ API_VERSION_TO_USE = android-$$ANDROID_API_VERSION
+ ANDROID_JAR_FILE = $$ANDROID_SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar
+ }
+ !exists($$ANDROID_JAR_FILE) {
+ error("No suitable Android SDK platform found. Minimum version is $${API_VERSION_TO_USE}.")
}
JAVACLASSPATH += $$ANDROID_JAR_FILE