From 0cc154d0ea1d459688fec1bd72bbed1e654efaf4 Mon Sep 17 00:00:00 2001 From: ZhilkinSerg Date: Wed, 18 Dec 2019 01:49:41 +0300 Subject: [PATCH] More build customizations from properties file --- android/app/build.gradle | 12 ++++++++---- android/gradle.properties | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/android/app/build.gradle b/android/app/build.gradle index cf87866bedf07..eb6730497412e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -42,6 +42,10 @@ def abi64 = getProperty("abi64").toBoolean() def deps = getProperty("deps") def override_version = getProperty("override_version") def version_header_path = getProperty("version_header_path") +def override_compileSdkVersion = getProperty("override_compileSdkVersion") +def override_minSdkVersion = getProperty("override_minSdkVersion") +def override_targetSdkVersion = getProperty("override_targetSdkVersion") +def override_ndkBuildAppPlatform = getProperty("override_ndkBuildAppPlatform") if (!abi32 && !abi64) { throw new GradleException("Both `abi32` and `abi64` properties are set to false") @@ -94,7 +98,7 @@ unzipDeps.dependsOn makeLocalization preBuild.dependsOn unzipDeps android { - compileSdkVersion 28 + compileSdkVersion override_compileSdkVersion if (override_version.isEmpty()) { println("Generating version number to $version_header_path") @@ -127,8 +131,8 @@ android { } defaultConfig { - minSdkVersion 14 - targetSdkVersion 28 + minSdkVersion override_minSdkVersion + targetSdkVersion overrid_targetSdkVersion versionCode Integer.valueOf(System.env.UPSTREAM_BUILD_NUMBER ?: 1) versionName new File("$version_header_path").text.split('\"')[1] if (buildAsApplication) { @@ -158,7 +162,7 @@ android { externalNativeBuild { ndkBuild { - arguments "APP_PLATFORM=android-16", "-j$njobs" + arguments "APP_PLATFORM=$override_ndkBuildAppPlatform", "-j$njobs" } } testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" diff --git a/android/gradle.properties b/android/gradle.properties index 237d31ed23283..80b12331f351b 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -43,3 +43,19 @@ override_version= # This property controls path where overriden version number header should be generated # You can override this from the command line by passing "-Pversion_header_path=#" version_header_path=app/jni/src/version.h + +# This property controls which compileSdkVersion should be used +# You can override this from the command line by passing "-Poverride_compileSdkVersion=#" +override_compileSdkVersion=28 + +# This property controls which minSdkVersion should be used +# You can override this from the command line by passing "-Poverride_minSdkVersion=#" +override_minSdkVersion=14 + +# This property controls which targetSdkVersion should be used +# You can override this from the command line by passing "-Poverride_targetSdkVersion=#" +override_targetSdkVersion=28 + +# This property controls which ndkBuildAppPlatform should be used +# You can override this from the command line by passing "-Poverride_ndkBuildAppPlatform=#" +override_ndkBuildAppPlatform=android-16