0

I want to create an object which implements interface FileTree in Gradle.

From what I can find from documentation FileTreeAdapter class implements FileTree, but it is internal class. How can I initialize my object filesToDelete? And how can I find which classes implements FileTree interface from the documentation?

public class DeleteDirTask extends DefaultTask {
    @InputFiles @Optional
    FileTree filesToDelete = files("/src/")
    ...
  }
Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259
Xelian
  • 16,680
  • 25
  • 99
  • 152

1 Answers1

1

How can I initialize my object filesToDelete?

Use project.fileTree(). (project.files() is for FileCollections.)

And how can I find which classes implements FileTree interface from the documentation?

The implementation classes are internal, and you shouldn't have to worry about them.

Peter Niederwieser
  • 121,412
  • 21
  • 324
  • 259