Re: <schedule> - <ant> - <property> -value"${lable}" in property value is not expanded

Nhat Tran <[email protected]>
Newsgroups gmane.comp.java.cruise-control.user
Organization Constraint Technologies International Pty Ltd
Message-ID <[email protected]>
Hi Mark,

Unfortunately there's no way for you to access the ${label} value within 
the Cruise Control's Ant call.  As you have already found out in your 
first email, the value is passes with '-D' in the call to Ant, these are 
not defined until Ant have processed them.

Simply test: build.xml
<project name="test" default="test">
  <target name="test">
    <echo message="label=${label} - build.label=${build.label}"/>
  </target>
</project>

 > ant -Dlabel=testing -Dbuild.label=${label}
> Buildfile: build.xml
>
> test:
>      [echo] label=testing - build.label=
>
> BUILD SUCCESSFUL
> Total time: 0 seconds
The only difference is that Cruise Control sets build.label to the 
string "${label}" (since it couldn't expand it to anything) rather than 
the value of ${label} at that time (like how Ant does it).


The only way I can think of for you to get what you want, since you 
can't change the existing build file, is to get Cruise Control to call 
another file, that simply have:
<project name="set-build-label" default="set-build-label">
  <target name="set-build-label">
    <property name="build.label" value="${label}"/>
    <ant antfile="build.xml" target="build"/>
  </target>
</project>

Probable not the best way, but it'll get you want you want.


Regards
Nhat Tran.


Mark Sehorne wrote:
> I think I typed it incorrectly in a couple of the problem 
> descriptions, but in the actual samples ) it is correct.   And no, 
> never a dumb question.
>
>
>
> Regards,
>
> Mark A Sehorne
> ------------------------------------------------------------------------
>
> ------------------------------------------------------------------------------
> This SF.net email is sponsored by:
> High Quality Requirements in a Collaborative Environment.
> Download a free trial of Rational Requirements Composer Now!
> http://p.sf.net/sfu/www-ibm-com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Cruisecontrol-user mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
>

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com

_______________________________________________
Cruisecontrol-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cruisecontrol-user
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.