I have a complicated build which requires one task graph which downloads an artifact, unzips it, explodes a war inside of the zip distro, then executes an arbitrary JavaExec task to create one artifact:
task download task unzip(dependsOn: download) task explode(dependsOn: unzip) task noconsole(dependsOn: explode, type: JavaExec)
I have another portion of the build which needs to do all of those things, but before running the JavaExec task, it needs to insert another step.
task stage(dependsOn: explode) task noconsole(dependsOn: [stage, ':projecta:noconsole'])
Unfortunately, the task graph optimizes, and the order of execution is wrong… :projecta:download :projecta:unzip :projecta:explode :projecta:noconsole <— undesirable :projectb:stage
How can I set up a build which allows me have the noconsole tasks in both projecta and projectb, but the one in projectb relies on inserting projectb:noconsole BEFORE projecta:noconsole executes?