Gradle:完成所有子项目任务后如何运行任务?

时间:2018-08-02 08:50:57

标签: gradle

我有一个多项目和build.gradle

configure(subprojects) {

    task buildAndCopyJar(dependsOn: build, type: Copy) {
    from "build/libs"
    into "../hotpot-jars/${bootJar.baseName}"
    include "*.jar"
    }

    task deploy(dependsOn: buildAndCopyJar, type: Exec) {
    commandLine "${rootProject.projectDir}/hotpot-jars/deploy.sh"
    }

}

现在buildAndCopyJar任务将为每个子项目运行,并且deploy任务将在每个buildAndCopyJar任务结束时运行。我想在完成所有{strong>所有任务后运行deploy任务,最后一次运行一次buildAndCopyJar任务。我该如何处理这种情况?

0 个答案:

没有答案