We already have a post on how Continuous Integration allows developers to work as a team effectively. Now let’s get into the finer details of implementing CI for Android applications and iPad applications.
Our Android/iPad/iPhone CI team recently came across an application ‘Hudson’ which made life a lot easier for them. Hudson manages the CI process by integrating changes to the project thereby providing the development team with a fresh build every time. The developer can configure Hudson to receive regular emails that capture the output on each build, alerting when something goes wrong.
Installing Hudson is easy enough; just execute hudson.war file or deploy it in a servlet container. Since the output is sent through email to the concerned accounts, it does not require a database. Accessing Hudson is as easy as accessing a website. Just type in http://localhost:8080/ (on local machine) or http://domain:portnumber/ (on remote machine), in a web browser and the user will be presented with the web GUI for Hudson. The GUI is simple and offers all the configuration details required for Hudson. Hence, the user is not exposed to intricate coding details.
To configure a new job for Hudson, a user has to authenticate himself to create a job, execute it etc. Select “New Job”, type in a unique Job Name and select "Build a free_style software project". On clicking on OK you will be moved to a page where you can specifically configure Hudson for a new job. One can also get to the configuration page by clicking on the job names listed in Hudson and by selecting Configure.
In the project configuration page, the following steps need to be followed,
1. Enter the Project name.
2. Source Code Management: Select radio button Subversion
2.1 Select the path to Repository URL for SCM
Eg: https://xxx.xxx.xxx.xxx/svn/platform/FolderName
2.2 Select check-box "Use update".
If checked, Hudson will use 'svn update' whenever possible, making the build faster. But this causes the artifacts from the previous build to remain when a new build starts.
3. Build Triggers: Select check box Poll SCM
3.1 Set schedule 0, 10, 20, 30, 40, 50… This sets HUDSON to poll SCM every 0th, 10th 20th, 30th …50th minute
4. Build : Select drop-down "Add build step"
- select "Execute shell"
- fill "Command" section
For the techie reader, check out the build configuration command examples,
For iPhone,
rm -rf $WORKSPACE/hudsonbld/*rmdir $WORKSPACE/hudsonbldmkdir $WORKSPACE/hudsonbldcd $WORKSPACE/Job Name/checker-240/scan-build -v -o $WORKSPACE/ScanBldOutput xcodebuild -project AppName.xcodeproj -target TargetAppName -configuration Debug -sdk iphonesimulator 3.1.3 TARGET_BUILD_DIR=$WORKSPACE/hudsonbld
For Android,
cd $WORKSPACE/trunk ant debug
5. Post-build Actions
- Select checkBox “E-mail Notification”. Fill in the recipients email addresses separated by comma.
- Select check-box "Send e-mail for every unstable build" which mails a report on every unstable build to the specified recipients.
- Select check-box "Send separate e-mails to individuals who broke the build"
6. Click Save and you are good to go.
Hudson can be used in any development platform, by changing the build configuration command accordingly. Investing in the CI infrastructure has turned out to be a good call for us, by allowing our development teams’ incremental code integration and well-timed code checks which makes the final integration manageable and also provides a robust copy of software at each stage of the development process.
To know more about Hudson,





