From d5b9029a23824910459a6d7ef420b941bcf5824e Mon Sep 17 00:00:00 2001 From: Pieter Van Poyer Date: Wed, 18 Nov 2020 18:48:46 +0100 Subject: [PATCH] Android - allow changing min sdk version (#1117) * 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 * Update framework/build.gradle typo + match case of cdvMinSdkVersion Co-authored-by: Norman Breau * resolve PR feedback timbru Co-authored-by: Norman Breau --- framework/build.gradle | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/framework/build.gradle b/framework/build.gradle index 8e25b2e77a..07c44e1cc2 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -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 { @@ -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 { @@ -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' } }