From 26bd76fa761545ce70f80ac784d09227cc45d208 Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Fri, 7 Jun 2019 08:40:53 -0700 Subject: [PATCH] Upgrade to Gradle 5 --- all/build.gradle | 7 +++---- build.gradle | 2 +- cronet/build.gradle | 2 +- cronet/settings.gradle | 1 + examples/gradle/wrapper/gradle-wrapper.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- okhttp/build.gradle | 6 +++++- settings.gradle | 3 --- 8 files changed, 13 insertions(+), 12 deletions(-) create mode 100644 cronet/settings.gradle diff --git a/all/build.gradle b/all/build.gradle index 65e139bfba..262b0d1730 100644 --- a/all/build.gradle +++ b/all/build.gradle @@ -63,10 +63,9 @@ jacocoTestReport { html.enabled = true } - additionalSourceDirs = files(subprojects.sourceSets.main.allSource.srcDirs) - sourceDirectories = files(subprojects.sourceSets.main.allSource.srcDirs) - classDirectories = files(subprojects.sourceSets.main.output) - classDirectories = files(classDirectories.files.collect { + additionalSourceDirs.from(files(subprojects.sourceSets.main.allSource.srcDirs)) + sourceDirectories.from(files(subprojects.sourceSets.main.allSource.srcDirs)) + classDirectories.from(files(subprojects.sourceSets.main.output).collect { fileTree(dir: it, exclude: [ '**/io/grpc/internal/testing/**', diff --git a/build.gradle b/build.gradle index 24152f8760..188c5768cc 100644 --- a/build.gradle +++ b/build.gradle @@ -5,7 +5,7 @@ buildscript { } dependencies { classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0' - classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.4.5' + classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0' classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.6' classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.5" classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.2.5' diff --git a/cronet/build.gradle b/cronet/build.gradle index 1d2e6fc225..f84bc75535 100644 --- a/cronet/build.gradle +++ b/cronet/build.gradle @@ -7,7 +7,7 @@ buildscript { google() jcenter() } - dependencies { classpath 'com.android.tools.build:gradle:3.0.1' } + dependencies { classpath 'com.android.tools.build:gradle:3.3.0' } } allprojects { diff --git a/cronet/settings.gradle b/cronet/settings.gradle new file mode 100644 index 0000000000..ca2b16c9c7 --- /dev/null +++ b/cronet/settings.gradle @@ -0,0 +1 @@ +rootProject.name = 'grpc-cronet' diff --git a/examples/gradle/wrapper/gradle-wrapper.properties b/examples/gradle/wrapper/gradle-wrapper.properties index 5c1b6c95b8..f4d7b2bf61 100644 --- a/examples/gradle/wrapper/gradle-wrapper.properties +++ b/examples/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 5c1b6c95b8..f4d7b2bf61 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/okhttp/build.gradle b/okhttp/build.gradle index b35e10bc44..7ee7fed4c5 100644 --- a/okhttp/build.gradle +++ b/okhttp/build.gradle @@ -2,9 +2,13 @@ description = "gRPC: OkHttp" dependencies { compile project(':grpc-core'), - libraries.okhttp, libraries.okio + compile (libraries.okhttp) { + // prefer 1.13.0 from libraries instead of 1.6.0 + exclude group: 'com.squareup.okio', module: 'okio' + } + // Tests depend on base class defined by core module. testCompile project(':grpc-core').sourceSets.test.output, project(':grpc-testing'), diff --git a/settings.gradle b/settings.gradle index a1266d5604..eac88a317b 100644 --- a/settings.gradle +++ b/settings.gradle @@ -49,6 +49,3 @@ if (settings.hasProperty('skipCodegen') && skipCodegen.toBoolean()) { include ":grpc-compiler" project(':grpc-compiler').projectDir = "$rootDir/compiler" as File } - -// Gradle 5.0 changed the behavior of publishing block, use new stable behavior -enableFeaturePreview('STABLE_PUBLISHING')