harschware
harschware

Reputation: 13404

Proper usage of FileTree

I'm having trouble getting the correct signature of filetree. I receive a closure in a method and I'm wanting to pass that along to the correct fileTree method.

def licenseFiles(Closure closure) {
   licenseFiles2 = project.fileTree( closure )

I call the method like so:

licenseFiles { dir: 'src' }

It seems to call the fileTree( Object ) method. Any ideas what is wrong?

Upvotes: 1

Views: 1095

Answers (1)

Peter Niederwieser
Peter Niederwieser

Reputation: 123900

project.fileTree { dir: 'src' } is incorrect syntax (for any version of Gradle). Correct syntax (checked for 1.0-m8) is project.fileTree('src'), project.fileTree(dir: 'src'), or project.fileTree { from 'src' }.

Upvotes: 3

Related Questions