It's all about the answers!

Ask a question

Can I determine repository workspace from ANT script?


John Weber (11) | asked Aug 19 '16, 5:50 p.m.
Is it possible to determine the repository workspace currently loaded into my eclipse workspace from an ANT script launched from the Eclipse workspace external tools menu?

Thanks
John Weber

One answer



permanent link
Ralph Schoon (61.4k33643) | answered Aug 23 '16, 4:45 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER
John,

what do you want to achieve?

You can output the properties you get passed. The repository workspace UUID is in team.scm.workspaceUUID.

#Mon Aug 22 15:34:56 CEST 2016
team.scm.includeComponents=false
repositoryAddress=https\://clm.example.com\:9443/ccm/
team.scm.fetchDestination=JKEBuild\\I20160822-1534
buildDefinitionId=jke.dev
buildLabelPrefix=I
buildEngineHostName=IBM307-R909ZLFG
team.scm.loadComponents=
com.ibm.team.build.internal.template.id=com.ibm.team.build.ant
team.scm.buildOnlyIfChanges=true
outputRootDirectory=JKEBuild
team.scm.createFoldersForComponents=false
team.scm.workspaceUUID=_FdI4gLLtEeWDIeAzTW_Bmg
buildEngineId=jke.dev.engine
buildLabel=I20160822-1534
requestUUID=_MMEwcGhtEeaD9OIN0qZrCg
buildRequesterUserId=ralph
buildResultUUID=_MMEwcWhtEeaD9OIN0qZrCg
team.scm.acceptBeforeFetch=true
team.scm.deleteDestinationBeforeFetch=true
team.scm.componentLoadRules=
com.ibm.team.build.internal.engine.monitoring.threshold=3
team.scm.snapshotUUID=_MbXwsGhtEeaD9OIN0qZrCg

Comments
John Weber commented Aug 23 '16, 9:06 a.m.

I created the following ant script in my Eclipse workspace in a project which is under Jazz source control loaded from a repository workspace.

<?xml version="1.0" encoding="UTF-8"?>
<project name="Test" basedir="." default="echoWorkspace">
 <target name="echoWorkspace">
  <echo message="team.scm.workspaceUUID = ${team.scm.workspaceUUID}" />  
 </target>
</project>

I run this ANT script from eclipse by right clicking on it and choosing Run As->Ant Build. The output is:

Buildfile: C:\Sandbox\OCS\GenesysBuildResources\NewBuildTools\Test.xml
echoWorkspace:
     [echo] team.scm.workspaceUUID = ${team.scm.workspaceUUID}
BUILD SUCCESSFUL
Total time: 189 milliseconds

What I would like to achieve is that the output from the ANT script return the UUID of the remote workspace that the project was loaded from.


Ralph Schoon commented Aug 23 '16, 9:19 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

team.scm.workspaceUUID should give you that, I think. e.g.

<echo message="Workspace=${team.scm.workspaceUUID}" />

But for a normal build it would be the repository workspace that is default, only for personal builds it would be different, I think.

What is the benefit of showing the team.scm.workspaceUUID ?

Your answer


Register or to post your answer.