It's all about the answers!

Ask a question

How to get the load dir path in a command line build


Jean-Michel Athane (671212) | asked Dec 10 '10, 9:55 a.m.
I setup a RTC command line build.
In the shell, I would like to know the full path of the root of the build workspace (i.e. the load directory as set in the build definition).
Any idea ?

3 answers



permanent link
Jean-Michel Athane (671212) | answered Dec 10 '10, 12:10 p.m.
I found a workaround, but I don't like it since this is not documented :

The command I execute is gmake, in a subdir of my workspace.

Looking carefully at the execution environment, I found that there is a build property called team.scm.fetchDestination which contains the value of the Load Directory as filled in the Build Definition. I pass this value to gmake with the argument fetchDir=${team.scm.fetchDestination}

Also, I found that, when gmake executes, the environment variable PWD is the 'eclipse' dir of the Build engine (although the command is executed in a subdir)

As the fetchDir can be either absolute or relative to this directory, I compute in the Makefile the absolute path to the root of my workspace this way :

WSROOT = $(shell cd $(PWD) ; cd $(fetchDir) ; /bin/pwd)

... but one more time, as it uses undocumented properties and side effects of the execution context, I don't like this.

Any other idea ??

permanent link
Nick Edgar (6.5k711) | answered Dec 14 '10, 12:26 p.m.
JAZZ DEVELOPER
Using ${team.scm.fetchDestination} is the recommended way of referring to the load directory. It's documented in that it's shown as the name of the property in the build definition.

For the working directory, you can configure which working directory you want in the Command Line page of the build definition. If left blank, it defaults to whatever was the current working directory when you ran JBE.

An alternative, and perhaps clearer, approach is to use build properties.
Set a build property with name 'loadDir' and value to be whatever you want as the load directory (absolute path on the build machine).
In the Jazz Source Control page, use ${loadDir} as the load directory.
In the Command Line page, use ${loadDir}/yourProjectName as the working directory (or whatever directory contains your build script), and specify simply 'gmake' as the command to run.

permanent link
Jean-Michel Athane (671212) | answered Dec 21 '10, 4:21 p.m.
Thanks a lot, I'll test it asap !

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.