Help get this topic noticed by sharing it on Twitter, Facebook, or email.

gradle build with CommandLine

Hello,

I am running a problem with Gradle build. Here is my build script segment
...

task svnco(type: Exec) {
commandLine 'svn', 'co', 'http://mysvn/products/myproduct/trunk', 'project'
}
task myJar(type: Exec, dependsOn: svnco) {
commandLine 'gradle', '-b', 'project/build.gradle', 'install'
}
....

From Window console, in C:/mytest folder, I run
gradle myJar

The script checkout source code into project subfolder successfully. But then failed while do the gradle build:

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':commonJar'.
> A problem occurred starting process 'command 'gradle''

Then I run the script with –stacktrace option, the error shows
....
Caused by: java.io.IOException: Cannot run program "gradle" (in directory "C:\myTest"): CreateProcess error=2, The system cannot find the file specified
at org.gradle.process.internal.ExecHandleRunner.run(ExecHandleRunner.java:72)
... 1 more
Caused by: java.io.IOException: CreateProcess error=2, The system cannot find the file specified
... 2 more

I can't tell which file it complains missing. What went wrong?

Also, how to change current working directory to a subfolder (something like 'cd project' )in Gradle?

Thanks,
Simon
1 person has
this question
+1
Reply