Post-process jar task output while preserving up-to-date

(Chris Doré) #1


I would like to create a plugin that adds support for some post-processing of the java plugin’s jar task. This post-processing will modify the jar file. I’m trying to determine if there is a way I can weave my plugin’s task into the build so that the up-to-date status of the jar task will remain functional.

Currently, the only approach I see is replacing the jar task with my own, but maybe there is something more clever. Any other ideas on how to best approach this?

Thanks, Chris

(Peter Niederwieser) #2

Another way is to add your logic as a ‘doLast {}’ task action, rather than as its own task.

(Chris Doré) #3

Doh! Thanks Peter!

Looks like I just learned something fundamental about how up-to-date works with respect to outputs.

Thanks, again.