ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Landon <RLan...@youbet.com>
Subject RE: How to use $ in a ANT property value (Who knows what ANT SHOU LD do)
Date Mon, 07 Aug 2000 20:58:34 GMT
Try this, (insert into build.xml)

<property name="helperone.classes" value="Helper$$1.class:Helper$$2.class"/>
<property name="helpertwo.classes"
value="Helper$$$$1.class:Helper$$$$2.class"/>

<target name="tryme">
<echo message="BEGIN: Who knows what ANT will do?"/> 
<echo message="(1) ${helperone.classes}"/> 
<echo message="(2) ${helpertwo.classes}"/> 
<echo message="(3) Helper$$1.class"/>      
<echo message="(4) Helper$$1.class:Helper$$2.class"/> 
<echo message="(5) Helper$$$1.class:Helper$$$2.class"/>
<echo message="(6) Helper$$$$1.class:Helper$$$$2.class"/>
<echo message="END  : Who knows what ANT will do?"/>
</target>

RESULT: build tryme

BEGIN: Who knows what ANT will do?
(1) Helper1.class:Helper2.class                 
(2) Helper$1.class:Helper$2.class
(3) Helper$1.class
(4) Helper$1.class:Helper$2.class
(5) Helper$1.class:Helper$2.class
(6) Helper$$1.class:Helper$$2.class
END  : Who knows what ANT will do?
Completed in 0 seconds

(1) $$ gets expanded to <null> as in Helper$$1.class=>Helper1.class (NOT
CORRECT)
(2) $$ gets expanded to <null> leaving (for example) Helper$$1.class which
is then
expanded to $1 (CORRECT RESULT: BUT IS NOT CONSISTENT WITH ANT
DOCUMENTATION! In other
words the expansion of $$ is positionally and semantically dependent in ANT
1.1; it's apparently different in property values, that in macro expansions)
(3) Okay $$1 goes to $1 (BUT WHAT ABOUT 1? WHAT THE SEMANTIC DIFFERENCE:
One's in a property value; one isn't)
(4) $$1 also goes to $1 (and etc)
(5) $$$1 goes to $1 (BUT WHAT ABOUT 4 and 1 $$=>$$$ Huh? what's that?)
(6) $$$$1 goes to $$1 (and expansion of $$ or $ or something like that,
stops)
   (HEY BUT WHAT ABOUT 2? $$$$1 in (2) => $1 but in (6) goes to $$1?

IF YOU CAN MAKE SENSE OF ANY OF THIS, YOU'RE ALOT SMARTER THAN I AM!

Bottom line
============================================================================
============
ANT IS "WIERD" WITH REGARDS TO HANDLING $$: It dependents on how you use $$
which
is very confusing to figure out (at least to a dunce like me). Solution: try
various 
random numbers of $$.... and maybe you'll get lucky (maybe not!). I did, uh,
I think!

Mime
View raw message