# Up-To-Date for empty inputs

**URL:** <https://discuss.gradle.org/t/up-to-date-for-empty-inputs/9967>\
**Category:** Help/Discuss\
**Created:** [June 5, 2015, 9:50am UTC](https://discuss.gradle.org/t/up-to-date-for-empty-inputs/9967 "2015-06-05T09:50:01Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bmuschko](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/bmuschko/32/5458_2.png) [@bmuschko](https://discuss.gradle.org/u/bmuschko)\
**Post date:** [June 5, 2015, 2:08pm UTC](https://discuss.gradle.org/t/up-to-date-for-empty-inputs/9967/2 "2015-06-05T14:08:02Z")

</div>

> Now if the source directory is empty or not existent, gradle skips the task.

A task is marked up-to-date if inputs _and_ outputs are existent and didn’t change from the previous execution. Default behavior.

> I want the file to run if there are inputs OR if files that should be in the destination directory are required.

If you want custom behavior, you’d have to implement it yourself. For that you could use the `copy` method that hangs off of `Project`. Something like this:

```
task myCopy {
    outputs.upToDateWhen {
        // your custom handling
    }
    doLast {
        copy {
             // define source and target locations
        }
    }
}

```

---

_[View the full topic](https://discuss.gradle.org/t/up-to-date-for-empty-inputs/9967)._
