After migration to Gradle 7.0, I've got such warni...
# javascript
r
After migration to Gradle 7.0, I've got such warnings:
Copy code
Execution optimizations have been disabled for task ':kvision-modules:kvision-common-annotations:jsSourcesJar' to ensure correctness due to the following reasons:
  - Gradle detected a problem with the following location: '/home/rjaros/git/kvision/kvision-modules/kvision-common-annotations/build/externals/kvision-kvision-common-annotations-jsIr/src'. Reason: Task ':kvision-modules:kvision-common-annotations:jsSourcesJar' uses this output of task ':kvision-modules:kvision-common-annotations:jsIrGenerateExternalsIntegrated' without declaring an explicit or implicit dependency.
What can be done about it? I don't even have these tasks defined in my
build.gradle.kts
.
And I don't use any generated externals.
b
I've experienced the same. Looks like jsGenerateExternals runs regardless of you requesting for any npm dependencies to be dukat'ed 😀
You could forcefully skip it with onlyIf{false}
😉 1
v
I don't think that would work as even if it is not run, it still declares the output files. If task A declares it outputs files X and Y or outputs the directory Z, and task B uses X, or Y, or any file within Z, but without having an explicit or implicit dependency on task A, then this is an error in the build logic, some optimizations get disabled, the warning printed and in the future the build will fail.
This is also one of the reasons overlapping outputs of tasks are a bad idea. In the distant past e. g. Gradle had compiled Groovy and Java files to the same classes directory directly, until they recognized that this is a pretty bad idea. If you for example run Groovy compilation first, then Java compilation, the result files from the Groovy compilation will be counted as Java compilation output too and vice versa and so on. This heavily disturbs various features like up-to-date checks, task output caching and others.