This message was deleted.
# plugin-development
s
This message was deleted.
c
Certainly not good to have overlapping outputs, though to my knowledge that isn’t validated by Gradle. What you may be referring to is checking for implicit dependencies between tasks (that same page lists all Gradle validations).
I generally use the provided
temporaryDir
property as a basis for unique output destinations (per-task). e.g.
Copy code
val myTask by registering(Copy::class) {
        destinationDir = temporaryDir }
c
I think you might be correct about my memory and implicit deps, similar to this; https://discuss.gradle.org/t/deprecation-warning/42423
c
yep. generally solved by avoiding using the underlying location, instead using the task output, e.g.
Copy code
val someTask by registering(Zip::class) {
            from(someOtherTask) }
c
I intentionally set up this overlapping outputs scenario in a test and I was thinking
--warninig-mode=fail
would catch it, but it doesn't (Gradle 7.4.2).
c
yea. I’ve reworked many scripts away from shared directory/files, instead having each task have a unique output dir and building the dependencies between tasks as noted above.
It appears to break task caching.
and parallel execution of tasks.
t
I wonder if it would be caught by
--configuration-cache
, purely by virtue of that flag triggering additional validations? Shot in the dark.
c
I remember the error about overlapping outputs years ago.. does gradle warns you when both tasks are executed?
w
There is a warning when you have missing task dependencies: One task has the other task’s output as an input, but no task dependency. That will be an error in 8.0. There is no deprecation warning for two tasks writing to the same locations. Gradle will disable the build cache in that case. I think you may get some info log printout when Gradle detects this situation, though I think there isn’t a warning.