Sorry, but sync() wasn’t a part of the public API, and using sync() directly in a task configuration block is the wrong thing to do (it means the sync is executed every time you run Gradle).
You can do exactly what you were doing with a Sync task.
task ttt(type: Sync) {
from 'd:/--/1'
into 'd:/--/2'
}
This would have worked in older and newer versions of Gradle. It would also give you incremental build support and automatically wire in task dependencies (if they were necessary). Calling project.copy() (like sync(), exec(), javaexec()) immediately executes that action in an opaque way, which is usually not what you want.
Sterling, thanks for the reply (in just 8 months). I know the difference between tasks and actions. Using sync as an action is a good idea when you know the files are changed and do not want to check inputs/outputs (which is slooooow). Also, copy action is a part of API, and sync is not? Isn’t it strange for you? Also, check the number of people missed sync action. Why do you think, they are wrong?