Commit 07447e9
committed
Keep TaskProviders out of the unit-test task's onlyIf spec for configuration-cache compatibility
The configuration cache serializes the AGP unit-test task's whole
state, including its onlyIf specs. The render wiring's onlyIf captured
the Wired records, whose RoboSpec/anchor fields hold TaskProviders —
realized DefaultTasks — so storing the entry failed with:
Task `:app:testDebugUnitTest` of type
`com.android.build.gradle.tasks.factory.AndroidUnitTest`: cannot
serialize object of type 'org.gradle.api.DefaultTask', a subtype of
'org.gradle.api.Task', as these are not supported with the
configuration cache.
and every generateNavGraph/export run needed --no-configuration-cache.
Materialize the render-list Files before configuring the test task and
let the spec capture only those — plain Files serialize fine. The
sysprops were already eager strings; no behavior change.
Fixes #11 parent ec2ffd1 commit 07447e9
1 file changed
Lines changed: 5 additions & 3 deletions
File tree
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
708 | 708 | | |
709 | 709 | | |
710 | 710 | | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
711 | 715 | | |
712 | 716 | | |
713 | 717 | | |
| |||
723 | 727 | | |
724 | 728 | | |
725 | 729 | | |
726 | | - | |
727 | | - | |
728 | | - | |
| 730 | + | |
729 | 731 | | |
730 | 732 | | |
731 | 733 | | |
| |||
0 commit comments