Fix ast sources in javadoc & source jars #398
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.