小编fea*_*ear的帖子

如何只执行 build.gradle 中的特定任务?

构建.gradle 是:

task copy(type: Copy, group: "Custom", description: "Copies sources to the dest directory") {
    from "src"
    into "dest"
    println "copy"
}

task hello {
    println "hello"
}
Run Code Online (Sandbox Code Playgroud)

当我尝试使用 时 ./gradlew copy, 和copy都hello被执行。输出如下:

> Configure project :
copy
hello
Run Code Online (Sandbox Code Playgroud)

我怎样才能只执行copy?

gradle gradlew build.gradle gradle-plugin

3
推荐指数
1
解决办法
1550
查看次数

标签 统计

build.gradle ×1

gradle ×1

gradle-plugin ×1

gradlew ×1