How to override upToDate behaviour cargoStartLocal


(Jan Bols) #1

I’m using Benjamin Muschko’s cargo plugin. I’m calling cargoStartLocal before running my integrationTest and cargoStopLocal afterwards.

However when integrationTest is UP-TO-DATE, I don’t want to call cargoStartLocal or cargoStopLocal.

I tried to wire integrationTest’s input and output to cargoStartLocal’s in- and output, but that doesn’t work because every cargo task specifies it’s never upToDate (see https://github.com/bmuschko/gradle-cargo-plugin/blob/master/src/main/groovy/com/bmuschko/gradle/cargo/tasks/AbstractCargoContainerTask.groovy#L83).

Is there a way to overwrite this behaviour or what would be the nicest solution to only run cargoStart/StopLocal when the integrationTest is not up to date anymore?

Greetings
Jan


How to check if a future task is up-to-date