# Incremental Copy Task

**URL:** <https://discuss.gradle.org/t/incremental-copy-task/5352>\
**Category:** Old Forum Archive\
**Created:** [March 9, 2012, 4:03pm UTC](https://discuss.gradle.org/t/incremental-copy-task/5352 "2012-03-09T16:03:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Adrian](https://discuss.gradle.org/u/Adrian)\
**Post date:** [March 9, 2012, 4:03pm UTC](https://discuss.gradle.org/t/incremental-copy-task/5352/1 "2012-03-09T16:03:00Z")

</div>

I have a large set of files (8000+ files, 280 megs) that need to be copied on a regular basis (collected from a bunch of directories into a single app directory). After switching from Ant to Gradle, my developers are complaining that the copy task takes a lot longer to run than it used to (on my machine, it’s 50 seconds vs 15 seconds, and I have one of the fastest machines).

After some investigating, it seems that Ant’s copy task is smart enough to copy only what’s changed, while Gradle’s Copy is all or nothing. I believe I saw something about using enabling incremental compilation for compile tasks; is there something similar for Copy tasks?

I know I could use Ant’s copy from inside Gradle, but I’d rather not: I have a single configurator that I use to configure both a Copy task and a Tar task, but if I use ant.copy, I’ll have to maintain two sets of code that do the exact same thing.

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [March 9, 2012, 6:21pm UTC](https://discuss.gradle.org/t/incremental-copy-task/5352/2 "2012-03-09T18:21:00Z")

</div>

Gradle doesn’t support incremental copying at this time. You can either split up the copy task into several, relying on the fact that some of them will be up-to-date. Or you can use the Ant task.

---

<div class="post-metadata">

**Author:** ![Adrian](https://avatars.discourse-cdn.com/v4/letter/a/82dd89/32.png) [@Adrian](https://discuss.gradle.org/u/Adrian)\
**Post date:** [March 9, 2012, 7:03pm UTC](https://discuss.gradle.org/t/incremental-copy-task/5352/3 "2012-03-09T19:03:00Z")

</div>

I’ve tried using multiple copy tasks before, but the gains weren’t as large as I’d hoped: partly because one or two files in multiple trees tend to get changed, and partly because of the up-to-date issue I’ve described in another thread ( [http://forums.gradle.org/gradle/topics/up\_to\_date\_checks\_doing\_too\_much\_work](http://forums.gradle.org/gradle/topics/up_to_date_checks_doing_too_much_work) ).

I guess for now I’ll just use the Ant task ☹

Are there plans to add incremental copy support?

---

<div class="post-metadata">

**Author:** ![Peter\_Niederwieser](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@Peter\_Niederwieser](https://discuss.gradle.org/u/Peter_Niederwieser)\
**Post date:** [March 9, 2012, 11:51pm UTC](https://discuss.gradle.org/t/incremental-copy-task/5352/4 "2012-03-09T23:51:00Z")

</div>

> Are there plans to add incremental copy support?

It doesn’t have the highest priority, but it will happen. Meanwhile, using an Ant task is your best option.
