我具有以下gradle结构:
|_ C
|_ build.gradle
|_ B
|_ build.gradle
|_ A
|_ build.gradle
|
|_ build.gradle
在我的根build.gradle
中,我有以下任务:
configure(digitalJsProjects) {
apply plugin: 'base'
task Install(type: Exec) {
// install
}
task build(type: Exec) {
// build
}
task test(type: Exec) {
commandLine 'yarn', 'test:ci'
onlyIf {
!yarnBuild2.state.upToDate
}
}
xBuild.dependsOn install
test.dependsOn xbuild
build.dependsOn test
}
如果我想运行A
构建,那么我的A
build.gradle
看起来像这样:
build.dependsOn ':B:build'
build.dependsOn ':C:build'
但是当我运行gw :A:build - m
我知道:
:A:frontend:assemble SKIPPED
:A:frontend:check SKIPPED
:A:frontend:install SKIPPED
:A:frontend:xBuild SKIPPED
:A:frontend:test SKIPPED
:B:frontend:assemble SKIPPED
:B:frontend:check SKIPPED
:B:frontend:install SKIPPED
:B:frontend:xBuild SKIPPED
:B:frontend:test SKIPPED
:C:frontend:assemble SKIPPED
:C:frontend:check SKIPPED
:C:frontend:install SKIPPED
:C:frontend:xBuild SKIPPED
:C:frontend:test SKIPPED
:A:build
我没想到将A
任务视为首要任务。
我希望所有B
任务都可以运行,然后运行C
任务之前的A
任务。 A:build
是我期望的位置,但是为什么其他A
个任务首先运行,或者我如何实现此构建顺序:
:B:frontend:assemble SKIPPED
:B:frontend:check SKIPPED
:B:frontend:install SKIPPED
:B:frontend:xBuild SKIPPED
:B:frontend:test SKIPPED
:C:frontend:assemble SKIPPED
:C:frontend:check SKIPPED
:C:frontend:install SKIPPED
:C:frontend:xBuild SKIPPED
:C:frontend:test SKIPPED
:A:frontend:assemble SKIPPED
:A:frontend:check SKIPPED
:A:frontend:install SKIPPED
:A:frontend:xBuild SKIPPED
:A:frontend:test SKIPPED
:A:build