I wrote a plugin for Gradle (Victor) that has a custom incremental Task. It has some annotations for when the task is considered UP-TO-DATE (input/output files, a List and an int). You can see the class here.
The mystery is that this all works great if you don’t have the gradle daemon enabled - if you execute the task twice in-a-row, it doesn’t execute the second time (recognizing it’s UP-TO-DATE).
But! If you turn on the gradle daemon, it is never considered UP-TO-DATE. The reason given is thus:
Executing task ‘:sample:rasterizeSvgsForDebug’ (up-to-date check took 0.002 secs) due to:
Value of input property ‘includeDensities’ has changed for task ‘:sample:rasterizeSvgsForDebug’
This is either a bug in the daemon or a bug in my understanding of the daemon.
What you’re doing with a single String is OK since I think you’re configuring all of the RasterizeTasks they’ll ever be, but if someone tried to use RasterizeTask by itself, they’d have to know to set the workaround explicitly.