PDA

View Full Version : Ext Subversion builder shell script



jclawson
11 Dec 2009, 10:40 AM
If I find a bug in ExtJS I need to verify it against the current code in subversion. I created this windows shell script to automate the process of checking the code out and building it.

You just need to modify the first 3 variables and everything should work :-). It will checkout the code into working-directory/trunk and build the code into working-directory/deploy. If the source code was previously checked out, this script will do an update to save some time / bandwidth.

Java and svn are in my path. If they are not in your path, you need to change the appropriate variables to point to them. Make sure you have the command line subversion program. I recommend the collabnet one: http://www.collab.net/downloads/subversion/. If you install this, collabnet will add itself to your PATH automatically. You may have to restart to see the change though >.<.

Minimal testing has been done... I welcome any changes or improvements as well as versions for other operating systems.

Also, if its not obvious... copy and save this code into a .bat file :-P. Hope this helps!



:: Change these values here! -------------------
set USERNAME=your-username-here
set PASSWORD=your-password-here
set PATH_TO_BUILDER=C:\Tools\JSBuilder2.jar
:: ---------------------------------------------
:: You may need to modify these if java and svn are not on your path
set JAVA=java
set SVN=svn
::---------------------


:: Don't modify ---------------------------
set WORKING_DIRECTORY=%cd%
set BUILD_DIR=%WORKING_DIRECTORY%\deploy
set PATH_TO_JSB=%WORKING_DIRECTORY%\trunk\ext.jsb2

rmdir /Q /S %BUILD_DIR%
mkdir %BUILD_DIR%

IF EXIST trunk GOTO UPDATE
%SVN% checkout http://code.extjs.com/svn/ext/trunk/ --username=%USERNAME% --password=%PASSWORD%
GOTO BUILD
:UPDATE
%SVN% update trunk --username=%USERNAME% --password=%PASSWORD%
:BUILD
%JAVA% -jar %PATH_TO_BUILDER% --projectFile %PATH_TO_JSB% --homeDir %BUILD_DIR%