Assigning input/output file annotations to public fields will not make the fields be inputs/outputs, when there are no getters defined, as below.
class MyTask extends DefaultTask {
@OutputFile
public File outputFile
@InputFiles
public FileCollection inputFiles
@TaskAction
def doSomething() {
// ...
}
}
It would be very helpful if Gradle at least could fail the build when/if this is detected.
Removing the “public” keyword from the field declaration will make everything work as expected.