<commit_before># Java Annotation Processing

This spec aims at making Java annotation processing a first-class citizen in Gradle.

## Use cases

 * Simplify configuration for annotation processor dependencies used as `-processorpath` of the Java compiler  
   Compile-time-only dependencies (e.g. containing annotations that are only needed at compile-time to be processed by annotation processors (e.g. Immutables.org or Google's "auto" projects), or possibly for documentation purpose only (e.g. `@Nullable`, `@NotNull` et al.)) can already be configured through the `compileOnly` and `testCompileOnly` configurations in the Java Plugin
 * Configure annotation processing in IDEs through the IDE-specific Gradle plugins (`./gradlew eclipse` or `./gradlew idea`)
 * Expose the configuration through the Tooling API for IDEs to configure themselves (Buildship, etc.)

## Implementation plan

### Story - Add properties to `CompileOptions`

Add a `processorpath` (similar to the existing `sourcepath`), `processors`, `processorArgs`, and `proc`:

 * `processorpath` as a `FileCollection`: when non-empty, it is passed as a `-processorpath` argument to the Java compiler.
 * `processors` as a `List<String>` (or `Set<String>` or `Collection<String>`?); when non-empty, it is passed as a `-processor` argument to the Java compiler (values joined with a `,`).
 * `processorArgs` as a `Map<String, ?>` (or `Map<String, String>`?); each entry is passed as a `-Akey=value` argument to the Java compiler.
 * `proc` as an enum with values `none` and `only`, defaults to `null`; when non-`null`, it is passed a `-proc` argument to the Java compiler (`-proc:none` or `-proc:only`).

#### The API

```
public enum AnnotationProcessingOption {
    PROC,
    NONE;
}

public class CompileOptions extends AbstractOptions {
    ...

    @Input
    @Optional
    public AnnotationProcessingOption getProc() { ... }

    public void setProc(AnnotationProcessingOption proc) { ... }

    @Input
    @Optional
    public FileCollection getProcessorpath() { ... }

    public void setProcessorpath(FileCollection processorpath) { ... }

    @Input
    @Optional
    public List<String> getProcessors() { ... }

    public void setProcessors(List<String> processors) { ... }

    @Input
    @Optional
    public Map<String, ?> getProcessorArgs() { ... }

    public void setProcessorArgs(Map<String, ?> processorArgs) { ... }
}
```
<commit_msg>minor tweak on CompileOptions annotation processing api<commit_after># Java Annotation Processing

This spec aims at making Java annotation processing a first-class citizen in Gradle.

## Use cases

 * Simplify configuration for annotation processor dependencies used as `-processorpath` of the Java compiler  
   Compile-time-only dependencies (e.g. containing annotations that are only needed at compile-time to be processed by annotation processors (e.g. Immutables.org or Google's "auto" projects), or possibly for documentation purpose only (e.g. `@Nullable`, `@NotNull` et al.)) can already be configured through the `compileOnly` and `testCompileOnly` configurations in the Java Plugin
 * Configure annotation processing in IDEs through the IDE-specific Gradle plugins (`./gradlew eclipse` or `./gradlew idea`)
 * Expose the configuration through the Tooling API for IDEs to configure themselves (Buildship, etc.)

## Implementation plan

### Story - Add properties to `CompileOptions`

Add a `processorpath` (similar to the existing `sourcepath`), `processors`, `processorArgs`, and `proc`:

 * `processorpath` as a `FileCollection`: when non-empty, it is passed as a `-processorpath` argument to the Java compiler.
 * `processors` as a `List<String>` (or `Set<String>` or `Collection<String>`?); when non-empty, it is passed as a `-processor` argument to the Java compiler (values joined with a `,`).
 * `processorArgs` as a `Map<String, ?>` (or `Map<String, String>`?); each entry is passed as a `-Akey=value` argument to the Java compiler.
 * `proc` as an enum with values `none` and `only`, defaults to `null`; when non-`null`, it is passed a `-proc` argument to the Java compiler (`-proc:none` or `-proc:only`).

#### The API

```
public enum AnnotationProcessingOption {
    PROC,
    NONE;
}

public class CompileOptions extends AbstractOptions {
    ...

    @Input
    @Optional
    public AnnotationProcessingOption getProc() { ... }

    public void setProc(AnnotationProcessingOption proc) { ... }

    @InputFiles
    @Optional
    public FileCollection getProcessorpath() { ... }

    public void setProcessorpath(FileCollection processorpath) { ... }

    @Input
    @Optional
    public List<String> getProcessors() { ... }

    public void setProcessors(List<String> processors) { ... }

    @Input
    @Optional
    public Map<String, ?> getProcessorArgs() { ... }

    public void setProcessorArgs(Map<String, ?> processorArgs) { ... }
}
```

{'fraction_non_alphanumeric': 0.11204252709057452, 'fraction_numerical': 0.0, 'mean_word_length': 4.079958463136033, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5513901', 'n_tokens_mistral': 1375, 'n_tokens_neox': 1283, 'n_words': 534}