Skip to content
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

Add the @generated annotation $$accessor classes #35629

Merged
merged 3 commits into from
Aug 30, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@
public class ExtensionAnnotationProcessor extends AbstractProcessor {

private static final Pattern REMOVE_LEADING_SPACE = Pattern.compile("^ ", Pattern.MULTILINE);
private static final String QUARKUS_GENERATED = "io.quarkus.Generated";

private final ConfigDocWriter configDocWriter = new ConfigDocWriter();
private final ConfigDocItemScanner configDocItemScanner = new ConfigDocItemScanner();
Expand Down Expand Up @@ -711,6 +712,7 @@ private void generateAccessor(final TypeElement clazz) {
}
final JClassDef classDef = sourceFile._class(JMod.PUBLIC | JMod.FINAL, className);
classDef.constructor(JMod.PRIVATE); // no construction
classDef.annotate(QUARKUS_GENERATED).value("Quarkus annotation processor");
final JAssignableExpr instanceName = JExprs.name(Constants.INSTANCE_SYM);
boolean isEnclosingClassPublic = clazz.getModifiers().contains(Modifier.PUBLIC);
// iterate fields
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package io.quarkus.grpc.common;
package io.quarkus;

import static java.lang.annotation.ElementType.CONSTRUCTOR;
import static java.lang.annotation.ElementType.FIELD;
Expand All @@ -17,7 +17,7 @@
* The {@code @Generated} annotation is used to mark source code that has been generated during the gRPC generation phase.
* Classes generated by {@code protoc} are post-processed to remove the {@code jakarta.annotation.Generated} and use
* this annotation instead, avoiding a dependency on a pre-jakarta annotation.
*
* <p>
* This class is a direct copy of {@code jakarta.annotation.Generated}.
*/
@Documented
Expand All @@ -38,14 +38,14 @@
* Date when the source was generated. The date element must follow the ISO
* 8601 standard. For example the date element would have the following
* value 2017-07-04T12:08:56.235-0700 which represents 2017-07-04 12:08:56
* local time in the U.S. Pacific Time time zone.
* local time in the U.S. Pacific Time zone.
*
* @return The date the source was generated
*/
String date() default "";

/**
* A place holder for any comments that the code generator may want to
* A placeholder for any comments that the code generator may want to
* include in the generated code.
*
* @return Comments that the code generated included
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class GrpcPostProcessing {
private static final String POST_PROCESS_NO_FINAL = "quarkus.generate-code.grpc-post-processing.no-final";
// this is intentionally split so that it doesn't get replaced by the Jakarta transformer
public static final String JAVAX_GENERATED = "javax" + ".annotation.Generated";
public static final String QUARKUS_GENERATED = "io.quarkus.grpc.common.Generated";
public static final String QUARKUS_GENERATED = "io.quarkus.Generated";
public static final String STUB = "Stub";
public static final String BIND_METHOD = "bindService";

Expand Down