Is there any way to specify an input directory for...
# plugin-development
n
Is there any way to specify an input directory for a task that is allowed to not exist (I don't mean that you're allowed to not specify it, I mean specifying a directory that doesn't exist)
I think the best way is to use a
FileCollection
instead when possible, but it isn't always possible
v
Make the configurable directory
@Internal
and then have the actual input directory `map`ed from it, mapping to
null
if it does not exist?
n
Then the contents of the directory is not included in the cache key
v
Why should it not?
n
Because
@Internal
properties aren't included in the cache key at all.
That's its entire purpose
Oh I see what you mean, you mean having two properties?
That works on the surface (it's the same as using a provider that does this). The issue is that if the task value is computed early it won't work.
v
Then don't do it 😄