Retrieving BuildDef properties in ANT using RTC Build Agent
Currently to retrieve the value of a property defined in the BuildDef I have to prefix it with env in my build.xml file
I.E.
${env.userId}
Is there a way to get the values without using the "env" prefix. What I really want is to be able to use the same property name as defined in the Builddef without have to use a prefix. In our product we have ant tasks already defined and in use for our customer base. What I want to do is to be able to drive it using the RTC Build & BuildDef, but I need to be able to retrieve the properties by the same names.
IS there some way to configure the build agent not to use env as a prefix on properties?
-Steve
I.E.
${env.userId}
Is there a way to get the values without using the "env" prefix. What I really want is to be able to use the same property name as defined in the Builddef without have to use a prefix. In our product we have ant tasks already defined and in use for our customer base. What I want to do is to be able to drive it using the RTC Build & BuildDef, but I need to be able to retrieve the properties by the same names.
IS there some way to configure the build agent not to use env as a prefix on properties?
-Steve
One answer
You can use -D arguments in the Ant invocation then. e.g. ant build.xml -DbuildResultUUID=$buildResultUUID
where the value uses whatever syntax is necessary in the BF step to substitute the property value.
I'm not sure if BF has some way of exporting all the properties in .properties file format. If so, you could do as Sam suggests, or use -propertyfile. See https://ant.apache.org/manual/running.html
Comments
showing 5 of 8
show 3 more comments
Comments
sam detweiler
Aug 05 '14, 2:59 p.m.Steve White
Aug 05 '14, 3:36 p.m.