Adding CruiseControl and Netbeans to the mix
Software:
- CruiseControl 2.7.1
- JDK 1.5.0.13
- SvnAnt 1.0.0
Steps:
- Install JDK (ensure JAVA_HOME is set to the JDK home)
- Install CruiseControl
- Download and unzip SvnAnt 1.0.0
- Copy the /lib/*.jar to /lib folder of Ant
- I already has a c;\projects folder to keep all my SVN repo, Trac projects, so I will create a c:\projects\cruisecontrol
- the connectfour is a sample project that comes with CC, I will copy it over to my own
- I need to copy over 2 things from C:\Program Files\CruiseControl:
- projects folder and config.xml to c:\projects\cruisecontrol
- CC comes with ant-1.7.0, so i also need to edit config.xml to change the antHome from relative path to absolute path.
- I will also create a bat file c:\projects\cruisecontrol folder to execute the cruisecontrol.bat that is under the C:\Program Files\CruiseControl. This is required because CC will read the config.xml in the path that it is currently executing to get the configuration.
- Create a cc-build.xml under the c:\projects\cruisecontrol\my-project folder. This is to set the local folder up for checking out the source codes from SVN repo. CC does not checkout the codes for you, so we need to use SVNANT to do it.
- The last part: what to build?
- Well, my java project is created using Netbeans, which uses a build.xml which can be consumed by Ant. I simply checkout my Netbeans project sources, inside my cc-build.xml, point ant's target to the build.xml and it will compile the project without me changing the build.xnl at all.
- The build.xml without modification, will of course output the class and jar files into the dist and build folder (as in Netbeans), if you want to change it, you will have to modify build files (dont ask me, i don't know how)
${cp}
- If your project source codes is large, you will not want to checkout everything whenever you want to build. Most likely, you will want to use Update instead. To do this, I added in an Ant target to check if the .svn folder exists in the source folder. If it doesn't, Ant will do a full checkout, else it will do an update.
To change CC to run the cc-build.xml:
- To merge the Unit test results from the build.xml:
To point the Artifact folder correctly, change:
