"sync" action does not work after migration Gradle 1.8->2.0: "Could not find method from()" error

This is indeed a bug in Gradle, in the delegate of ‘sync’ task. As you may have noticed, ‘copy’ task still works. Workaround for your issue:

import org.gradle.api.internal.ClosureBackedAction

task ttt << {

sync new ClosureBackedAction({

from ‘d:/–/1’

from ‘d:/–/2’

})

}

Or you could define a helper method in your project:

import org.gradle.api.internal.ClosureBackedAction

def sync(Closure closure) {

sync(new ClosureBackedAction(closure))

}

and then use ‘sync’ as usual