Can IncrementalTaskInputs object be accessed from a standard task declaration?


#1

Incremental tasks are a great feature. All the the examples show how one would create a custom task class to utilize it. However, is there a way to access the incremental ‘outOfDate’ and ‘removed’ objects from a regular gradle tasks.

What is the correct syntax to accomplish this?

task myIncrementalTask {
   inputs.files configurations.compile
   doLast {
      inputs.outOfDate { .... }
      inputs.removed { .... }
   }
}

(Peter Niederwieser) #2

It doesn’t seem to be supported. I recommend to implement a task class. You can declare the class right in the build script or under ‘buildSrc/src/main/groovy’.