我正在寻找一种方法来避免运行最新任务的依赖项(同时仍然运行任何其他任务的依赖项,而不是最新任务)。
采用以下结构:
task stopService {}
task startService {}
task doUpdateA { // change something about the service }
task doUpdateB { // change something else about the service }
task updateA {
inputs.files <some inputs>
output.upToDateWhen { true }
// i.e. run whenever inputs changed from previous run
dependsOn stopService
dependsOn doUpdateA
dependsOn startService
// ensure the service is stopped while it's being modified
doUpdateA.mustRunAfter stopService
startService.mustRunAfter doUpdateA
}
task updateB {
inputs.files <some inputs>
output.upToDateWhen { true }
// …Run Code Online (Sandbox Code Playgroud) gradle ×1