mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
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: エリス <erisu@users.noreply.github.com>
This commit is contained in:
parent
64ef13c6e0
commit
8ef742e79d
28
bin/clean_test.js
Normal file
28
bin/clean_test.js
Normal file
@ -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');
|
||||
}
|
@ -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);
|
||||
|
@ -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'
|
||||
|
@ -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.
|
||||
|
@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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",
|
||||
|
@ -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'
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -17,5 +17,5 @@
|
||||
*/
|
||||
|
||||
wrapper {
|
||||
gradleVersion = '4.10.3'
|
||||
gradleVersion = '6.1'
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user