/ Published in: Groovy
Sample SVN call from gradle: doSvnMain( 'your', 'svn', 'args', 'go', 'here' );
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/* File : helperSvn.gradle Author: Laurence Toenjes Date : 3/31/2013 Example of how to use: 1. Put this file in the same directory as your build.gradle file. 2. Near the very top of your build.gradle source file add this line: apply from: 'helperSvn.gradle' 3. You can now do svn commands like: doSvnMain( 'export', 'http://svn.codehaus.org/gmod/gsql/tags/gsql-1.5.0/', 'build/svnExport' ); doSvnMain( 'help' ); ... etc. ... Note: each command line arg you would normally supply to a svn command should be an arg passed to doSvnMain (since we are not using the OS shell you should probably not have to double quote any of the args). */ buildscript { repositories { mavenCentral() } dependencies { classpath( 'org.tmatesoft.svnkit:svnkit:1.7.8', 'org.tmatesoft.svnkit:svnkit-cli:1.7.8' ) } } project.ext.SVN = SVN; /* for certain scenarios might be useful to share this project var */ } ); }; /* for certain scenarios might be useful to share these closures with build */ project.ext.disableSystemExitCall = _disableSystemExitCall; project.ext.enableSystemExitCall = _enableSystemExitCall; /* key method/closure - used as: doSvnMain( 'your', 'svn', 'args', 'go', 'here' ); */ _disableSystemExitCall(); /* stop SVN.main from doing a System.exit call */ try { _enableSystemExitCall(); } } ;