This message was deleted.
# configuration-cache
s
This message was deleted.
v
Written from the top of my head on mobile, but I think something like this should work:
Copy code
interface A {
     @Inject
     ArchiveOperations getA()
 }
 def a = objects.newInstance(A).a
 from(runtimeConfiguration.elements.map {
    it.collect { it.asFile }.collect { it.directory ? it : a.zipTree(it) }
 })
j
That works! Thank you! I can actually also inject the service via the Plugin (I am in a plugin class here). But the part I was missing is storing it in a local variable...
👌 1
m
the problem that
ArchiveOperations
is unavailable in the closure looks like a configuration cache bug to me
I'm glad that we have a workaround, but still, seems like this should work in the first place
👍 1
v
You mean the one injected into the plugin? Would that maybe mean the plugin is serialized to CC too and maybe that has something non-serializable? Just like you cannot use a local top-level variable in a script as the script instance would be serialized.
m
as far as I understand the CC detected injected variables and can reinject them without doing full serialization
v
Ah, that would be nice of course then