svn, version 1.6.16 (r1073529) compiled Mar 11 2011, 16:22:20 Get an update.
Steven ________________________________ De : Sean Van Buggenum <[email protected]> À : [email protected] Envoyé le : Mercredi 22 Juin 2011 11h52 Objet : Re: [gradle-user] Re : [gradle-user] Re : [gradle-user] exit value from exec command on windows - running subversion from gradle well, I have svn.exe on my PATH can you tell me where you got your subversion version? I realize now that I am even more in need of a better fix... and if there is a way NOT to suffer from this problem, i'd appreciated it. For i've realized, now that I've converted my script to using %COMSPEC% that doesn't even fix the problem. I am still getting the wrong exit value, even with COMSPEC i'm using svn, version 1.5.1 (r32289) compiled Jul 25 2008, 11:09:31 CollabNet On 22 June 2011 18:53, Steven Devijver <[email protected]> wrote: I don't see the problem: > > >task svnTest { >def result = project.exec { >executable = "svn" >ignoreExitValue = true >args = ["xx"] >} >if (result.exitValue != 0) println "SVN error" >} > > >Do you have svn.bat or svn.cmd in your PATH? > > >Steven > > > >________________________________ >De : Sean Van Buggenum <[email protected]> >À : [email protected] >Envoyé le : Mercredi 22 Juin 2011 10h23 >Objet : Re: [gradle-user] Re : [gradle-user] exit value from exec command on >windows - running subversion from gradle > > > >the problem is needing a dirty hack >(building a list and swapping the svn executable for COMSPEC when using >gradle's exec command) >on windows, because, on windows, exec does not return the correct exit value. >It always returns 0 > > >For example, my current work around looks a bit like this: > > >if (System.getProperty("os.name")?.toLowerCase()?.indexOf("windows") != -1){ >svnExecutor = System.getenv("COMSPEC") >svnCommandExtras += ['/c', 'svn'] >} >else// no extras needed for linux >svnExecutor = 'svn' > > > > > > >result = exec { >executable = svnExecutor >ignoreExitValue = true >args = svnCommandExtras + ['export', "${svn_repo_root}/path/settings.gradle", >file.getAbsolutePath(), '--username', "${svn_user}", '--password', >"${svn_pass}"] >} > > > > > >god help me if I need to execute other executables other than svn > > > > > > > > > > > >On 22 June 2011 18:14, Steven Devijver <[email protected]> wrote: > >> 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 >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> >> > > >
