taskX.finalizedBy taskY
task hello << {
println 'hello world'
}
hello.onlyIf { !project.hasProperty('skipHello') }
taskA.dependsOn(taskB)
description 描述
task copy(type: Copy) {
description 'Copies the resource directory to the target directory.'
from 'resources'
into 'target'
include('**/*.txt', '**/*.xml', '**/*.properties')
}
taskB.mustRunAfter(taskA) //只有A B都需要执行时,这才生效,单独执行B,不会启动A
task copy(type: Copy) {
println('I am the old one.')
}
task copy(overwrite: true) {
println('I am the new one.')
}