我在build.gradle中创建了2个任务。当我运行任务'remoteCopy'时,它运行良好。当我运行依赖于'remoteCopy'的任务时,我得到以下错误:
Executing task ':importDump' (up-to-date check took 0.0 secs) due to:
Task has not declared any outputs.
:importDump FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':importDump'.
> execCommand == null!
指出我做错了什么。 build.gradle如下:
**
- build.gradle
**
task remoteCopy(type: Exec) {
workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts'
commandLine './remotecopy.sh'
}
task importDump(dependsOn: remoteCopy,type:Exec) << {
workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts'
commandLine './importdump.sh'
}
答案 0 :(得分:0)
&#34; importDump&#34;任务声明无效,您必须将workingDir
和commandLine
移出<< { }
/ doLast { }
块,因为它们是Exec任务的属性。
试试这个:
task importDump(dependsOn: remoteCopy, type: Exec) {
workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts'
commandLine './importdump.sh'
}