copy(Closure) fails in Gradle 3.0

not-a-bug

(Thor Kummer) #1

Gradle Version: 3.0
Operating System: Ubuntu 16.4
Is this a regression? If yes, which version of Gradle do you know it last worked for? 2.14.1

Example: An empty project with only the following build file

task go << {
    copy {
        from 'a'
        into 'b'
        println "Done!"
    }
}

Running first with gradle 2.14.1 (succeeds) and then with 3.0 (fails)

10:19:40-tk@tkw:~/projects/test> gradle --version

------------------------------------------------------------
Gradle 2.14.1
------------------------------------------------------------

Build time:   2016-07-18 06:38:37 UTC
Revision:     d9e2113d9fb05a5caabba61798bdb8dfdca83719

Groovy:       2.4.4
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Linux 4.4.0-34-generic amd64

10:32:48-tk@tkw:~/projects/test> gradle go
:go
Done!

BUILD SUCCESSFUL

Total time: 2.664 secs

This build could be faster, please consider using the Gradle Daemon: https://docs.gradle.org/2.14.1/userguide/gradle_daemon.html
10:32:58-tk@tkw:~/projects/test> sdk use gradle 3.0

Using gradle version 3.0 in this shell.
10:33:08-tk@tkw:~/projects/test> gradle --version

------------------------------------------------------------
Gradle 3.0
------------------------------------------------------------

Build time:   2016-08-15 13:15:01 UTC
Revision:     ad76ba00f59ecb287bd3c037bd25fc3df13ca558

Groovy:       2.4.7
Ant:          Apache Ant(TM) version 1.9.6 compiled on June 29 2015
JVM:          1.8.0_101 (Oracle Corporation 25.101-b13)
OS:           Linux 4.4.0-34-generic amd64

10:33:14-tk@tkw:~/projects/test> gradle go
:go FAILED

FAILURE: Build failed with an exception.

* Where:
Build file '/home/tk/projects/test/build.gradle' line: 3

* What went wrong:
Execution failed for task ':go'.
> No signature of method: org.gradle.internal.metaobject.ConfigureDelegate.from() is applicable for argument types: (java.lang.String) values: [a]
  Possible solutions: find(), grep(), grep(java.lang.Object), find(groovy.lang.Closure), wait(), dump()

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 0.898 secs

(Stefan Oehme) #2

I copied your example and it works fine in 3.0 for me. Can you share a full example project?