apiguardian
apiguardian copied to clipboard
Introduce tools for @API annotation processing
Ideas
- Extract all public APIs and generate a report
- Compare two versions of an artifact for release notes
- Check correct usage of APIs (internally and externally)
- The tool should check that
@API
is only declared on public types/methods.
- The tool should check that
- Implement a reporting tool that warns about usage of experimental and deprecated APIs.
- See jdeprscan from JDK 9 for inspiration.
Related Issues
- https://github.com/junit-team/junit5/issues/144
Deliverables
- ?
Update: moved ideas from https://github.com/junit-team/junit5/issues/144 to here.
Added link to jdeprscan
.
A compiler plugin could be useful: http://www.baeldung.com/java-build-compiler-plugin
I've started writing an approach to this. I've mentioned the general idea here. Instead of plugging into compiler, I intend to extract API descriptor with Google Reflections (I had an approach to Scannotation and gave up) and use it to perform validation and comparison.
You can follow the works here.
Check correct usage of APIs (internally and externally)
- The tool should check that @API is only declared on public types/methods.
What else can we check here? Do we consider internal classes as valid API?