我在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'
}
最佳答案
“importDump”任务声明无效,您必须将workingDir
和commandLine
从<< { }
/doLast { }
块中移出,因为它们是Exec任务的属性。
试试这个:task importDump(dependsOn: remoteCopy, type: Exec) { workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts' commandLine './importdump.sh'}
关于linux - execCommand == null(实际上是 'null not'),我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/40046391/