Skip to content

Make annotation processors a first-class citizen #2300

@oehme

Description

@oehme

Right now we tell our users to add this snippet to their project if they want to use annotation processors:

configurations {
  apt
}

tasks.withType(JavaCompile) {
  options.annotationProcessorPath = configurations.apt
}

This should work out of the box and each SourceSet should have an annotationProcessor configuration. For backwards compatibility we can do what the Android team did: Emit a deprecation warning when we find annotation processors on the compileClasspath (and add it to the annotation processor path to keep the build running) and add a flag to CompileOptions to allow the user to ignore these processors. We can then turn that warning into a failure in the next major release and deprecate the flag, because its behavior will then be the default.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions