Android: Support to change minSdkVersion (#8313)
This commit is contained in:
parent
fccf2816d4
commit
93b417fe17
2 changed files with 14 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue