Swap to Gradle's Plugin DSL for much of build

Examples and android projects were left unchanged. They can be changed
later.

No plugin versions were changed, to make this as non-functional of a
change as possible. Upgrading Gradle to 5.6 was necessary for
pluginManagement in settings.gradle.
This commit is contained in:
Eric Anderson 2019-09-07 08:18:57 -07:00
parent cf3e2c4ef1
commit 3c3a823a81
16 changed files with 68 additions and 129 deletions

View File

@ -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'),

View File

@ -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'),

View File

@ -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"

View File

@ -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",

View File

@ -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.

View File

@ -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 {

View File

@ -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

View File

@ -1,12 +1,8 @@
description = "gRPC: GRPCLB LoadBalancer plugin"
plugins {
id "com.google.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 }
}
description = "gRPC: GRPCLB LoadBalancer plugin"
dependencies {
compile project(':grpc-core'),

View File

@ -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'),

View File

@ -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 {} }

View File

@ -1,13 +1,6 @@
buildscript {
repositories {
maven { // The google mirror is less flaky than mavenCentral()
url "https://maven-central.storage-download.googleapis.com/repos/central/data/" }
mavenLocal()
plugins {
id "com.google.protobuf"
}
dependencies { classpath libraries.protobuf_plugin }
}
apply plugin: 'com.google.protobuf'
description = 'gRPC: Protobuf Lite'

View File

@ -1,12 +1,8 @@
description = 'gRPC: Protobuf'
plugins {
id "com.google.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 }
}
description = 'gRPC: Protobuf'
dependencies {
compile project(':grpc-api'),

View File

@ -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"

View File

@ -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"

View File

@ -1,13 +1,8 @@
description = "gRPC: Testing Protos"
plugins {
id "com.google.protobuf"
}
// 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 }
}
description = "gRPC: Testing Protos"
dependencies {
compile project(':grpc-protobuf'),

View File

@ -1,17 +1,7 @@
// 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()
plugins {
id "com.github.johnrengelman.shadow"
id "com.google.protobuf"
}
dependencies {
classpath libraries.protobuf_plugin
classpath 'com.github.jengelman.gradle.plugins:shadow:2.0.4'
}
}
apply plugin: 'com.github.johnrengelman.shadow'
description = "gRPC: XDS plugin"
@ -42,7 +32,6 @@ dependencies {
signature "org.codehaus.mojo.signature:java17:1.0@signature"
}
apply plugin: 'com.google.protobuf'
sourceSets {
main {
proto {