This articles explains how you can use the Jazz Ant Tasks in the IBM Rational Team Concert (RTC) build for Microsoft Visual Studio (VS) projects or solutions. For integration support details please visit System Requirements
<?xml version="1.0" encoding="utf-8" ?> <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <AntCommand>C:\BuildToolKit\jazz\buildsystem\buildengine\eclipse\plugins\org.apache.ant_1.7.1.v20100518-1145\bin\ant -lib C:\BuildToolKit\jazz\buildsystem\buildtoolkit</AntCommand> <propertyFile>-propertyfile C:\BuildToolKit\jazz\buildsystem\buildengine\eclipse\build.properties</propertyFile> <jazzbuildxml>-f $(fetchDestination)\TBDForm\TBDForm\build.xml</jazzbuildxml> </PropertyGroup> </Project>
Above
AntCommand uses the ant executable packaged with the Jazz Build Tool Kit.
propertyFile can be created in any location. This is automatically created when the Build is triggered. You can chose any location where you want this file to be created.
jazzbuildxml is the file in which you will define the Ant Targets to build. see below.
<?xml version="1.0" encoding="utf-8" ?> <project name="jazz build targets" default="startActivity"> <property name="userId" value="jazzadmin"/> <property name="password" value="jazzadmin"/> <import file="C:\BuildToolKit\jazz\buildsystem\buildtoolkit\BuildToolkitTaskDefs.xml"/> <target name="startActivity"> <startBuildActivity repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" activityIdProperty="buildactivityId" label="${activityLabel}" autoComplete="true" verbose="true" buildResultUUID="${buildResultUUID}" /> </target> <target name="publishActivity"> <tstamp/> <startBuildActivity buildResultUUID="${buildResultUUID}" label="${activityLabel}" autoComplete="true" repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}"/> <artifactFilePublisher repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" buildResultUUID="${buildResultUUID}" filePath="${team.scm.fetchDestination}\TBDForm\TBDForm\bin\RTCBuildDebug\TBDForm.exe" label="TBDForm Debug Executable"/> <artifactFilePublisher repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" buildResultUUID="${buildResultUUID}" filePath="${team.scm.fetchDestination}\TBDForm\TBDForm\bin\RTCBuildDebug\TBDForm.pdb" label="TBDForm pdb symbols"/> <linkPublisher repositoryAddress="${repositoryAddress}" userId="${userId}" password="${password}" buildResultUUID="${buildResultUUID}" url="http://www.ibm.com" label="www.ibm.com" /> </target> </project>
Find the following line the .csproj file
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
Add the following line after it:
<Import Project="..\TBDForm\CommonProperties.xml" />" />
Location of the MSbuild property file depends upon the where you have created it in the VS Project Directory.
if $(Configuration) == RTCBuildDebug ($(AntCommand) -DactivityLabel=Starting_$(AssemblyName) $(propertyFile) $(jazzbuildxml) startActivity)
if $(Configuration) == RTCBuildDebug ($(AntCommand) -DactivityLabel=Finished_$(AssemblyName) $(propertyFile) $(jazzbuildxml) publishActivity)
RTCBuildDebug
/property:fetchDestination=${team.scm.fetchDestination}
${team.scm.fetchDestination}
build.properties or C:\yourdir\build.properties (The path is what you defined in CommonProperties.xml with propertyFile variable)
jbe -repository https://server-vs.ibm.com:9443/ccm -userId jazzadmin -pass jazzadmin -engineId VS-Build-Engine -verbose
This setup is complete. You can now use the Jazz Ant Task in your Microsoft Visual Studio Builds.
Status icon key: