Thursday, January 5, 2012

TFS Build 2010 calls Ant for Java

Java builds using Ant/Team Build 2010 can be configured easily with help of Team foundation Server build extensions power tools.

Prerequisites

We can setup Java builds using Ant scripts.

Here are the software/tools required on the Build server (Assuming TFS build has been already setup on this server).

1. Install Java JDK

2. Install ANT 1.8.x

3. Define ANT_HOME and JAVA_HOME

4. Install Team Foundation Server Build extensions power tool August 2011 (http://visualstudiogallery.msdn.microsoft.com/2d7c8577-54b8-47ce-82a5-8649f579dcb6/)

At the client machine (Optional to verify the ant script at client machine)

1. Install Java JDK

2. Install Apache ANT 1.8.x

3. Define ANT_HOME and JAVA_HOME

4. Install Eclipse helios or higher

5. Install Team Explorer Everywhere eclipse plug-in

6. Ant script to compile the code (We can create, if this is not available)

Steps

Step 1: In Eclipse on “Team Explorer”, right click on the Builds node (on the TFS Project) and select “New build Definition”

clip_image002

Step 2: Create build

clip_image004

Step 3: Setup the build triggers. If you need CI build, choose the “Continuous Integration – Build each check-in”

clip_image006

Step 4: Choosing the workspace mapping.

Select the TFS source folder where you have source and the compile ant script

clip_image008

Step 5: Build defaults. Specify the build controller and drop location

clip_image010

Step 6: Creating team build proj file. Click on “Create” button

clip_image012

Select “MSBuild Configuration from Existing Ant Buildfile” and click next

clip_image014

Browse and select the ant build file and click finish

clip_image016

Build has been created

clip_image018

Step 7: Queue the build

clip_image020

Step 8: Build Succeeded.

clip_image022

No comments:

Post a Comment