File tree Expand file tree Collapse file tree
compose-nav-graph-gradle/src/main/kotlin/com/github/skydoves/navgraph/gradle Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -716,6 +716,10 @@ public class NavGraphGradlePlugin : Plugin<Project> {
716716 gradle.taskGraph.whenReady {
717717 val active = wired.filter { hasTask(it.anchor.get()) }
718718 if (active.isEmpty()) return @whenReady
719+ // Materialized OUTSIDE the closures attached to the test task: the configuration cache serializes that
720+ // task's whole state — sysprops AND its onlyIf specs — so a spec capturing `active` would drag each
721+ // Wired's TaskProviders (realized DefaultTasks) into the entry and fail serialization. Plain Files don't.
722+ val renderListFiles = active.map { it.renderListFile.get().asFile }
719723 agpTest.get().apply {
720724 filter {
721725 includeTestsMatching(" *NavGraphRobolectricRenderTest" )
@@ -734,9 +738,7 @@ public class NavGraphGradlePlugin : Plugin<Project> {
734738 }
735739 // Run iff ANY active pipeline has a non-empty render list (a Layoutlib failure to fill somewhere).
736740 onlyIf {
737- active.any { w ->
738- w.renderListFile.get().asFile.let { it.isFile && it.readText().isNotBlank() }
739- }
741+ renderListFiles.any { it.isFile && it.readText().isNotBlank() }
740742 }
741743 // Force the render to run when requested (the prior thumbnails aren't a tracked output of the test).
742744 outputs.upToDateWhen { false }
You can’t perform that action at this time.
0 commit comments