Android: Let ANDROID_API_VERSION env var take precedence

If you specify ANDROID_API_VERSION to override the default
API versions used for building the jar files, this should
take precedence even when the .pro files specify a different
default API version (like QtAccessibility does when it sets
the default to android-16.) Otherwise it's impossible to
override these defaults.

Change-Id: Idef98aaf3b51490bd7ced8c53770ee2f5680b1db
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Christian Stromme <christian.stromme@digia.com>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2013-09-18 11:49:56 +02:00 committed by The Qt Project
parent e4f1d83b6a
commit 5a7da37be5

View File

@ -2,17 +2,17 @@ TEMPLATE = lib
android {
isEmpty(SDK_ROOT): SDK_ROOT = $$(ANDROID_SDK_ROOT)
isEmpty(SDK_ROOT): SDK_ROOT = $$DEFAULT_ANDROID_SDK_ROOT
isEmpty(API_VERSION) {
API_VERSION = $$(ANDROID_API_VERSION)
isEmpty(API_VERSION): API_VERSION = android-10
}
API_VERSION_TO_USE = $$(ANDROID_API_VERSION)
isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = $$API_VERSION
isEmpty(API_VERSION_TO_USE): API_VERSION_TO_USE = android-10
isEmpty(BUILD_TOOLS_REVISION) {
BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION)
isEmpty(BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = 17.0.0
}
ANDROID_JAR_FILE = $$SDK_ROOT/platforms/$$API_VERSION/android.jar
ANDROID_JAR_FILE = $$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.")
}