Zip the folder to publish using Jazz Ant Build task
Hi Guys,
I have created a build script i.e. Build.xml file for my project developed in Visual studio, which is shared in Jazz repository via RTC visual studio client.
I am able to build and publish my project artifacts to the build result successfully using build.xml below. But I want to publish my artifacts in zip form.
What tasks should I add to below build script to "zip" the artifacts and publish them to build results?
<?xml version="1.0" encoding="utf-8" ?>
<project name="CalculatorProject_User1" default="startActivity">
<property name="userId" value="sajjad"/>
<property name="password" value="sajjad"/>
<import file="C:\Program Files (x86)\IBM\TeamConcertBuild\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="C:\Users\Administrator\Documents\Visual Studio 2010\LocalSandbox\ExampleProject\ExampleProject\bin\Debug\ExampleProject.exe"
label="ExampleProject Debug Executable"/>
<artifactFilePublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
filePath="C:\Users\Administrator\Documents\Visual Studio 2010\ExampleProject\ExampleProject\bin\Debug\ExampleProject.pdb"
label="ExampleProject pdb symbols"/>
<linkPublisher repositoryAddress="${repositoryAddress}"
userId="${userId}"
password="${password}"
buildResultUUID="${buildResultUUID}"
url="http://www.ibm.com"
label="www.ibm.com" />
</target>
</project>
One answer
See http://lmgtfy.com/?q=Ant+task+to+zip , first result. This is really an ANT question and not an RTC question.
Comments
I know this is related to ANT but IBM RTC is using Ant Build tool kit for publishing artifacts. If we not use ANT, How does RTC helps us to publish a "zip" to the build result?
RTC just provides additional ANT tasks for RTC build related tasks. For everything else use the existing ANT tasks. So if you have a zip file there is an artifact publishing task that you can use. You can find more information here
https://jazz.net/library/article/1286
https://jazz.net/help-dev/clm/topic/com.ibm.team.build.doc/topics/r_ant-tasks.html
And I think I already pointed you to Build Artifacts Publishing and Automated Build Output Management Using the Plain Java Client Libraries