我的 build.gradle 中有这个:
task cleanCommon(type: GradleBuild) {
buildFile = 'common/build.gradle'
tasks = ['clean']
}
task cleanCrawler(type: GradleBuild) {
buildFile = 'crawler/build.gradle'
tasks = ['clean']
}
task cleanPortlet(type: GradleBuild) {
buildFile = 'portlet/build.gradle'
tasks = ['clean']
}
task cleanAll(dependsOn: ['cleanCommon', 'cleanCrawler', 'cleanPortlet']) {
}
它是如此冗长。有什么方法可以像下面的伪代码那样做吗?
taskCleanAll {
GradleBuild.pleaseRunTask('common/build.gradle', 'clean')
GradleBuild.pleaseRunTask('crawler/build.gradle', 'clean')
GradleBuild.pleaseRunTask('portlet/build.gradle', 'clean')
}