有没有办法在一个 gradle 任务中创建多个任务,如下所示,
task zipFiles() {
doLast {
copy{
from( "../licenses" ) {
include '**/*.txt'
}
into "../$releaseFolder/licenses"
}
zip {
from("../$releaseFolder/licenses")
include '*'
into "licenses"
destinationDir = file("../$releaseFolder/")
archiveName = "licenses.zip"
}
}
}
或者我需要为复制和压缩创建多个任务,(这在构建文件中创建了大量任务)。