I have a resolvable configuration that has project...
# community-support
m
I have a resolvable configuration that has project dependencies. Why is it that sometimes, the dependencies are evaluated and sometimes not?
Copy code
tasks.register("aggregate", AggregateTask::class.java) {
  // runs task dependencies
  input.from(configuration)

  // **doesn't run** task dependencies
  input.from(configuration.files)

  // runs task dependencies
  input.from(configuration.incoming.artifactView { lenient(true) }.files)
}
🦆 1
âś… 1
My mental model was that •
Configuration
internally contains some “build-by” information that allows building the task graph •
Set<File>
doesn’t so it’s impossible to know what task to run
But what about
FileCollection
(the last line up there)?
Wait, I think I just got it. The
files
in the last line is not the same as the one in the 2nd line
This wouldn’t run the task dependencies
Copy code
input.from(configuration.incoming.artifactView { lenient(true) }.files.files)
I think it makes sense 👍
v
👌
Configuration
implements
FileCollection
, so the
files
in the last line is like the
configuration
in that regard.
And with the
.files
in the second line you "degrade" the
FileCollection
to a
Set<File>
which does not carry task dependencies
If
configuration
would not be a
Configuration
but a
Provider<Configuration>
, you could also do
configuration.map { it.files }
to preserve the task dependencies.
👌 1