jdaugherty commented on PR #37:
URL:
https://github.com/apache/grails-gradle-publish/pull/37#issuecomment-5781236643
Thanks for the approval and the probes. I took the "for the record" item
further rather than documenting it, because the duplication was the intent
leaking: the whole point of disabling `javadoc` is that the groovydoc
*replaces* it for Groovy projects, and a jar carrying the groovydoc twice isn't
a replacement.
Pushed 972aa7e.
The exemption was compensating for the wrong question. Excluding by
*location* cannot distinguish the groovydoc from the javadoc once one
destination contains the other — hence either an empty jar or a doubled one.
Excluding by *contribution* can: within the javadoc tree an element's path is
its path below `javadoc.destinationDir`, while the groovydoc `from()` presents
the same file at its own root, so comparing the two drops exactly the javadoc's
view and leaves every other `from()` alone.
```groovy
Path javadocRoot = javadocDestination.absoluteFile.toPath().normalize()
Path candidate = element.file.absoluteFile.toPath().normalize()
return candidate == javadocRoot.resolve(element.relativePath.pathString)
```
`javadoc.destinationDir = build/docs` now gives a jar byte-identical to the
default arrangement — 23 entries, groovydoc plus the manifest, each once, and
the stale file directly in `build/docs` excluded. No `groovydoc/` prefix. The
groovydoc exemption and its provider are gone, so the predicate is also smaller
than it was.
The test asserts that rather than a non-empty jar, and is renamed to match —
it fails on the duplicated `groovydoc/` entries.
### Your other two
**Configuration cache in CI** — taken as suggested, not deferred. The
`assemble` case runs `--configuration-cache` twice and asserts `Reusing
configuration cache.` You are right that this is the exposed surface: the spec
and its providers are exactly what a later change would break silently.
**Up-to-date property** — confirmed and now in the PR description. Editing a
planted file and adding a new one under `build/docs/javadoc` leaves
`javadocJar` `UP-TO-DATE`, since the exclusion applies to the input snapshot
too.
**Nit** — fixed.
Since it is a behaviour change on top of an approval, it needs another look
before merge.
One note on the issue itself for whoever reads it later: the reproduction in
#36 isn't runnable as written — `tasks.named('javadocJar')` throws
`UnknownTaskException`, because the plugin registers that task in
`afterEvaluate`. The diagnosis is exactly right, and I confirmed the failure
against base `1.0.x` using the shape of the module it names (Java-only,
`groovy` plugin applied): the reported error under `DuplicatesStrategy.FAIL`,
and a silently packaged stale `p/A.html` under the default strategy. Both clean
on this branch. Worth a tweak to the snippet so the next person reproducing it
doesn't chase the wrong error.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]