Gradle -格拉德尔的选择
以下是来自 任务树关联菜单提供以下选项: 执行忽略依赖项。这不需要依赖关系 要重建的项目(与-a选项相同) 不清楚什么是Gradle -格拉德尔的选择,gradle,Gradle,以下是来自 任务树关联菜单提供以下选项: 执行忽略依赖项。这不需要依赖关系 要重建的项目(与-a选项相同) 不清楚什么是-a选项?我尝试为以下构建脚本执行gradle hl-a: task helloapi { description = "Hello api" } task hl (dependsOn: 'helloapi'){ println "Hl" description = "Hl" } helloapi << { println "He
-a
选项?我尝试为以下构建脚本执行gradle hl-a
:
task helloapi {
description = "Hello api"
}
task hl (dependsOn: 'helloapi'){
println "Hl"
description = "Hl"
}
helloapi << {
println "Hello api"
}
我认为根据目标任务排除任务的唯一方法是使用-x
选项。顺便说一句,当我试图在gradle--gui
中运行它时,我得到了以下错误:
Executing command: "api:hl-a"
Hl
FAILURE: Build failed with an exception.
* What went wrong:
Project 'api' not found in project ':api'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.751 secs
它是一个bug吗?
-一个
选项忽略项目依赖项,而不是任务依赖项。假设有一个复杂的多模块项目。只有一个模块发生了更改(任务已更改),您希望检查此任务是否正常工作,当指定了-a
选项时,不会重建其他模块,只重建更改的模块。api从何而来?你能让你的例子符合现实吗?@St.Antario:这就是你想要的吗?
Executing command: "api:hl-a"
Hl
FAILURE: Build failed with an exception.
* What went wrong:
Project 'api' not found in project ':api'.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 6.751 secs