diff --git a/all/build.gradle b/all/build.gradle index 262b0d1730..3df9132c09 100644 --- a/all/build.gradle +++ b/all/build.gradle @@ -1,15 +1,9 @@ -apply plugin: 'com.github.kt3k.coveralls' +plugins { + id "com.github.kt3k.coveralls" +} description = "gRPC: All" -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1' } -} - def subprojects = [ project(':grpc-api'), project(':grpc-auth'), diff --git a/alts/build.gradle b/alts/build.gradle index d71f58f9d8..1d3ed8ab8b 100644 --- a/alts/build.gradle +++ b/alts/build.gradle @@ -1,23 +1,13 @@ -buildscript { - repositories { jcenter() } - dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' } +plugins { + id "com.github.johnrengelman.shadow" + id "com.google.protobuf" } -apply plugin: 'com.github.johnrengelman.shadow' - description = "gRPC: ALTS" sourceCompatibility = 1.7 targetCompatibility = 1.7 -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } -} - dependencies { compile project(':grpc-auth'), project(':grpc-core'), diff --git a/benchmarks/build.gradle b/benchmarks/build.gradle index cc7a9a6c17..2bfac4672b 100644 --- a/benchmarks/build.gradle +++ b/benchmarks/build.gradle @@ -1,12 +1,8 @@ -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } -} +plugins { + id "application" -apply plugin: 'application' + id "com.google.protobuf" +} description = "grpc Benchmarks" diff --git a/build.gradle b/build.gradle index 8336fb222f..83fc1cb996 100644 --- a/build.gradle +++ b/build.gradle @@ -1,15 +1,9 @@ -buildscript { - repositories { - mavenLocal() - maven { url "https://plugins.gradle.org/m2/" } - } - dependencies { - classpath 'com.google.gradle:osdetector-gradle-plugin:1.4.0' - classpath 'ru.vyarus:gradle-animalsniffer-plugin:1.5.0' - classpath 'net.ltgt.gradle:gradle-errorprone-plugin:0.8.1' - classpath "me.champeau.gradle:jmh-gradle-plugin:0.4.5" - classpath 'me.champeau.gradle:japicmp-gradle-plugin:0.2.5' - } +plugins { + id "com.google.osdetector" apply false + id "me.champeau.gradle.japicmp" apply false + id "me.champeau.gradle.jmh" apply false + id "net.ltgt.errorprone" apply false + id "ru.vyarus.animalsniffer" apply false } import net.ltgt.gradle.errorprone.CheckSeverity @@ -115,7 +109,6 @@ subprojects { configureProtoCompilation = { String generatedSourcePath = "${projectDir}/src/generated" - project.apply plugin: 'com.google.protobuf' project.protobuf { protoc { if (project.hasProperty('protoc')) { @@ -205,7 +198,6 @@ subprojects { protobuf: "com.google.protobuf:protobuf-java:${protobufVersion}", protobuf_lite: "com.google.protobuf:protobuf-lite:3.0.1", protoc_lite: "com.google.protobuf:protoc-gen-javalite:3.0.0", - protobuf_plugin: 'com.google.protobuf:protobuf-gradle-plugin:0.8.8', protobuf_util: "com.google.protobuf:protobuf-java-util:${protobufVersion}", lang: "org.apache.commons:commons-lang3:3.5", diff --git a/compiler/build.gradle b/compiler/build.gradle index cfe037d12b..a57fd41bc3 100644 --- a/compiler/build.gradle +++ b/compiler/build.gradle @@ -1,17 +1,11 @@ -apply plugin: "cpp" -apply plugin: "com.google.protobuf" +plugins { + id "cpp" + + id "com.google.protobuf" +} description = 'The protoc plugin for gRPC Java' -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - mavenLocal() - } - dependencies { classpath libraries.protobuf_plugin } -} - def artifactStagingPath = "$buildDir/artifacts" as File // Adds space-delimited arguments from the environment variable env to the // argList. diff --git a/gae-interop-testing/gae-jdk8/build.gradle b/gae-interop-testing/gae-jdk8/build.gradle index 69f48bd08f..53befa72e4 100644 --- a/gae-interop-testing/gae-jdk8/build.gradle +++ b/gae-interop-testing/gae-jdk8/build.gradle @@ -11,7 +11,6 @@ // 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. -description = 'gRPC: gae interop testing (jdk8)' buildscript { // Configuration for building @@ -26,6 +25,13 @@ buildscript { } } +plugins { + id "java" + id "war" +} + +description = 'gRPC: gae interop testing (jdk8)' + repositories { // repositories for Jar's you access in your code mavenLocal() @@ -34,8 +40,6 @@ repositories { jcenter() } -apply plugin: 'java' // standard Java tasks -apply plugin: 'war' // standard Web Archive plugin apply plugin: 'com.google.cloud.tools.appengine' // App Engine tasks dependencies { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index f4d7b2bf61..7c4388a921 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-5.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/grpclb/build.gradle b/grpclb/build.gradle index e141bcd346..2e67844e7d 100644 --- a/grpclb/build.gradle +++ b/grpclb/build.gradle @@ -1,13 +1,9 @@ -description = "gRPC: GRPCLB LoadBalancer plugin" - -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } +plugins { + id "com.google.protobuf" } +description = "gRPC: GRPCLB LoadBalancer plugin" + dependencies { compile project(':grpc-core'), project(':grpc-protobuf'), diff --git a/interop-testing/build.gradle b/interop-testing/build.gradle index 775b4ccc88..33e880f9e6 100644 --- a/interop-testing/build.gradle +++ b/interop-testing/build.gradle @@ -1,17 +1,12 @@ -apply plugin: 'application' +plugins { + id "application" + + id "com.google.protobuf" +} description = "gRPC: Integration Testing" startScripts.enabled = false -// Add dependency on the protobuf plugin -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } -} - dependencies { compile project(':grpc-alts'), project(':grpc-auth'), diff --git a/netty/shaded/build.gradle b/netty/shaded/build.gradle index f40268ee80..b7f6ec73d6 100644 --- a/netty/shaded/build.gradle +++ b/netty/shaded/build.gradle @@ -1,10 +1,7 @@ -buildscript { - repositories { jcenter() } - dependencies { classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' } +plugins { + id "com.github.johnrengelman.shadow" } -apply plugin: 'com.github.johnrengelman.shadow' - description = "gRPC: Netty Shaded" sourceSets { testShadow {} } diff --git a/protobuf-lite/build.gradle b/protobuf-lite/build.gradle index 74f75c6aa8..a319a182cb 100644 --- a/protobuf-lite/build.gradle +++ b/protobuf-lite/build.gradle @@ -1,14 +1,7 @@ -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - mavenLocal() - } - dependencies { classpath libraries.protobuf_plugin } +plugins { + id "com.google.protobuf" } -apply plugin: 'com.google.protobuf' - description = 'gRPC: Protobuf Lite' dependencies { diff --git a/protobuf/build.gradle b/protobuf/build.gradle index eb8efb38a3..b4204bd631 100644 --- a/protobuf/build.gradle +++ b/protobuf/build.gradle @@ -1,13 +1,9 @@ -description = 'gRPC: Protobuf' - -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } +plugins { + id "com.google.protobuf" } +description = 'gRPC: Protobuf' + dependencies { compile project(':grpc-api'), libraries.protobuf diff --git a/services/build.gradle b/services/build.gradle index 9c87031d26..739b2d9f27 100644 --- a/services/build.gradle +++ b/services/build.gradle @@ -1,10 +1,5 @@ -// Add dependency on the protobuf plugin -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } +plugins { + id "com.google.protobuf" } description = "gRPC: Services" diff --git a/settings.gradle b/settings.gradle index eac88a317b..3f9a7e6ef1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,3 +1,16 @@ +pluginManagement { + plugins { + id "com.github.johnrengelman.shadow" version "2.0.4" + id "com.github.kt3k.coveralls" version "2.0.1" + id "com.google.osdetector" version "1.4.0" + id "com.google.protobuf" version "0.8.8" + id "me.champeau.gradle.japicmp" version "0.2.5" + id "me.champeau.gradle.jmh" version "0.4.5" + id "net.ltgt.errorprone" version "0.8.1" + id "ru.vyarus.animalsniffer" version "1.5.0" + } +} + rootProject.name = "grpc" include ":grpc-api" include ":grpc-core" diff --git a/testing-proto/build.gradle b/testing-proto/build.gradle index 144c06d3ac..6a09b2f778 100644 --- a/testing-proto/build.gradle +++ b/testing-proto/build.gradle @@ -1,14 +1,9 @@ -description = "gRPC: Testing Protos" - -// Add dependency on the protobuf plugin -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - } - dependencies { classpath libraries.protobuf_plugin } +plugins { + id "com.google.protobuf" } +description = "gRPC: Testing Protos" + dependencies { compile project(':grpc-protobuf'), project(':grpc-stub') diff --git a/xds/build.gradle b/xds/build.gradle index db4d5255bb..9aaadcff7c 100644 --- a/xds/build.gradle +++ b/xds/build.gradle @@ -1,18 +1,8 @@ -// Add dependency on the protobuf plugin -buildscript { - repositories { - maven { // The google mirror is less flaky than mavenCentral() - url "https://maven-central.storage-download.googleapis.com/repos/central/data/" } - gradlePluginPortal() - } - dependencies { - classpath libraries.protobuf_plugin - classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4' - } +plugins { + id "com.github.johnrengelman.shadow" + id "com.google.protobuf" } -apply plugin: 'com.github.johnrengelman.shadow' - description = "gRPC: XDS plugin" [compileJava].each() { @@ -42,7 +32,6 @@ dependencies { signature "org.codehaus.mojo.signature:java17:1.0@signature" } -apply plugin: 'com.google.protobuf' sourceSets { main { proto {