Slackbot
06/07/2023, 7:26 PMVampire
06/08/2023, 12:16 PMJustin Breitfeller
06/08/2023, 12:19 PMtasks.withType<KotlinCompile>().configureEach
while configuring another task. Or would I have to realize those tasks to configure themVampire
06/08/2023, 12:20 PMJustin Breitfeller
06/08/2023, 12:22 PMVampire
06/08/2023, 12:23 PM.all
our do some other hack-aroundJustin Breitfeller
06/08/2023, 12:38 PMdef conditionalDependency = tasks.register("conditionalDependency")
def other = tasks.register("other")
tasks.register("original") {
other.configure {
dependsOn(conditionalDependency)
}
}
Throws
> DefaultTaskContainer#NamedDomainObjectProvider.configure(Action) on task set cannot be executed in the current context.
But if you use other.get().configure
that works.