> Now I have this problem again, and can not solve it using the gradle
> launcher, because it is not Gradle I am launching .... it is Subversion; see
> here below >
> result = exec {
>executable = 'svn'
> ignoreExitValue = true
> args = ['info', "${svn_repo_root}/${projectLoc}/build.gradle",
> '--username', "${svn_user}", '--password', "${svn_pass}"]
> }
> if (result.getExitValue()==0){
> // do something
> }
> else // do something else
What is the problem exactly?
Steven
________________________________
De : Sean Van Buggenum <[email protected]>
À : [email protected]
Envoyé le : Mercredi 22 Juin 2011 8h44
Objet : [gradle-user] exit value from exec command on windows - running
subversion from gradle
Hi all,
i'm looking for non-OS specific solution to my problem with windows and the
exit value on the exec command.
I had this problem previously, using gradle on windows, but then it was solved
brilliantly by a suggestion by a helpful user, Jesper Skov, who, when he
realized I wanted to run a gradle instance from gradle, suggested that I use
the Gradle Launcher. This worked perfectly. Not only did it solve my problems
on windows, but it was a general solution that allowed me to run my gradle
build script on linux (my native OS) as well.
Now I have this problem again, and can not solve it using the gradle launcher,
because it is not Gradle I am launching .... it is Subversion; see here below
result = exec {
executable = 'svn'
ignoreExitValue = true
args = ['info', "${svn_repo_root}/${projectLoc}/build.gradle",
'--username', "${svn_user}", '--password', "${svn_pass}"]
}
if (result.getExitValue()==0){
// do something
}
else // do something else
Apparently (and I am no windows expert) I need to, if I want to get the exit
value from the exec command on windows, use the COMSPEC thingymagig.
%COMSPEC% /c svn
??
The problem with this is I don't just want to run this on windows, but on linux
as well (without having to modify the script each time).
Is there an OS transparent way of getting my exit value?
Alternatively, is there any way of getting gradle to tell you (a project
property or so) which OS you are currently running on?
Also, i'm not one for windows...
Can I count on this COMSPEC being present on windows? If I need to use it, what
syntax should I use, in the context of the 'exec' command on gradle.
thanks for any help!
sean