You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This call to TaskDependency.getDependencies()causes dependencies to be resolved at configuration time. This slows down builds and prevents other plugins from mutating the configuration (e.g. adding attributes) before it gets resolved.
For example:
dockerCompose {
isRequiredBy(run)
}
will resolve the runtimeClasspath configuration.
Potential solution
The intention is to run the up task after things have finished compiling right?
Simply wrapping in a taskGraph.whenReady might work:
task.dependsOn upTask
task.finalizedBy downTask
project.taskGraph.whenReady {
task.getTaskDependencies().getDependencies(task)
.findAll { Task.class.isAssignableFrom(it.class) && ((Task) it).name.toLowerCase().contains('classes') }
.each { dep ->
if (fromConfigure) {
upTask.get().shouldRunAfter dep
} else {
upTask.configure { it.shouldRunAfter dep }
}
}
}
I'm happy to put up a PR if this seems like the right solution.
The text was updated successfully, but these errors were encountered:
Hello, thank you for reporting this issue! Feel free to prepare a PR containing this improvement. I'm just not sure if it is possible to use shouldRunAfter from whenReady (just because I don't have experience with it). If it works, then perfect 👍
This call to
TaskDependency.getDependencies()
causes dependencies to be resolved at configuration time. This slows down builds and prevents other plugins from mutating the configuration (e.g. adding attributes) before it gets resolved.For example:
will resolve the
runtimeClasspath
configuration.Potential solution
The intention is to run the up task after things have finished compiling right?
Simply wrapping in a
taskGraph.whenReady
might work:I'm happy to put up a PR if this seems like the right solution.
The text was updated successfully, but these errors were encountered: