From fd12c80131a425bfb4bf59e054afd0851a02e9fc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julio=20C=C3=A9sar?= Date: Tue, 28 Feb 2017 01:30:37 +0100 Subject: [PATCH] Don't set minSdkVersion if another plugin set a greater value --- src/android/barcodescanner.gradle | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/android/barcodescanner.gradle b/src/android/barcodescanner.gradle index 96edb181..115113d5 100644 --- a/src/android/barcodescanner.gradle +++ b/src/android/barcodescanner.gradle @@ -1,4 +1,8 @@ -cdvMinSdkVersion = Math.max(15, cdvHelpers.getConfigPreference('android-minSdkVersion', 0) as Integer) +def DEFAULT_MIN_SDK_VERSION = 15 +def minSdk = Math.max(DEFAULT_MIN_SDK_VERSION, cdvHelpers.getConfigPreference('android-minSdkVersion',0) as Integer); +if (cdvMinSdkVersion == null || Integer.parseInt(cdvMinSdkVersion) < minSdk ) { + ext.cdvMinSdkVersion = minSdk; +} repositories{ jcenter()