99re热这里只有精品视频,7777色鬼xxxx欧美色妇,国产成人精品一区二三区在线观看,内射爽无广熟女亚洲,精品人妻av一区二区三区

Gradle多任務(wù)調(diào)用

2020-07-24 15:53 更新

你可以以列表的形式在命令行中一次調(diào)用多個(gè)任務(wù). 例如 gradle compile test 命令會(huì)依次調(diào)用 compile 和 test 任務(wù), 它們所依賴(lài)的任務(wù)也會(huì)被調(diào)用. 這些任務(wù)只會(huì)被調(diào)用一次, 無(wú)論它們是否被包含在腳本中:即無(wú)論是以命令行的形式定義的任務(wù)還是依賴(lài)于其它任務(wù)都會(huì)被調(diào)用執(zhí)行.來(lái)看下面的例子.

下面定義了四個(gè)任務(wù) dist和test 都 依賴(lài)于 compile ,只用當(dāng) compile 被調(diào)用之后才會(huì)調(diào)用 gradle dist test 任務(wù)

示例圖 11.1. 任務(wù)依賴(lài)

Task dependencies

例子 11.1. 多任務(wù)調(diào)用

build.gradle

task compile << {
    println 'compiling source'
}

task compileTest(dependsOn: compile) << {
    println 'compiling unit tests'
}

task test(dependsOn: [compile, compileTest]) << {
    println 'running unit tests'
}

task dist(dependsOn: [compile, test]) << {
    println 'building the distribution'
}

gradle dist test 命令的輸出

> gradle dist test
:compile
compiling source
:compileTest
compiling unit tests
:test
running unit tests
:dist
building the distribution

BUILD SUCCESSFUL

Total time: 1 secs

由于每個(gè)任務(wù)僅會(huì)被調(diào)用一次,所以調(diào)用gradle test test與調(diào)用gradle test效果是相同的.


以上內(nèi)容是否對(duì)您有幫助:
在線(xiàn)筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)