If a task (like KSP does for example) manages thei...
# caching
n
If a task (like KSP does for example) manages their own internal caches, how should such a directory be marked in Gradle? KSP today marks it as
Internal
which isn’t good because when the task output is restored from cache it becomes invalid. One option is to mark it as
LocalState
but that wipes the cache upon cache restoration which maybe isn’t ideal. It could be marked as an output but it’s also needed as an input (though changes to it should not cause task invalidation so it should not be marked as an input). But is this safe? Obviously whatever is put in there cannot contain absolute path and such for that to work
Oh yeah, if it’s marked as an output it will be deleted before task execution right? That isn’t good
t
I don't think outputs are deleted before task execution what's in this internal dir?
n
I don’t know yet, still looking into it
But there is some sort of metadata about the incremental work, I assume they have some sort of dependency graph of files or something like so they know what to recompile
Marking it as an output made a bunch of integration tests fail so that doesn't work. LocalState works though
v
Yes, local state is what you need in that case