From 32e3eae83ef3c7513f0455f8c81b30843250ab91 Mon Sep 17 00:00:00 2001 From: David Boho Date: Wed, 14 Nov 2018 14:00:36 +0100 Subject: [PATCH] GH-552 (android) check for build-extras.gradle in the app-parent directory (#553) as documented in https://cordova.apache.org/docs/en/latest/guide/platforms/android/?#extending-buildgradle and deal with multiple build-extras.gradle locations Co-authored-by: David Boho Co-authored-by: Christopher J. Brody --- bin/templates/project/app/build.gradle | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/templates/project/app/build.gradle b/bin/templates/project/app/build.gradle index 27a2b83f..4830dd93 100644 --- a/bin/templates/project/app/build.gradle +++ b/bin/templates/project/app/build.gradle @@ -93,11 +93,16 @@ ext { // PLUGIN GRADLE EXTENSIONS START // PLUGIN GRADLE EXTENSIONS END -def hasBuildExtras = file('build-extras.gradle').exists() -if (hasBuildExtras) { +def hasBuildExtras1 = file('build-extras.gradle').exists() +if (hasBuildExtras1) { apply from: 'build-extras.gradle' } +def hasBuildExtras2 = file('../build-extras.gradle').exists() +if (hasBuildExtras2) { + apply from: '../build-extras.gradle' +} + // Set property defaults after extension .gradle files. if (ext.cdvCompileSdkVersion == null) { ext.cdvCompileSdkVersion = privateHelpers.getProjectTarget()