Skip to content

Commit

Permalink
Android - allow changing min sdk version (#1117)
Browse files Browse the repository at this point in the history
* try to allow changing min sdk version

* undo testing with cdvMinSdkVersion=21

* Update framework/build.gradle

No printing of default behaviour

Co-authored-by: Norman Breau <norman@nbsolutions.ca>

* Update framework/build.gradle

typo + match case of cdvMinSdkVersion

Co-authored-by: Norman Breau <norman@nbsolutions.ca>

* resolve PR feedback timbru

Co-authored-by: Norman Breau <norman@nbsolutions.ca>
  • Loading branch information
PieterVanPoyer and breautek authored Nov 18, 2020
1 parent 671e1fd commit d5b9029
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions framework/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ ext {
apply from: 'cordova.gradle'
cdvCompileSdkVersion = privateHelpers.getProjectTarget()
cdvBuildToolsVersion = privateHelpers.findLatestInstalledBuildTools()
if (project.hasProperty('cdvMinSdkVersion') && cdvMinSdkVersion.isInteger()) {
cdvMinSdkVersion = cdvMinSdkVersion as int
println '[Cordova] cdvMinSdkVersion is overridden, try it at your own risk.'
} else {
cdvMinSdkVersion = 22; // current Cordova's default
}
}

buildscript {
Expand Down Expand Up @@ -60,9 +66,9 @@ android {
targetCompatibility JavaVersion.VERSION_1_8
}

// For the Android Cordova Lib, we will hardcode the minSdkVersion and not allow changes.
// For the Android Cordova Lib, we allow changing the minSdkVersion, but it is at the users own risk
defaultConfig {
minSdkVersion 22
minSdkVersion cdvMinSdkVersion
}

sourceSets {
Expand Down Expand Up @@ -141,7 +147,7 @@ bintray {
labels = ['android', 'cordova', 'phonegap']
version {
name = '9.1.0-dev'
released = new Date()
released = new Date()
vcsTag = '9.1.0-dev'
}
}
Expand Down

0 comments on commit d5b9029

Please sign in to comment.