summaryrefslogtreecommitdiff
path: root/platform/android
diff options
context:
space:
mode:
authorRamesh Ravone <ramesh.maran443@gmail.com>2017-04-10 03:05:34 +0530
committerRĂ©mi Verschelde <rverschelde@gmail.com>2017-04-09 23:35:34 +0200
commit93b417fe17dd92e8fe22c3c4b72347d948ca128e (patch)
treec123da2d56d0bbf36de7e567a851156eb016d036 /platform/android
parentfccf2816d4b7561ad84a60398487a042e4ea905b (diff)
Android: Support to change minSdkVersion (#8313)
Diffstat (limited to 'platform/android')
-rw-r--r--platform/android/SCsub14
-rw-r--r--platform/android/build.gradle.template2
2 files changed, 14 insertions, 2 deletions
diff --git a/platform/android/SCsub b/platform/android/SCsub
index 02a8c3bc42..a6da33e7bf 100644
--- a/platform/android/SCsub
+++ b/platform/android/SCsub
@@ -92,9 +92,23 @@ gradle_asset_dirs_text = ""
gradle_default_config_text = ""
+minSdk = 14
+targetSdk = 23
+
for x in env.android_default_config:
+ if x.startswith("minSdkVersion") and int(x.split(" ")[-1]) < minSdk:
+ x = "minSdkVersion " + str(minSdk)
+ if x.startswith("targetSdkVersion") and int(x.split()[-1]) > targetSdk:
+ x = "targetSdkVersion " + str(targetSdk)
+
gradle_default_config_text += x + "\n\t\t"
+if "minSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("minSdkVersion " + str(minSdk) + "\n\t\t")
+
+if "targetSdkVersion" not in gradle_default_config_text:
+ gradle_default_config_text += ("targetSdkVersion " + str(targetSdk) + "\n\t\t")
+
gradle_text = gradle_text.replace("$$GRADLE_REPOSITORY_URLS$$", gradle_maven_repos_text)
gradle_text = gradle_text.replace("$$GRADLE_DEPENDENCIES$$", gradle_maven_dependencies_text)
gradle_text = gradle_text.replace("$$GRADLE_JAVA_DIRS$$", gradle_java_dirs_text)
diff --git a/platform/android/build.gradle.template b/platform/android/build.gradle.template
index ec5bbb6630..8dfb006c00 100644
--- a/platform/android/build.gradle.template
+++ b/platform/android/build.gradle.template
@@ -39,8 +39,6 @@ android {
exclude 'META-INF/NOTICE'
}
defaultConfig {
- minSdkVersion 14
- targetSdkVersion 23
$$GRADLE_DEFAULT_CONFIG$$
}
// Both signing and zip-aligning will be done at export time