Slackbot
12/13/2023, 7:28 PMephemient
12/13/2023, 7:34 PMephemient
12/13/2023, 7:36 PMJavi
12/13/2023, 7:36 PMephemient
12/13/2023, 7:36 PMtasks.matching { predicate(it.name) } with tasks.named { predicate(it) }ephemient
12/13/2023, 7:37 PMnamed(String) still has the same behavior as alwaysJavi
12/13/2023, 7:43 PMtasks.named("foo")
tasks.register("foo")
Task with name 'foo' not found in root project 'gradle-extensions-project'.
What would be the behavior of
// find `foo`? or this would be an empty list?
tasks.named { it == "foo" }.configureEach { ... }
tasks.register("foo")ephemient
12/13/2023, 7:45 PMnamed(String) you expect a task to be registered already.
2. it's a live collection so the closure will be executed after the registration, same as matchingJavi
12/13/2023, 7:48 PMmaybeCreate which works lazily so I don't need to worry about".ephemient
12/13/2023, 7:48 PMmaybeCreate is also (almost always) the wrong solution tooJavi
12/13/2023, 7:49 PMephemient
12/13/2023, 7:49 PMJavi
12/13/2023, 7:50 PMephemient
12/13/2023, 7:51 PMJavi
12/15/2023, 5:01 PMJavi
12/15/2023, 5:02 PMnamed, it fails. The only solution is afterEvaluate?Javi
12/15/2023, 5:04 PMwithType<Task>().matching { ... } would not help hereephemient
12/15/2023, 5:04 PMephemient
12/15/2023, 5:04 PMmatching help?Javi
12/15/2023, 5:05 PMwithType<Task> with Task a bad practice?Javi
12/15/2023, 5:05 PMyou could fix their pluginThey already have a branch fixing a lot those things for months, I am not sure when they will merge it
ephemient
12/15/2023, 5:06 PMwithType() is fine. withType {} is not.ephemient
12/15/2023, 5:06 PM.matching().configureEach {} is not quite ideal, but that's what .named(Spec) fixesJavi
12/15/2023, 5:07 PMconfigureEach in this case. I am creating another task which will depends on this taskJavi
12/15/2023, 5:08 PMtasks.withType<Task>().named("apiCheck") and should I use matching?Javi
12/15/2023, 5:08 PMephemient
12/15/2023, 5:08 PMephemient
12/15/2023, 5:08 PMJavi
12/15/2023, 5:11 PMallprojects implies breaking calling named on subprojects without using afterEvaluate or matching. I would keep one of them as a workaround until the PR is merged