From 4fc50392e586e08ff0a63748a21d95b5518d4b8c Mon Sep 17 00:00:00 2001 From: jcesarmobile Date: Thu, 19 Mar 2020 11:40:21 +0100 Subject: [PATCH] feat(android): Make variables.gradle file not mandatory (#2600) --- capacitor-cordova-android-plugins/build.gradle | 4 ++++ cli/src/android/update.ts | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/capacitor-cordova-android-plugins/build.gradle b/capacitor-cordova-android-plugins/build.gradle index 16cee0c2e1..9d81326d30 100644 --- a/capacitor-cordova-android-plugins/build.gradle +++ b/capacitor-cordova-android-plugins/build.gradle @@ -1,3 +1,7 @@ +ext { + cordovaAndroidVersion = project.hasProperty('cordovaAndroidVersion') ? rootProject.ext.cordovaAndroidVersion : '7.0.0' +} + buildscript { repositories { google() diff --git a/cli/src/android/update.ts b/cli/src/android/update.ts index 0a7d24b3d1..fa270377c8 100644 --- a/cli/src/android/update.ts +++ b/cli/src/android/update.ts @@ -140,7 +140,7 @@ export async function handleCordovaPluginsGradle(config: Config, cordovaPlugins await writeFileAsync(pluginsGradlePath, buildGradle); const cordovaVariables = `// DO NOT EDIT THIS FILE! IT IS GENERATED EACH TIME "capacitor update" IS RUN ext { - cdvMinSdkVersion = rootProject.ext.minSdkVersion + cdvMinSdkVersion = project.hasProperty('minSdkVersion') ? rootProject.ext.minSdkVersion : ${config.android.minVersion} // Plugin gradle extensions can append to this to have code run at the end. cdvPluginPostBuildExtras = [] }`;