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

Fix ast sources in javadoc & source jars #398

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

jdaugherty
Copy link
Contributor

@jdaugherty jdaugherty commented Feb 11, 2025

I couldn't figure out why the AST files weren't being included in the source or javadoc jars. Turns out it's because we're searching for the tasks immediately, so if they weren't defined prior to the gradle plugin being applied, they wouldn't get included. This PR changes those tasks to be run after evaluation, which means you can now use composition in your gradle files and the task will be found correctly.

This PR also fixes the publish plugin so that it doesn't try to add the task artifacts - when you invoke publication.from project.components.java that will add the source jars, javadoc, and class jars. There's no reason to add them again. This actually causes withSourceJars() & withJavadocJar() to fail if defined.

This PR also moves away from toolchain so the matrix builds work correctly & use the right version of java.

@jdaugherty
Copy link
Contributor Author

This will fix the grails-data-mapping project so that we can add back:

 java {
     withSourcesJar()
     withJavadocJar()
 }

Copy link
Contributor

@matrei matrei left a comment

Choose a reason for hiding this comment

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

It's really hard to review these kind of changes. I'll have to try it out. If you have tested the output and think everything works as it should, I'll approve. If you want me to do more thorough testing, I'll have to defer until tomorrow.

@jdaugherty
Copy link
Contributor Author

It's really hard to review these kind of changes. I'll have to try it out. If you have tested the output and think everything works as it should, I'll approve. If you want me to do more thorough testing, I'll have to defer until tomorrow.

I used the grails-cache project to test this. I also extracted the source & javadoc jars to ensure they're including everything now. Let's merge and circle back if there are any issues found.

@jdaugherty jdaugherty merged commit 14b1407 into grails:7.0.x Feb 11, 2025
7 checks passed
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.

2 participants