My goal is to add some Lombok annotations (e.g. @AllArgsConstructor, @NoArgsConstructor, etc.) into a class during a Gradle build, such that the annotations are recognized by the Lombok annotation processor and cause it to generate code for the respective annotations.
Using ByteBuddy and the ByteBuddy Gradle plugin works well to add annotations with RetentionPolicy.RUNTIME; but adding Lombok annotations via the same mechanism does not result in generated code, presumably because the Gradle byteBuddy task runs after the compileJava task and so Lombok has already finished its code generation by the time ByteBuddy adds annotations.
Is there a way to make ByteBuddy run before Lombok in the Gradle build cycle? Is ByteBuddy the wrong tool for this job? Is there another way to insert Lombok annotations into source files during the build?