jdaugherty commented on PR #37:
URL:
https://github.com/apache/grails-gradle-publish/pull/37#issuecomment-5780852291
Both reproduced, both correct, and both are now fixed in 9adfc1a. Thanks —
the `withJavadocJar()`-already-called gap in particular would have shipped a
fix that did nothing for the module that reported the issue.
### 1. Already-registered `javadocJar`
Confirmed against `java-already-configured` with `DuplicatesStrategy.FAIL`
and a planted `build/docs/javadoc/help-doc.html`:
```
> Task :javadoc SKIPPED
> Task :javadocJar FAILED
Cannot copy file '.../build/docs/groovydoc/help-doc.html' to 'help-doc.html'
because file '.../build/docs/javadoc/help-doc.html' has already been copied
there.
```
You are right about the framing too — `java { withJavadocJar() }` is the
standard idiom, not "registering your own jar", and calling it an unchanged
path was wrong.
Rather than adding the exclude as a second mechanism for that branch, I
dropped the pre-registration entirely and went back to exclusion alone, with
the groovydoc exemption you described. It covers both paths, leaves Gradle's
wiring untouched, and is one mechanism instead of two. It also stops depending
on the reuse path behind that `// TODO: Emit deprecation if this task already
exists.` — which answers your third point by removing the reliance rather than
commenting on it.
### 2. `assemble` regression
Reproduced exactly as you had it — `javadocJar` absent from the graph,
`build/libs` with no `-javadoc.jar`. Dropping the pre-registration restores
Gradle's own `assemble.dependsOn(javadocJar)`, so no manual re-wiring is needed:
```
> Task :javadoc SKIPPED
> Task :groovydoc
> Task :javadocJar
> Task :assemble
build/libs: stale-javadoc-output-0.0.1-SNAPSHOT-javadoc.jar, -sources.jar,
.jar
```
The `assemble` test you asked for is in regardless, asserting `javadocJar`
is in the graph and lands in `build/libs`. Worth having whichever mechanism is
used, since the `publish`-only cases cannot see it.
### Smaller points
- **`javadoc` in the ignore list** — moot now. With exclusion the task is
back in the graph as `SKIPPED`, so the ignore-list entry is accurate again and
`result.task(':javadoc') == null` would be wrong.
- **README** — fixed: "projects that apply the `groovy` plugin".
- **`Hello from SubProject2`** — fixed.
### Test coverage
Four cases, each confirmed to fail against the mechanism it covers rather
than just passing:
| case | fails without |
|---|---|
| stale output, plugin-registered jar | the exclusion |
| stale output, `withJavadocJar()` already called | the exclusion |
| `javadoc.destinationDir` above the groovydoc | the groovydoc exemption |
| `assemble` builds the javadoc jar | the pre-registration approach |
Suite is 38 functional cases, 0 failures, 6 pre-existing `@PendingFeature`
skips; `rat` passes; configuration cache stores and reuses cleanly.
PR description rewritten to match what the code actually does, including the
#16371 claim — which now holds, since grails-core's
`CompilePlugin.configureJars` path is the second test case above.
--
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]