Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add annotation processor to generate documentation #102

Merged
merged 5 commits into from
Feb 9, 2024
Merged

Conversation

ppkarwasz
Copy link
Contributor

This draft PR is based on #101.

We add a documentation-generating annotation processor.

By default it generates a plugins.xml descriptor in the META-INF/log4j directory of the output folder.

Currently it supports:

  • Log4j Plugins 3.x annotations only,
  • Both factory methods and builders.

Closes apache/logging-log4j2#1956.

@ppkarwasz ppkarwasz force-pushed the processor branch 4 times, most recently from dde15eb to 4cbbfbd Compare February 8, 2024 12:54
@ppkarwasz ppkarwasz marked this pull request as ready for review February 8, 2024 12:54
Copy link
Member

@vy vy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dropped some remarks, but overall it LGTM.

We add a documentation-generating annotation processor.

By default it generates a `plugins.xml` descriptor in the
`META-INF/log4j` directory of the output folder.

Currently it supports:

 * Log4j Plugins 3.x annotations **only**,
 * Both factory methods and builders.

Closes apache/logging-log4j2#1956.
By using `AnnotationMirror` instead of the annotation classes directly,
we can lower down the Java requirements to Java 8.
@ppkarwasz
Copy link
Contributor Author

ppkarwasz commented Feb 9, 2024

I have:

  • replace references to annotation classes with AnnotationMirror. This way the code should not fail if they are not present,
  • decreased the JDK requirements to JDK 11. It is entirely possible to compile this module to work with JDK 8, but we would need to add tools.jar from JDK 8 as a dependency of the project. This is not very comfortable,
  • added support for Log4j 2.x annotations.

We add a separate equivalent test for 2.x annotations.
@ppkarwasz ppkarwasz merged commit 0e7a34e into main Feb 9, 2024
7 checks passed
@ppkarwasz ppkarwasz deleted the processor branch February 9, 2024 16:28
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.

Extract configuration metadata from source code
2 participants