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

feat: add autodocBom task to generate Autodoc manifests for BOMs #282

Merged

Conversation

paullatzelsperger
Copy link
Member

What this PR changes/adds

Enables the autodoc functionality for BOM modules. To do that, simply invoke:

./gradlew -p <path/to/bom> autodocBom

or

./gradlew :your:bom:module:autodocBom

then, after locally resolving all autodoc manifests of referenced modules, the autodocBom task puts the merged manifest in build/edc.json

Why it does that

the normal autodoc task doesn't work on BOM modules because they typically don't contain code, thus the compiler isn't engaged, and autodoc doesn't run.

Further notes

  • if the autodocBom task is invoked on a project where the name doesn't end with "-bom", a warning is logged
  • the resolveManifest and downloadManifest tasks don't generate empty files anymore (null instead of InputStream.nullStream())
  • added some description to the tasks

Linked Issue(s)

Closes # <-- insert Issue number if one exists

Please be sure to take a look at the contributing guidelines and our etiquette for pull requests.

@TaskAction
public void mergeManifests() {
if (!getProject().getName().endsWith("-bom")) {
getLogger().warn("Project name does not end with '-bom'. Is this really a BOM module?");
Copy link
Member

Choose a reason for hiding this comment

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

maybe this functionality shouldn't be limited to bom modules, e.g. an EDC distribution (like Tractus-X) could be interested in generating a comprehensive autodoc out of a set of dependencies.
the warning wouldn't be needed then

Copy link
Member Author

Choose a reason for hiding this comment

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

this would require a bit of refactoring, because then, the autodocBom task would not depend on the resolveManifest task anymore, but on either resolveManifest or downloadManifests.

alternatively, resolveManifest and downloadManifest could be merged into one, and artifact resolution (of the manifest file) happens dynamically based on its URI.

Definitely worth exploring, though in a different PR, IMO.

@paullatzelsperger paullatzelsperger merged commit c81de48 into eclipse-edc:main Oct 17, 2024
10 checks passed
@paullatzelsperger paullatzelsperger deleted the feat/add_autodocBom_task branch October 17, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
build enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants