Task inputs: add support for many directories as inputs


(Mikhail) #1

We can write a task which have a directory as inputs, for example:

task unityImport {
File inpDir = file(’…/MyBestGame/Assets’)
inputs.dir inpDir
outputs.dir file(‘src/main/assets/bin/Data’)
<…>
}

We can even define one or several files as inputs, using:
inputs.file
inputs.files
But why there is no “inputs.dirs”? Please, consider adding it.

PS: My usecase is as follows. I’m making a gradle task for importing Unity build into android and need to add one more directory. And I can’t just use game root directory - there are many locked files by Visual Studio and Unity and I don’t want to close them just to be able to build apk by gradle


(Lance Java) #2

You can invoke inputs.dir multiple times

https://docs.gradle.org/current/javadoc/org/gradle/api/tasks/TaskInputs.html


(Renato Athaydes) #3

Why not just add dirs()? You’ve added files(), not having dirs() is just silly. And not having the @InputDirectories annotation is really annoying too.