Copy task behaves differently in Gradle 2.13

(Sean Rohead) #1

I have a multi-project build. Each subproject has a task that copies a directory from a source folder to a build folder using the Copy task. The directory being copied contains a single subfolder with a number of files in that folder. Each subproject has a the same directory structure, but with different files in the subfolder. In Gradle 2.12 and prior, the Copy task would copy all of the files from each subproject to the build folder. However, after upgrading to Gradle 2.12, the Copy task is now only copying files from the first subproject to the build folder and reports UP TO DATE for all subsequent subprojects, even though these subprojects have files in the subfolder that do not exist in the build folder. My conjecture is that the Copy task is now only checking that the subfolder already exists in the build directory, rather than checking if all of the contents of the subfolder exist in the build directory.

(Lari Hotari) #2

Hi @seanrohead , Thanks for reporting the issue. Could you create a simple project that reproduces the issue?

(Sean Rohead) #3

I was not able to reproduce this in a simple project. After spending some time in the debugger with my original build file, I found that the problem went away after I deleted the .gradle folder.


I found that the problem went away after I deleted the .gradle folder.

Did you notice the bug soon after upgrading you Gradle version?

(Sean Rohead) #5

I had been using Gradle 2.9 for months with no problems. I upgraded to 2.13 and the problem started immediately. I tried to debug it and made a few changes to see if I could work around the problem, but gave up after a few hours. As soon as I downgraded back to 2.9, the problem went away. I upgraded to 2.10, 2.11, and 2.12 and they all worked. As soon as I upgraded again to 2.13 the problem reappeared and persisted until I fortuitously deleted the .gradle folder.


Well, sounds like it should be reproducible then. If you run a gradle clean after 2.13 upgrade, does the problem still happen?

(Sean Rohead) #7

Yes, the problem was consistently happening during a clean build and continued up until I deleted the .gradle folder.