This message was deleted.
# configuration-cache
s
This message was deleted.
1
m
extracting
gradle.taskGraph.allTasks.none { it.name == "updateReadme" }
into
provider
and
get
it inside the task should do the trick, but you'll lose laziness - CC evaluates all such providers at store time.
v
Ah, right, thanks, that should do.
Even
provider *{* _gradle_._taskGraph_._allTasks_ *}
and using that inside should do, shouldn't it?*
m
I don't think so, CC cannot serialize
Task
references. Unless Slack formatter garbled your code and you meant serializing the list of task names
v
Hm, strange. Because
Copy code
val foo by tasks.registering {
    val foo = provider { gradle.taskGraph.allTasks }
    doLast {
        println(foo.get())
    }
}
seems to work fine
Copy code
21:51:40: Executing 'foo --configuration-cache'...

Reusing configuration cache.

> Task :foo
[task ':foo']

BUILD SUCCESSFUL in 160ms
1 actionable task: 1 executed
Configuration cache entry reused.
21:51:41: Execution finished 'foo --configuration-cache'.
m
This works because you only have one task
v
Oh, that's sneaky. It can serialize itself but as soon as I do
gw foo help
it indeed breaks, thanks.
So yeah, then
provider *{* _gradle_._taskGraph_._allTasks_._map_ *{ it*.name *} }
or*
provider *{* _gradle_._taskGraph_._allTasks_._map_ *{ it*.path *} }
, thanks*
Yep, that works perfectly fine, thanks again