working on making my plugin not break with the con...
# configuration-cache
t
working on making my plugin not break with the configuration cache. Does this collection of annotations even make sense? Gradle doesn't complain in any obvious way
Copy code
@Transient
@get:PathSensitive(PathSensitivity.RELATIVE)
@get:InputFiles
lateinit var projectHealthReports: Configuration
Specifically, I've added
@Transient
so that Gradle doesn't serialize the
Configuration
instance. For input hashing, I want it to treat the property as a collection of files, but in the task action I use APIs only available on
Configuration
1
a-ha. Running the build twice leads to a failure, because the property isn't initialized. That makes sense!
g
Why just not use
ConfigurableFileCollection#from(Configuration)
?
t
as I said, I specifically want the APIs available on
Configuration
for this use-case.
FileCollection
isn't sufficient.
g
Ah, missed the last bit. Thought about file collection + configuration name to get the same configuration back but it will still fail with cc(
t
I'm hoping I can find a better solution in the medium-term future. With Gradle 7.5, it seems like it might be possible for my plugin to actually be compliant. (I need the lazy graph analysis)