You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by er...@apache.org on 2020/01/21 10:24:16 UTC

[cordova-android] branch master updated: feat: upgrade gradle to 6.1 & gradle build tools to 3.5.3 (#792)

This is an automated email from the ASF dual-hosted git repository.

erisu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new 8ef742e  feat: upgrade gradle to 6.1 & gradle build tools to 3.5.3 (#792)
8ef742e is described below

commit 8ef742e79d80631206439f516fefede652873331
Author: Norman Breau <no...@normanbreau.com>
AuthorDate: Tue Jan 21 06:24:00 2020 -0400

    feat: upgrade gradle to 6.1 & gradle build tools to 3.5.3 (#792)
    
    * feat!: upgrade gradle to 6.1
    * feat!: upgrade gradle build tools to 3.5.3
    * feat: added `npm run clean-tests`
    * fix!: Removed useDeprecatedNdk as this option is now completely removed from gradle.
    * feat!: bump gradle to 6.1 & gradle build tools to 3.5.3
    
    Co-authored-by: エリス <er...@users.noreply.github.com>
---
 bin/clean_test.js                                  | 28 ++++++++++++++++++++++
 .../cordova/lib/builders/ProjectBuilder.js         |  2 +-
 .../cordova/lib/config/GradlePropertiesParser.js   |  5 +---
 bin/templates/project/app/build.gradle             |  4 ++--
 bin/templates/project/build.gradle                 |  2 +-
 package.json                                       |  3 ++-
 test/build.gradle                                  |  2 +-
 test/wrapper.gradle                                |  2 +-
 8 files changed, 37 insertions(+), 11 deletions(-)

diff --git a/bin/clean_test.js b/bin/clean_test.js
new file mode 100644
index 0000000..919f0b2
--- /dev/null
+++ b/bin/clean_test.js
@@ -0,0 +1,28 @@
+/*
+       Licensed to the Apache Software Foundation (ASF) under one
+       or more contributor license agreements.  See the NOTICE file
+       distributed with this work for additional information
+       regarding copyright ownership.  The ASF licenses this file
+       to you under the Apache License, Version 2.0 (the
+       "License"); you may not use this file except in compliance
+       with the License.  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+       Unless required by applicable law or agreed to in writing,
+       software distributed under the License is distributed on an
+       "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+       KIND, either express or implied.  See the License for the
+       specific language governing permissions and limitations
+       under the License.
+*/
+
+const fs = require('fs');
+
+if (fs.existsSync('./test/gradlew')) {
+    fs.unlinkSync('./test/gradlew');
+}
+
+if (fs.existsSync('./test/gradlew.bat')) {
+    fs.unlinkSync('./test/gradlew.bat');
+}
diff --git a/bin/templates/cordova/lib/builders/ProjectBuilder.js b/bin/templates/cordova/lib/builders/ProjectBuilder.js
index 335578d..df05e49 100644
--- a/bin/templates/cordova/lib/builders/ProjectBuilder.js
+++ b/bin/templates/cordova/lib/builders/ProjectBuilder.js
@@ -226,7 +226,7 @@ class ProjectBuilder {
                 // 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.10.3-all.zip';
+                var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-6.1-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/cordova/lib/config/GradlePropertiesParser.js b/bin/templates/cordova/lib/config/GradlePropertiesParser.js
index 59d9eac..060da2d 100644
--- a/bin/templates/cordova/lib/config/GradlePropertiesParser.js
+++ b/bin/templates/cordova/lib/config/GradlePropertiesParser.js
@@ -34,10 +34,7 @@ class GradlePropertiesParser {
             'org.gradle.daemon': 'true',
 
             // to allow dex in process
-            'org.gradle.jvmargs': '-Xmx2048m',
-
-            // allow NDK to be used - required by Gradle 1.5 plugin
-            'android.useDeprecatedNdk': 'true'
+            'org.gradle.jvmargs': '-Xmx2048m'
 
             // Shaves another 100ms, but produces a "try at own risk" warning. Not worth it (yet):
             // 'org.gradle.parallel': 'true'
diff --git a/bin/templates/project/app/build.gradle b/bin/templates/project/app/build.gradle
index 2db1aa6..29503bd 100644
--- a/bin/templates/project/app/build.gradle
+++ b/bin/templates/project/app/build.gradle
@@ -29,7 +29,7 @@ buildscript {
     dependencies {
         apply from: '../CordovaLib/cordova.gradle'
 
-        classpath 'com.android.tools.build:gradle:3.3.0'
+        classpath 'com.android.tools.build:gradle:3.5.3'
 
         if(cdvHelpers.getConfigPreference('GradlePluginGoogleServicesEnabled', 'false').toBoolean()) {
             String defaultGradlePluginGoogleServicesVersion = '4.2.0'
@@ -61,7 +61,7 @@ allprojects {
 }
 
 task wrapper(type: Wrapper) {
-    gradleVersion = '4.10.3'
+    gradleVersion = '6.1'
 }
 
 // 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 411e1a4..3c9aa71 100644
--- a/bin/templates/project/build.gradle
+++ b/bin/templates/project/build.gradle
@@ -28,7 +28,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.3.0'
+        classpath 'com.android.tools.build:gradle:3.5.3'
     }
 }
 
diff --git a/package.json b/package.json
index e43bff3..e7058f9 100644
--- a/package.json
+++ b/package.json
@@ -24,7 +24,8 @@
     "cover": "nyc jasmine --config=spec/coverage.json",
     "e2e-tests": "jasmine --config=spec/e2e/jasmine.json",
     "java-unit-tests": "node test/run_java_unit_tests.js",
-    "eslint": "eslint . \"bin/**/!(*.*|gitignore)\""
+    "eslint": "eslint . \"bin/**/!(*.*|gitignore)\"",
+    "clean-tests": "node bin/clean_test.js"
   },
   "author": "Apache Software Foundation",
   "license": "Apache-2.0",
diff --git a/test/build.gradle b/test/build.gradle
index c9bf1e7..fbfcb27 100644
--- a/test/build.gradle
+++ b/test/build.gradle
@@ -28,7 +28,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.3.0'
+        classpath 'com.android.tools.build:gradle:3.5.3'
     }
 }
 
diff --git a/test/wrapper.gradle b/test/wrapper.gradle
index 5dd3dbc..3980234 100644
--- a/test/wrapper.gradle
+++ b/test/wrapper.gradle
@@ -17,5 +17,5 @@
 */
 
 wrapper {
-    gradleVersion = '4.10.3'
+    gradleVersion = '6.1'
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org