From 33feb00e8f383cd99ce59a052171d6d35c61094c Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Tue, 13 Jun 2017 10:11:41 -0700 Subject: [PATCH] Adding the if statement to see if we can support both structures with minimal editing, TODO: actually write tests for this somehow --- bin/templates/project/app/build.gradle | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/templates/project/app/build.gradle b/bin/templates/project/app/build.gradle index 5134793f..78a1770d 100644 --- a/bin/templates/project/app/build.gradle +++ b/bin/templates/project/app/build.gradle @@ -45,7 +45,12 @@ task wrapper(type: Wrapper) { // Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties. // Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html ext { - apply from: '../CordovaLib/cordova.gradle' + //This is a dirty hack to support legacy projects + if (file('../CordovaLib/cordova.gradle').exists()) { + apply from: '../CordovaLib/cordova.gradle' + } else { + apply from: 'CordovaLib/cordova.gradle' + } // The value for android.compileSdkVersion. if (!project.hasProperty('cdvCompileSdkVersion')) { cdvCompileSdkVersion = null;