Skip to content

Fix Java annotation processor support to actually run processors#471

Open
oyvindberg wants to merge 2 commits intomasterfrom
fix-java-annotation-processors
Open

Fix Java annotation processor support to actually run processors#471
oyvindberg wants to merge 2 commits intomasterfrom
fix-java-annotation-processors

Conversation

@oyvindberg
Copy link
Copy Markdown
Owner

Summary

This PR fixes Java annotation processor support in bleep. The previous implementation only added the -s option for generated sources but didn't actually enable annotation processing - Bloop was adding -proc:none which disabled it.

Changes

  • Removed the simple AnnotationProcessing(enabled: Boolean) model
  • Added a new AnnotationProcessor model with required className field (extensible for future features)
  • Updated Java model to use JsonSet[AnnotationProcessor] instead of Option[AnnotationProcessing]
  • Modified GenBloopFiles to pass explicit -processor options to javac with comma-separated processor class names
  • Only adds -proc:none when no processors are configured
  • Updated tests to verify -processor option is correctly generated
  • Added documentation to CLAUDE.md

Breaking Change

The old annotationProcessing.enabled field is replaced with an explicit list of annotation processors:

Before:

java:
  annotationProcessing:
    enabled: true

After:

java:
  annotationProcessors:
    - className: lombok.launch.AnnotationProcessorHider$AnnotationProcessor
    - className: com.google.auto.value.processor.AutoValueProcessor

Test plan

  • All existing tests pass
  • Added test assertions to verify -processor option is generated
  • Tested with Lombok annotation processor in integration test

🤖 Generated with Claude Code

oyvindberg and others added 2 commits August 5, 2025 18:14
The previous implementation only added the `-s` option for generated sources
but didn't actually enable annotation processing. This change:

- Removes the simple enabled/disabled AnnotationProcessing model
- Adds a new AnnotationProcessor model with required className field
- Updates Java model to use JsonSet[AnnotationProcessor]
- Passes explicit `-processor` options to javac with processor class names
- Only adds `-proc:none` when no processors are configured
- Updates tests to verify -processor option is generated
- Documents the new feature in CLAUDE.md

Breaking change: The old annotationProcessing.enabled field is replaced
with an explicit list of annotation processors.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant