# Default task, dependsOn, Up-to-date problem

**URL:** <https://discuss.gradle.org/t/default-task-dependson-up-to-date-problem/20607>\
**Category:** Help/Discuss\
**Created:** [November 25, 2016, 10:59am UTC](https://discuss.gradle.org/t/default-task-dependson-up-to-date-problem/20607 "2016-11-25T10:59:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kec2](https://avatars.discourse-cdn.com/v4/letter/k/90db22/32.png) [@kec2](https://discuss.gradle.org/u/kec2)\
**Post date:** [November 25, 2016, 10:59am UTC](https://discuss.gradle.org/t/default-task-dependson-up-to-date-problem/20607/1 "2016-11-25T10:59:47Z")

</div>

I have a Java project and this task:  
If I run this task twice it will be up-to-date the second time. This is all god.  
Now if a change my Java code then the classes task is NOT up-to-date. So the code i compiled. So far so good.

The problem is that my task convertEgl2Cobol is still up-to-date. But how can this be?? The tasks it depends on is NOT up-to-date so this should not be up-to-date either.  
The inputs and outputs does change in this case.

Can someone help me understand why this incremental build does not work the way I think it should.

Im using Gradlew 3.2 on Windows 7.

```
task convertEgl2Cobol(dependsOn: classes) {
    description 'Converts EGL to Cobol.'
    group 'convert'

    doLast{
        MODEL_LIST.split(',').each{ model ->
            javaexec {
                classpath = sourceSets.main.runtimeClasspath
                main = 'dk.xact.translate.TranslateXactSample'
                args model.trim()
                jvmArgs = ['-Dfile.encoding=UTF-8', '-Xms8g', '-Xmx16g']
            }
        }
    }

    inputs.dir fileTree(dir: EGL_SOURCE_DIR, include: '**/*.egl')
    outputs.dir OUTPUT_PATH + '/generated'

    doFirst {
        delete OUTPUT_PATH + '/generated'
    }
}
```

---

<div class="post-metadata">

**Author:** ![Chris\_Dore](https://sea1.discourse-cdn.com/gradle/user_avatar/discuss.gradle.org/chris_dore/32/7592_2.png) [@Chris\_Dore](https://discuss.gradle.org/u/Chris_Dore)\
**Post date:** [November 26, 2016, 7:17am UTC](https://discuss.gradle.org/t/default-task-dependson-up-to-date-problem/20607/2 "2016-11-26T07:17:47Z")

</div>

Up-to-date checking does not take into account any task dependencies. Your conversion task needs to specify that the outputs of the classes task are inputs.

---

<div class="post-metadata">

**Author:** ![kec2](https://avatars.discourse-cdn.com/v4/letter/k/90db22/32.png) [@kec2](https://discuss.gradle.org/u/kec2)\
**Post date:** [November 26, 2016, 12:54pm UTC](https://discuss.gradle.org/t/default-task-dependson-up-to-date-problem/20607/3 "2016-11-26T12:54:13Z")

</div>

Thank you for clarifying that.  
That actually make sense.
