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

Hello,

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

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

Doh! Thanks Peter!

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

Thanks, again.