It's all about the answers!

Ask a question

How to load code using ant script based on baseline ?


Daisy Huang (4210) | asked May 10 '17, 2:50 a.m.
edited May 10 '17, 5:55 a.m.

I've been able to fetch all code(to be clear latest) using ant. What I want is to fetch the code incrementally.
Here's the script I use for now. What should I do to change the script to fetch code that delivered to stream since last baseline?



test.bat is the script to kick off ant.
@echo off
set ANT_HOME=C:\test_0503\apache-ant-1.9.4
set JAVA_HOME=C:\Program Files (x86)\Java\jdk1.7.0_01
set PATH=%ANT_HOME%\bin;%JAVA_HOME%\bin;
ant -lib C:\test_0503\buildtoolkit -buildfile=C:\test_0503\build.xml -l C:\test_0503\build.log
echo "Start build..."
pause
The content of build.xml is as below, I used 2 tasks:teamFetch and teamAccept:

<project name="simpleRTCAntBuildExample" default="rtcFetchCode" basedir=".">

<import file="C:\test_0503\buildtoolkit\BuildToolkitTaskDefs.xml"/>

<taskdef name="teamFetch" classname="com.ibm.team.build.ant.task.TeamFetchTask" />
<taskdef name="teamAccept" classname="com.ibm.team.build.ant.task.TeamAcceptTask"/>   

<target name="init">
    <property name="repositoryAddress" value="https://www.hdyhuang.com:9443/ccm/" />
    <property name="rtc.username" value="admin1" />
    <property name="rtc.password" value="admin1" />
    <property name="rtc.workspace.name" value="project area_2.7.0_model Workspace" />
    <property name="deploy.checkout.dir" value="C:\test_0503\dir" />
</target>

<target name="rtcFetchCode"  depends="init">
    <teamAccept repositoryAddress="${repositoryAddress}"
                userId="${rtc.username}"
                password="${rtc.password}"
                workspaceName="${rtc.workspace.name}"
                changeSetFile="changeSets.txt"
                verbose="true" />
    <echo message="export from test_build_workspace"/>
    <teamFetch repositoryAddress="${repositoryAddress}"
                            userId="${rtc.username}"
                            password="${rtc.password}"
                            workspaceName="${rtc.workspace.name}"
                            destination="${deploy.checkout.dir}"
                            verbose="true" />                                     
</target>

</project>

Accepted answer


permanent link
Ralph Schoon (59.4k23642) | answered May 11 '17, 3:59 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

 I think your best chance will be to use the SCM command line.



You should be able to use an exec task in ANT to run that.

Daisy Huang selected this answer as the correct answer

Your answer


Register or to post your answer.