Skip to content

compiler: Default to @generated=omit #12080

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ java_library(
"//api",
"//protobuf",
"//stub",
"//stub:javax_annotation",
"@com_google_protobuf//:protobuf_java",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
Expand All @@ -47,7 +46,6 @@ java_library(
"//api",
"//protobuf-lite",
"//stub",
"//stub:javax_annotation",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
],
Expand All @@ -67,6 +65,5 @@ java_library(
visibility = ["//:__subpackages__"],
exports = [
artifact("com.google.auto.value:auto-value-annotations"),
artifact("org.apache.tomcat:annotations-api"), # @Generated for Java 9+
],
)
1 change: 0 additions & 1 deletion MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
"io.perfmark:perfmark-api:0.27.0",
"junit:junit:4.13.2",
"org.apache.tomcat:annotations-api:6.0.53",
"org.checkerframework:checker-qual:3.12.0",
"org.codehaus.mojo:animal-sniffer-annotations:1.24",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/gcp/handshaker.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class HandshakerServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to obtain stats for verifying LB behavior.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class LoadBalancerStatsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/metrics.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class MetricsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to control reconnect server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ReconnectServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* performance with various types of payload.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TestServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* that case.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class UnimplementedServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to dynamically update the configuration of an xDS test client.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateClientConfigureServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to remotely control health status of an xDS test server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateHealthServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to obtain stats for verifying LB behavior.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class LoadBalancerStatsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/metrics.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class MetricsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to control reconnect server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ReconnectServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* performance with various types of payload.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TestServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* that case.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class UnimplementedServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to dynamically update the configuration of an xDS test client.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateClientConfigureServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to remotely control health status of an xDS test server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateHealthServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/services.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class BenchmarkServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/services.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ReportQpsScenarioServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/services.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class WorkerServiceGrpc {

Expand Down
2 changes: 0 additions & 2 deletions compiler/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ java_library(
"//api",
"//protobuf",
"//stub",
"//stub:javax_annotation",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
"@com_google_protobuf//:protobuf_java",
Expand All @@ -35,7 +34,6 @@ java_library(
"//api",
"//protobuf-lite",
"//stub",
"//stub:javax_annotation",
artifact("com.google.code.findbugs:jsr305"),
artifact("com.google.guava:guava"),
],
Expand Down
7 changes: 5 additions & 2 deletions compiler/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,11 @@ protobuf {
inputs.file javaPluginPath
}
ofSourceSet('test').configureEach {
plugins { grpc {} }
plugins {
grpc {
option '@generated=javax'
}
}
}
ofSourceSet('testLite').configureEach {
builtins {
Expand All @@ -193,7 +197,6 @@ protobuf {
plugins {
grpc {
option 'lite'
option '@generated=omit'
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/java_plugin/cpp/java_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ class JavaGrpcGenerator : public protobuf::compiler::CodeGenerator {
java_grpc_generator::ProtoFlavor flavor =
java_grpc_generator::ProtoFlavor::NORMAL;
java_grpc_generator::GeneratedAnnotation generated_annotation =
java_grpc_generator::GeneratedAnnotation::JAVAX;
java_grpc_generator::GeneratedAnnotation::OMIT;

bool disable_version = false;
for (size_t i = 0; i < options.size(); i++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/lb/v1/load_balancer.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class LoadBalancerGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to obtain stats for verifying LB behavior.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class LoadBalancerStatsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/metrics.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class MetricsServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service used to control reconnect server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ReconnectServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* performance with various types of payload.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class TestServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* that case.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class UnimplementedServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to dynamically update the configuration of an xDS test client.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateClientConfigureServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
* A service to remotely control health status of an xDS test server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/testing/test.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class XdsUpdateHealthServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: test/echo/proto/echo.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class EchoTestServiceGrpc {

Expand Down
1 change: 0 additions & 1 deletion repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ IO_GRPC_GRPC_JAVA_ARTIFACTS = [
"io.opencensus:opencensus-contrib-grpc-metrics:0.31.0",
"io.perfmark:perfmark-api:0.27.0",
"junit:junit:4.13.2",
"org.apache.tomcat:annotations-api:6.0.53",
"org.checkerframework:checker-qual:3.12.0",
"org.codehaus.mojo:animal-sniffer-annotations:1.24",
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/lookup/v1/rls.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class RouteLookupServiceGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
* information.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/channelz/v1/channelz.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ChannelzGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/health/v1/health.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class HealthGrpc {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

/**
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler",
comments = "Source: grpc/reflection/v1/reflection.proto")
@io.grpc.stub.annotations.GrpcGenerated
public final class ServerReflectionGrpc {

Expand Down
Loading