From 4bcef03a8de5abb3f93360215e1b21da33577beb Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 2 Oct 2013 09:06:45 +0200 Subject: [PATCH] Android: Build against new build tools revisions Whenever the SDK updates the build tools it's put inside a new subdirectory with the version number, so with every new version we would have to update the java.prf feature. Instead, we iterate over the available revisions and pick the lexicographically highest one (which is sufficient as long as the major version is double digits.) Change-Id: I2392ef6261ef36ed741c80fa6f981486e7844e0a Reviewed-by: Paul Olav Tvete --- mkspecs/features/java.prf | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mkspecs/features/java.prf b/mkspecs/features/java.prf index 265ab11fea..eeaafcc883 100644 --- a/mkspecs/features/java.prf +++ b/mkspecs/features/java.prf @@ -9,7 +9,13 @@ android { isEmpty(BUILD_TOOLS_REVISION) { BUILD_TOOLS_REVISION = $$(ANDROID_BUILD_TOOLS_REVISION) - isEmpty(BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = 17.0.0 + isEmpty(BUILD_TOOLS_REVISION) { + BUILD_TOOLS_REVISIONS = $$files($$SDK_ROOT/build-tools/*) + for (REVISION, BUILD_TOOLS_REVISIONS) { + BASENAME = $$basename(REVISION) + greaterThan(BASENAME, $$BUILD_TOOLS_REVISION): BUILD_TOOLS_REVISION = $$BASENAME + } + } } ANDROID_JAR_FILE = $$SDK_ROOT/platforms/$$API_VERSION_TO_USE/android.jar