This message was deleted.
# community-support
s
This message was deleted.
1
v
You probably mean provider, not property?
Copy code
copyTaskProvider.map { layout.dir(provider { it.destinationDir }).get() }
But if you control the consumer, you also might have other options: https://discuss.gradle.org/t/implicit-task-dependency-on-directory/44363
🙌 1
a
Ahhh yes provider, that worked. Had to re-arrrange it a bit to
Copy code
layout.dir(copyTaskProvider.map { it.destinationDir })
Unfortunately we don’t control the consumer here, so we had to explicitly add a dependency as well
v
You don't need to add a dependency explicitly if you do not rearrange my version
a
Ahh so that’s the difference. I’ll try to get my head wrap around why your version has implicit dependency. Thanks!
v
The task provider carries the dependency. But with
layout.dir
this dependency is not "copied" over but breaks the dependency
That's also why you cannot do
Copy code
copyTaskProvider.flatMap { layout.dir(provider { it.destinationDir }) }
Because with
flatMap
the outer provider is replaced by the inner provider and the inner provider has no task dependency
a
Wow that’s a short and concise explanation. If I want to try to dive deep into that where could I find this
TaskProvider
implementation or documentation?
v
What is "that"? The implicit task dependencies?
a
Yes
v
I think the main documentation about it should be at https://docs.gradle.org/current/userguide/lazy_configuration.html
Not sure where the implementation is, but probably somewhere in
ProviderInternal
or something along those lines
a
Thanks a lot! Yeah have gone through those documentation multiple times and sometimes have to read between the lines for these kind of details.
The task provider carries the dependency.
But with
layout.dir
this dependency is not “copied” over but breaks the dependency
👌 1