小编Jac*_*ach的帖子

Gradle:排除(不跳过)最新的任务

我正在寻找一种方法来避免运行最新任务的依赖项(同时仍然运行任何其他任务的依赖项,而不是最新任务)。

采用以下结构:

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

5
推荐指数
0
解决办法
773
查看次数

标签 统计

gradle ×1