ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From viet nguyen <>
Subject basename & variables not working in solaris
Date Wed, 13 Aug 2008 14:37:08 GMT

I'm trying to dynamically generate a list of jars in a Java webstart JNLP
file in the following format

<jar href="jar1"/>
<jar href="jar2"/>
<jar href="jarx"/>

1. my list of jars

<path id="dep.jars"> 
   <fileset dir="out/dist/loadtest">
      <include name="test*_*.jar"/>

2.  For each jar get its basename and build the string <jar href="..."/>

                <var name="href" unset="true"/>

   <for param="jar">
      <path refid="dep.jars"/>
           <var name="jar.basename" unset="true"/>		
           <basename property="jar.basename" file="@{jar}"/>
           <var name="href" value="${href}&lt;jar
3.  Replace a placeholder in test.jnlp with the dynamic jar list
    		<replace file="test.jnlp" token="@RT.LIB@" value="${href}"/>

The above steps work in Windows but <basename> does not work in Solaris. 
Once assigned a value in the first iteration "jar.basename" behaves like an
immutable property although it's a variable.  Its value can't be changed.   
I'm using ant 1.7.0, ant-contrib-1.0b2.jar, jdk1.5.08.  

Is there a better way to accomplish what I was trying to do?

View this message in context:
Sent from the Ant - Users mailing list archive at

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message