Merge pull request #507 from dpogue/gradle-updates

Gradle Updates
This commit is contained in:
エリス 2018-11-21 14:44:00 +09:00 committed by GitHub
commit 2163c8ae05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 73 additions and 67 deletions

View File

@ -5,7 +5,7 @@ jdk:
android: android:
components: components:
- build-tools-26.0.2 - build-tools-28.0.3
env: env:
global: global:
# Keep gradle from crapping all over the log # Keep gradle from crapping all over the log

View File

@ -5,7 +5,7 @@ environment:
GRADLE_OPTS: -Dorg.gradle.daemon=false GRADLE_OPTS: -Dorg.gradle.daemon=false
# URL for SDK Tools, Revision 26.1.1 (September 2017) # URL for SDK Tools, Revision 26.1.1 (September 2017)
SDK_TOOLS_URL: https://dl.google.com/android/repository/sdk-tools-windows-3859397.zip SDK_TOOLS_URL: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip
matrix: matrix:
- nodejs_version: 6 - nodejs_version: 6
@ -20,7 +20,7 @@ install:
- set PATH=%PATH%;"%ANDROID_HOME%\tools\bin" - set PATH=%PATH%;"%ANDROID_HOME%\tools\bin"
- yes 2> nul | sdkmanager --licenses > nul - yes 2> nul | sdkmanager --licenses > nul
- sdkmanager "build-tools;26.0.2" - sdkmanager "build-tools;28.0.3"
- choco install gradle --version 3.4.1 - choco install gradle --version 3.4.1

View File

@ -214,7 +214,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. // 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. // For some reason, using ^ and $ don't work. This does the job, though.
var distributionUrlRegex = /distributionUrl.*zip/; var distributionUrlRegex = /distributionUrl.*zip/;
var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.4-all.zip'; var distributionUrl = process.env['CORDOVA_ANDROID_GRADLE_DISTRIBUTION_URL'] || 'https\\://services.gradle.org/distributions/gradle-4.6-all.zip';
var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties'); var gradleWrapperPropertiesPath = path.join(self.root, 'gradle', 'wrapper', 'gradle-wrapper.properties');
shell.chmod('u+w', gradleWrapperPropertiesPath); shell.chmod('u+w', gradleWrapperPropertiesPath);
shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath); shell.sed('-i', distributionUrlRegex, 'distributionUrl=' + distributionUrl, gradleWrapperPropertiesPath);

View File

@ -20,9 +20,7 @@
buildscript { buildscript {
repositories { repositories {
maven { google()
url "https://maven.google.com"
}
jcenter() jcenter()
} }
@ -38,7 +36,7 @@ buildscript {
apply plugin: 'com.android.library' apply plugin: 'com.android.library'
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') implementation fileTree(dir: 'libs', include: '*.jar')
debugCompile project(path: ":CordovaLib", configuration: "debug") debugCompile project(path: ":CordovaLib", configuration: "debug")
releaseCompile project(path: ":CordovaLib", configuration: "release") releaseCompile project(path: ":CordovaLib", configuration: "release")
} }
@ -46,7 +44,6 @@ dependencies {
android { android {
compileSdkVersion cdvCompileSdkVersion compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion buildToolsVersion cdvBuildToolsVersion
publishNonDefault true
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6 sourceCompatibility JavaVersion.VERSION_1_6

View File

@ -22,33 +22,32 @@ apply plugin: 'com.android.application'
buildscript { buildscript {
repositories { repositories {
mavenCentral() mavenCentral()
maven { google()
url "https://maven.google.com"
}
jcenter() jcenter()
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.1.0' classpath 'com.android.tools.build:gradle:3.2.0'
} }
} }
// Allow plugins to declare Maven dependencies via build-extras.gradle. // Allow plugins to declare Maven dependencies via build-extras.gradle.
allprojects { allprojects {
repositories { repositories {
mavenCentral(); mavenCentral()
jcenter() jcenter()
} }
} }
task wrapper(type: Wrapper) { task wrapper(type: Wrapper) {
gradleVersion = '4.4.0' gradleVersion = '4.6.0'
} }
// Configuration properties. Set these via environment variables, build-extras.gradle, or gradle.properties. // 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 // Refer to: http://www.gradle.org/docs/current/userguide/tutorial_this_and_that.html
ext { ext {
apply from: '../CordovaLib/cordova.gradle' apply from: '../CordovaLib/cordova.gradle'
// The value for android.compileSdkVersion. // The value for android.compileSdkVersion.
if (!project.hasProperty('cdvCompileSdkVersion')) { if (!project.hasProperty('cdvCompileSdkVersion')) {
cdvCompileSdkVersion = null; cdvCompileSdkVersion = null;
@ -145,24 +144,25 @@ cdvBuildRelease.dependsOn {
return computeBuildTargetName(false) return computeBuildTargetName(false)
} }
task cdvPrintProps << { task cdvPrintProps {
println('cdvCompileSdkVersion=' + cdvCompileSdkVersion) doLast {
println('cdvBuildToolsVersion=' + cdvBuildToolsVersion) println('cdvCompileSdkVersion=' + cdvCompileSdkVersion)
println('cdvVersionCode=' + cdvVersionCode) println('cdvBuildToolsVersion=' + cdvBuildToolsVersion)
println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit) println('cdvVersionCode=' + cdvVersionCode)
println('cdvMinSdkVersion=' + cdvMinSdkVersion) println('cdvVersionCodeForceAbiDigit=' + cdvVersionCodeForceAbiDigit)
println('cdvBuildMultipleApks=' + cdvBuildMultipleApks) println('cdvMinSdkVersion=' + cdvMinSdkVersion)
println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile) println('cdvBuildMultipleApks=' + cdvBuildMultipleApks)
println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile) println('cdvReleaseSigningPropertiesFile=' + cdvReleaseSigningPropertiesFile)
println('cdvBuildArch=' + cdvBuildArch) println('cdvDebugSigningPropertiesFile=' + cdvDebugSigningPropertiesFile)
println('computedVersionCode=' + android.defaultConfig.versionCode) println('cdvBuildArch=' + cdvBuildArch)
android.productFlavors.each { flavor -> println('computedVersionCode=' + android.defaultConfig.versionCode)
println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode) android.productFlavors.each { flavor ->
println('computed' + flavor.name.capitalize() + 'VersionCode=' + flavor.versionCode)
}
} }
} }
android { android {
defaultConfig { defaultConfig {
versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode")) versionCode cdvVersionCode ?: new BigInteger("" + privateHelpers.extractIntFromManifest("versionCode"))
applicationId privateHelpers.extractStringFromManifest("package") applicationId privateHelpers.extractStringFromManifest("package")
@ -249,6 +249,7 @@ android {
} }
addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release) addSigningProps(cdvReleaseSigningPropertiesFile, signingConfigs.release)
} }
if (cdvDebugSigningPropertiesFile) { if (cdvDebugSigningPropertiesFile) {
addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug) addSigningProps(cdvDebugSigningPropertiesFile, signingConfigs.debug)
} }

View File

@ -20,32 +20,30 @@
buildscript { buildscript {
repositories { repositories {
maven { google()
url "https://maven.google.com"
}
jcenter() jcenter()
} }
dependencies {
dependencies {
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.2.0'
} }
} }
allprojects { allprojects {
repositories { repositories {
maven { google()
url "https://maven.google.com"
}
jcenter() jcenter()
} }
//This replaces project.properties w.r.t. build settings //This replaces project.properties w.r.t. build settings
project.ext { project.ext {
defaultBuildToolsVersion="27.0.1" //String defaultBuildToolsVersion="28.0.3" //String
defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4 defaultMinSdkVersion=19 //Integer - Minimum requirement is Android 4.4
defaultTargetSdkVersion=27 //Integer - We ALWAYS target the latest by default defaultTargetSdkVersion=28 //Integer - We ALWAYS target the latest by default
defaultCompileSdkVersion=27 //Integer - We ALWAYS compile with the latest by default defaultCompileSdkVersion=28 //Integer - We ALWAYS compile with the latest by default
} }
} }

View File

@ -245,7 +245,7 @@ android {
} }
dependencies { dependencies {
compile fileTree(dir: 'libs', include: '*.jar') implementation fileTree(dir: 'libs', include: '*.jar')
// SUB-PROJECT DEPENDENCIES START // SUB-PROJECT DEPENDENCIES START
// SUB-PROJECT DEPENDENCIES END // SUB-PROJECT DEPENDENCIES END
} }

View File

@ -24,17 +24,15 @@ ext {
buildscript { buildscript {
repositories { repositories {
maven { google()
url "https://maven.google.com"
}
jcenter() jcenter()
} }
dependencies { dependencies {
// The gradle plugin and the maven plugin have to be updated after each version of Android // The gradle plugin and the maven plugin have to be updated after each version of Android
// studio comes out // studio comes out
classpath 'com.android.tools.build:gradle:3.1.0' classpath 'com.android.tools.build:gradle:3.2.0'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0' classpath 'com.github.dcendents:android-maven-gradle-plugin:2.1'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3' classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
} }
} }
@ -49,7 +47,6 @@ version = '8.0.0-dev'
android { android {
compileSdkVersion cdvCompileSdkVersion compileSdkVersion cdvCompileSdkVersion
buildToolsVersion cdvBuildToolsVersion buildToolsVersion cdvBuildToolsVersion
publishNonDefault true
compileOptions { compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8 sourceCompatibility JavaVersion.VERSION_1_8
@ -96,9 +93,9 @@ install {
} }
} }
scm { scm {
connection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' connection 'scm:git:https://github.com/apache/cordova-android.git'
developerConnection 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' developerConnection 'scm:git:git@github.com:apache/cordova-android.git'
url 'https://git-wip-us.apache.org/repos/asf?p=cordova-android' url 'https://github.com/apache/cordova-android'
} }
} }
@ -124,9 +121,9 @@ bintray {
name = 'cordova-android' name = 'cordova-android'
userOrg = 'cordova' userOrg = 'cordova'
licenses = ['Apache-2.0'] licenses = ['Apache-2.0']
vcsUrl = 'https://git-wip-us.apache.org/repos/asf?p=cordova-android.git' vcsUrl = 'https://github.com/apache/cordova-android'
websiteUrl = 'https://cordova.apache.org' websiteUrl = 'https://cordova.apache.org'
issueTrackerUrl = 'https://issues.apache.org/jira/browse/CB' issueTrackerUrl = 'https://github.com/apache/cordova-android/issues'
publicDownloadNumbers = true publicDownloadNumbers = true
licenses = ['Apache-2.0'] licenses = ['Apache-2.0']
labels = ['android', 'cordova', 'phonegap'] labels = ['android', 'cordova', 'phonegap']

View File

@ -3,4 +3,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

View File

@ -144,7 +144,7 @@ public class CoreAndroid extends CordovaPlugin {
public void clearCache() { public void clearCache() {
cordova.getActivity().runOnUiThread(new Runnable() { cordova.getActivity().runOnUiThread(new Runnable() {
public void run() { public void run() {
webView.clearCache(true); webView.clearCache();
} }
}); });
} }

View File

@ -58,7 +58,11 @@ class SystemCookieManager implements ICordovaCookieManager {
} }
public void clearCookies() { public void clearCookies() {
cookieManager.removeAllCookie(); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) {
cookieManager.removeAllCookies(null);
} else {
cookieManager.removeAllCookie();
}
} }
public void flush() { public void flush() {

View File

@ -142,6 +142,7 @@ public class SystemWebChromeClient extends WebChromeClient {
* Handle database quota exceeded notification. * Handle database quota exceeded notification.
*/ */
@Override @Override
@SuppressWarnings("deprecation")
public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize, public void onExceededDatabaseQuota(String url, String databaseIdentifier, long currentQuota, long estimatedSize,
long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater) long totalUsedQuota, WebStorage.QuotaUpdater quotaUpdater)
{ {
@ -180,11 +181,13 @@ public class SystemWebChromeClient extends WebChromeClient {
// API level 7 is required for this, see if we could lower this using something else // API level 7 is required for this, see if we could lower this using something else
@Override @Override
@SuppressWarnings("deprecation")
public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) { public void onShowCustomView(View view, WebChromeClient.CustomViewCallback callback) {
parentEngine.getCordovaWebView().showCustomView(view, callback); parentEngine.getCordovaWebView().showCustomView(view, callback);
} }
@Override @Override
@SuppressWarnings("deprecation")
public void onHideCustomView() { public void onHideCustomView() {
parentEngine.getCordovaWebView().hideCustomView(); parentEngine.getCordovaWebView().hideCustomView();
} }

View File

@ -74,7 +74,8 @@ public class SystemWebViewClient extends WebViewClient {
* @param url The url to be loaded. * @param url The url to be loaded.
* @return true to override, false for default behavior * @return true to override, false for default behavior
*/ */
@Override @Override
@SuppressWarnings("deprecation")
public boolean shouldOverrideUrlLoading(WebView view, String url) { public boolean shouldOverrideUrlLoading(WebView view, String url) {
return parentEngine.client.onNavigationAttempt(url); return parentEngine.client.onNavigationAttempt(url);
} }
@ -186,6 +187,7 @@ public class SystemWebViewClient extends WebViewClient {
* @param failingUrl The url that failed to load. * @param failingUrl The url that failed to load.
*/ */
@Override @Override
@SuppressWarnings("deprecation")
public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) { public void onReceivedError(WebView view, int errorCode, String description, String failingUrl) {
// Ignore error due to stopLoading(). // Ignore error due to stopLoading().
if (!isCurrentlyLoading) { if (!isCurrentlyLoading) {
@ -316,6 +318,7 @@ public class SystemWebViewClient extends WebViewClient {
} }
@Override @Override
@SuppressWarnings("deprecation")
public WebResourceResponse shouldInterceptRequest(WebView view, String url) { public WebResourceResponse shouldInterceptRequest(WebView view, String url) {
try { try {
// Check the against the whitelist and lock out access to the WebView directory // Check the against the whitelist and lock out access to the WebView directory

View File

@ -1,13 +1,13 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 23 compileSdkVersion 28
buildToolsVersion "23.0.1" buildToolsVersion "28.0.3"
defaultConfig { defaultConfig {
applicationId "com.example.anis.myapplication" applicationId "com.example.anis.myapplication"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 23 targetSdkVersion 28
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
} }
@ -20,7 +20,7 @@ android {
} }
dependencies { dependencies {
compile fileTree(dir: 'libs', include: ['*.jar']) implementation fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12' testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0' implementation 'com.android.support:appcompat-v7:23.4.0'
} }

View File

@ -19,16 +19,18 @@
apply plugin: 'com.android.application' apply plugin: 'com.android.application'
android { android {
compileSdkVersion 27 compileSdkVersion 28
buildToolsVersion "27.0.1" buildToolsVersion "28.0.3"
defaultConfig { defaultConfig {
applicationId "org.apache.cordova.unittests" applicationId "org.apache.cordova.unittests"
minSdkVersion 19 minSdkVersion 19
targetSdkVersion 27 targetSdkVersion 28
versionCode 1 versionCode 1
versionName "1.0" versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
} }
buildTypes { buildTypes {
release { release {
minifyEnabled false minifyEnabled false

View File

@ -23,11 +23,12 @@ buildscript {
google() google()
jcenter() jcenter()
} }
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
dependencies {
// NOTE: Do not place your application dependencies here; they belong // NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files // in the individual module build.gradle files
classpath 'com.android.tools.build:gradle:3.2.0'
} }
} }

View File

@ -1,3 +1,3 @@
wrapper { wrapper {
gradleVersion = '4.4.1' gradleVersion = '4.6'
} }