Peter Donald <[EMAIL PROTECTED]> wrote:

> Take the following
> 
>   <jar jarfile="${build.lib}/simpleserver-demo.bar"
> basedir="${build.classes}">
>       <include name="${gr}"/>
>       <include name="conf/simpleserver-demo.conf.xml"/>
>       <include name="org/apache/avalon/demos/simpleserver/*"/>
>     </jar>
> 
> 
> The ${gr} will not be expanded as far as I can tell (with a version
> about 2 weeks ago). I guess that would classify as bug eh ? ;)

If it was true. 

Please try the appended build file, it expands a property in
include.name without any problems (using any version of Ant that knows
the copy task, including a version about 2 weeks ago 8-).

Stefan

<project default="run" basedir=".">

  <target name="set-properties">
    <property name="fromdir" value="test-for-pete" />
    <property name="todir" value="test-for-pete-dest" />
    <property name="pattern" value="dir1/**" />
  </target>

  <target name="prepare-stage" depends="set-properties">
    <mkdir dir="${fromdir}/dir1/dir2" />
    <mkdir dir="${fromdir}/dir3/dir4" />
    <touch file="${fromdir}/dir1/dir2/A.txt" />
    <touch file="${fromdir}/dir3/dir4/A.txt" />
    <mkdir dir="${todir}" />
  </target>

  <target name="run" depends="prepare-stage">
    <copy todir="${todir}">
      <fileset dir="${fromdir}">
        <include name="${pattern}" />
      </fileset>
    </copy>
  </target>

  <target name="clean" depends="set-properties">
    <delete dir="${fromdir}" />
    <delete dir="${todir}" />
  </target>
</project>

Reply via email to