summaryrefslogtreecommitdiffstats
path: root/mkspecs/features/java.prf
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2016-05-03 17:03:26 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2016-05-03 18:58:24 +0000
commit69c2a606b36858454ec0b53b5d9789cf8e524806 (patch)
tree86a97816b5e4bf4be5937774f5b8fd2a126b8086 /mkspecs/features/java.prf
parent224db5e6eb07154ba2e974a96ee617bf7d740134 (diff)
parent6357813207c866c99aadfd91af8fb3affe891f1d (diff)
Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/dev
Diffstat (limited to 'mkspecs/features/java.prf')
-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