How to specify multiple input directories in a task?

I’m writing a lesscss plugin that accepts multiple source directories, but unfortunately the ‘@InputDirectory’ does not have a variant for multiple directories like ‘@OutputDirectories’.

So how can I mark a collection of directories as input from within the task? I could call ‘inputs.sourceDir(path)’, but I have no idea where/when to call it.

Any help is apreciated, Ivo

Perhaps we should add an ‘@InputDirectories’ annotation. I’ve raised GRADLE-3051 for this. In the meantime, you can add a method to the task class for setting the input directories or adding an input directory, and that method can call ‘inputs.sourceDir’ or ‘inputs.dir’.