Gradle hangs when a CopyTask is given a Path object

Have this in build.gradle

import java.nio.file.Paths
  project.task(type:Copy, "bug") {
    from Paths.get(buildDir.name, "test")
}

Call it: gradle bug

Gradle will hang in ‘Configuring > 1/1 projects’

If you want source files from a local dir you can use a FileTree object.