文章目录
dependsOn 依赖关系删除文件
dependsOn 依赖关系
task taskX {
dependsOn ':taskY'
doLast {
println 'taskX'
}
}
task taskY {
doLast {
println 'taskY'
}
}
输出结果 先执行taskY 再执行taskX
taskY
taskX
删除文件
每次打包前删除原包
task makeJar(type:Jar,dependsOn:['compileReleaseJavaWithJavac']){
delete "build/libs"
baseName = "****"
classifier = "release"
extension = "jar"
def srcClassDir = [project.buildDir.absolutePath + "/libs/"]
println(srcClassDir)
from srcClassDir
into('build/lib2/')
}
未完待续。。。。。。