It's all about the answers!

Ask a question

What is the format to pass 'Ant arguments' through RTC

Ananya Joisa (4552124) | asked Dec 10 '12, 4:08 a.m.
Hi ,

Could anyone please tell me how to pass 'Ant arguments' through RTC? I want to be able to pass a build definition name as argument to build.xml associated to that build definition.

Through command line I would use, for example, ant -DbuildDefintion = myBuildDefinition and define -DbuildDefintion in my build.xml

I want to be able to pass the argument similarly in RTC, that is through the field 'Ant Arguments' in the Ant tab of a build definition. What would I write in this field, so that I can retrieve it as a variable in the associated build.xml?

Thanks for your help!

One answer

permanent link
Andrew Niefer (7135) | answered Dec 13 '12, 5:13 p.m.
Hi Ananya,
The online help has is some documentation on ant build properties.  There are a number of built-in properties listed there as well.

There is a "Properties" tab in the build definition editor for an ant build.  All the properties defined here will end up on the ant command line and will be available in your build.xml as you would expect.  This is best way for you to specify your properties.

You can also use the "Ant Arguments" field in the Ant tab.  There the syntax would be the same as the command line: "-DmyPropertyName=myPropertyValue".  Generally I would specify individual properties using the properties tab, the argument field would be used for other ant options, for example if you wanted to specify an entire properties file: "-propertyfile".

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.