Skip to content

Commit 10e03bd

Browse files
bric3devflow.devflow-routing-intake
andauthored
Upgrade protobuf Gradle plugin to 0.10.0 across all modules (#11310)
build: Upgrade protobuf Gradle plugin to 0.10.0 across all modules Aligns all 8 usages from 0.8.18/0.9.3/0.9.4 to 0.10.0 as part of Gradle 9 preparation. Also fixes related Gradle 9 incompatibilities: * Replace deprecated `$buildDir` with `layout.buildDirectory.dir()` and fix the generated source path (source -> sources) * Replace eager spread-operator `*.plugins {}` with lazy `configureEach` * Remove redundant legacy `buildscript { classpath }` block in armeria-grpc/application fix: remove manual srcDirs override that broke proto to Groovy compile chain The `srcDirs +=` assignment discards the lazy task-dependency wiring that protobuf plugin 0.10.0 establishes between `generateTestProto` and `compileTestJava`, causing `compileTestGroovy` to miss Test2, Test3 on **clean builds**. Now that the plugin auto-registers generated sources; the block can go away. Co-authored-by: devflow.devflow-routing-intake <devflow.devflow-routing-intake@kubernetes.us1.ddbuild.io>
1 parent 838045f commit 10e03bd

8 files changed

Lines changed: 15 additions & 29 deletions

File tree

dd-java-agent/agent-iast/build.gradle

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import net.ltgt.gradle.errorprone.CheckSeverity
44
plugins {
55
id 'com.gradleup.shadow'
66
id 'me.champeau.jmh'
7-
id 'com.google.protobuf' version '0.8.18'
7+
id 'com.google.protobuf' version '0.10.0'
88
id 'net.ltgt.errorprone' version '3.1.0'
99
}
1010

@@ -115,14 +115,6 @@ tasks.named("forbiddenApisJmh") {
115115
ignoreFailures = true
116116
}
117117

118-
sourceSets {
119-
test {
120-
java {
121-
srcDirs += ["$buildDir/generated/source/proto/test/java"]
122-
}
123-
}
124-
}
125-
126118
tasks.withType(JavaCompile).configureEach {
127119
if (name == 'compileJava') {
128120
options.errorprone {

dd-java-agent/instrumentation/armeria/armeria-grpc-0.84/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.google.protobuf' version '0.8.18'
2+
id 'com.google.protobuf' version '0.10.0'
33
}
44

55
muzzle {

dd-java-agent/instrumentation/grpc-1.5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.google.protobuf' version '0.8.18'
2+
id 'com.google.protobuf' version '0.10.0'
33
}
44

55
muzzle {

dd-java-agent/instrumentation/protobuf-3.0/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.google.protobuf' version '0.9.4'
2+
id 'com.google.protobuf' version '0.10.0'
33
}
44

55
apply from: "$rootDir/gradle/java.gradle"
@@ -37,7 +37,7 @@ dependencies {
3737
sourceSets {
3838
test {
3939
java {
40-
srcDir "$buildDir/generated/source/proto/test/java"
40+
srcDir layout.buildDirectory.dir("generated/sources/proto/test/java")
4141
}
4242
}
4343
}

dd-smoke-tests/armeria-grpc/application/build.gradle

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
buildscript {
2-
dependencies {
3-
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.9.3'
4-
}
5-
}
6-
71
plugins {
82
id 'application'
93
id 'java'
104
id 'com.gradleup.shadow' version '8.3.9'
11-
id 'com.google.protobuf' version '0.9.3'
5+
id 'com.google.protobuf' version '0.10.0'
126
}
137

148
def sharedRootDir = "$rootDir/../../../"
@@ -39,8 +33,8 @@ protobuf {
3933
}
4034
}
4135
generateProtoTasks {
42-
ofSourceSet('main')*.plugins {
43-
grpc {}
36+
ofSourceSet('main').configureEach {
37+
plugins { grpc {} }
4438
}
4539
}
4640
}

dd-smoke-tests/armeria-grpc/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
plugins {
2-
id 'com.google.protobuf' version '0.9.3'
2+
id 'com.google.protobuf' version '0.10.0'
33
}
44

55
apply from: "$rootDir/gradle/java.gradle"
@@ -33,8 +33,8 @@ protobuf {
3333
}
3434
}
3535
generateProtoTasks {
36-
ofSourceSet('main')*.plugins {
37-
grpc {}
36+
ofSourceSet('main').configureEach {
37+
plugins { grpc {} }
3838
}
3939
}
4040
}

dd-smoke-tests/grpc-1.5/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ plugins {
44
id 'application'
55
id 'java'
66
id 'java-test-fixtures'
7-
id 'com.google.protobuf' version '0.9.4'
7+
id 'com.google.protobuf' version '0.10.0'
88
id 'com.gradleup.shadow'
99
}
1010

dd-smoke-tests/springboot-grpc/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22

33
plugins {
44
id 'com.gradleup.shadow'
5-
id 'com.google.protobuf' version '0.8.18'
5+
id 'com.google.protobuf' version '0.10.0'
66
}
77

88
apply from: "$rootDir/gradle/java.gradle"
@@ -26,8 +26,8 @@ protobuf {
2626
}
2727
}
2828
generateProtoTasks {
29-
all()*.plugins {
30-
grpc {}
29+
ofSourceSet("main").configureEach {
30+
plugins { grpc {} }
3131
}
3232
}
3333
}

0 commit comments

Comments
 (0)