Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

execCommand == null(it is actually 'null not')

I have 2 tasks created in my build.gradle. When I run the task 'remoteCopy' it runs through fine. When I run a tasks which is dependent on 'remoteCopy' I get the below error:

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!

Any pointers to what I'm doing wrong. The build.gradle is given below:

**

 - 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'
}
like image 670
Avi Avatar asked Nov 09 '22 07:11

Avi


1 Answers

The "importDump" task declaration is not valid, you have to move workingDirand commandLine out of the << { }/doLast { } block, as they are properties of the Exec task.

Try this one: task importDump(dependsOn: remoteCopy, type: Exec) { workingDir '/workspace/anivash.mutham/R10_CommercePlatform_DEV/buildtools/scripts' commandLine './importdump.sh' }

like image 71
Stefan Neuhaus Avatar answered Nov 15 '22 06:11

Stefan Neuhaus