From 5c4f8ca24629486847d3222263921d1aaa0a69f5 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Wed, 4 Apr 2018 13:54:39 -0700 Subject: [PATCH] CB-14008: Updating Gradle Libraries to work with Android Studio 3.1.0 --- bin/templates/cordova/lib/builders/GradleBuilder.js | 2 +- bin/templates/cordova/lib/builders/StudioBuilder.js | 2 +- bin/templates/project/app/build.gradle | 4 ++-- bin/templates/project/build.gradle | 2 +- framework/build.gradle | 6 ++++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/templates/cordova/lib/builders/GradleBuilder.js b/bin/templates/cordova/lib/builders/GradleBuilder.js index 8237c739..30d3c0fb 100644 --- a/bin/templates/cordova/lib/builders/GradleBuilder.js +++ b/bin/templates/cordova/lib/builders/GradleBuilder.js @@ -247,7 +247,7 @@ GradleBuilder.prototype.prepEnv = function (opts) { // For some reason, using ^ and $ don't work. This does the job, though. var distributionUrlRegex = /distributionUrl.*zip/; /* jshint -W069 */ - var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip'; + var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.4-all.zip'; /* jshint +W069 */ var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties'); shell.chmod('u+w', gradleWrapperPropertiesPath); diff --git a/bin/templates/cordova/lib/builders/StudioBuilder.js b/bin/templates/cordova/lib/builders/StudioBuilder.js index 9587c755..17cdfd58 100644 --- a/bin/templates/cordova/lib/builders/StudioBuilder.js +++ b/bin/templates/cordova/lib/builders/StudioBuilder.js @@ -223,7 +223,7 @@ StudioBuilder.prototype.prepEnv = function (opts) { // If it's not set, do nothing, assuming that we're using a future version of gradle that we don't want to mess with. // For some reason, using ^ and $ don't work. This does the job, though. var distributionUrlRegex = /distributionUrl.*zip/; - var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.1-all.zip'; + var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.4-all.zip'; var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties'); shell.chmod('u+w', gradleWrapperPropertiesPath); shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath); diff --git a/bin/templates/project/app/build.gradle b/bin/templates/project/app/build.gradle index 586bcfa4..479b46db 100644 --- a/bin/templates/project/app/build.gradle +++ b/bin/templates/project/app/build.gradle @@ -29,7 +29,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.0' } } @@ -42,7 +42,7 @@ allprojects { } task wrapper(type: Wrapper) { - gradleVersion = '4.1.0' + gradleVersion = '4.4.0' } // Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties. diff --git a/bin/templates/project/build.gradle b/bin/templates/project/build.gradle index d982091f..20b23fbd 100644 --- a/bin/templates/project/build.gradle +++ b/bin/templates/project/build.gradle @@ -29,7 +29,7 @@ buildscript { // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files - classpath 'com.android.tools.build:gradle:3.0.1' + classpath 'com.android.tools.build:gradle:3.1.0' } } diff --git a/framework/build.gradle b/framework/build.gradle index 565f4229..dfe37a1e 100644 --- a/framework/build.gradle +++ b/framework/build.gradle @@ -31,8 +31,10 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.0.1' - classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5' + // The gradle plugin and the maven plugin have to be updated after each version of Android + // studio comes out + classpath 'com.android.tools.build:gradle:3.1.0' + classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' } }