ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@m64.com>
Subject RE: Expansion in includes
Date Wed, 06 Dec 2000 12:19:55 GMT
Just ran this with my recent change and you get

BUILD FAILED

F:\test\build.xml:29: Property ${pattern2} has not been set



> -----Original Message-----
> From: Peter Donald [mailto:donaldp@apache.org]
> Sent: Wednesday, 6 December 2000 22:39
> To: ant-dev@jakarta.apache.org
> Subject: Re: Expansion in includes
>
>
> At 11:44  6/12/00 +0100, you wrote:
> >Peter Donald <donaldp@apache.org> wrote:
> >
> >>>Attachment Converted: "c:\eudora\attach\test_for_pete.xml"
> >>
> >> Yep - that one works ... but the above doesn't ;)
> >
> >Sorry Pete, that must be a bug in your build file, maybe a typo or
> >something. The ${} expansion doesn't depend on the task, it
> happens in
> >ProjectHelper.configure - for all elements except project and target.
>
> Hmm - can for the life of me see the bug. Heres a little
> snippet showing
> that        <include name="${pattern2}"/> isn't exapanded (as
> it matches a
> file with name ${pattern2}) but I still can't see what is
> wrong with the
> build file. Will get back to you thou as there has been a few
> messages on
> ant-user concerning this and I always just assumed it was a
> "feature" ;)
>
> ----------------------
>
> <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" />
>     <touch file="${fromdir}/$${pattern2}" />
>     <mkdir dir="${todir}" />
>   </target>
>
>   <target name="run" depends="prepare-stage">
>     <copy todir="${todir}">
>       <fileset dir="${fromdir}">
>         <include name="${pattern}" />
>       </fileset>
>     </copy>
>   </target>
>
>   <target name="run-jar" depends="prepare-stage">
>      <jar jarfile="${todir}/blah.jar" basedir="${fromdir}">
>        <include name="${pattern2}"/>
>        <include name="dir1/dir2/A.txt"/>
>      </jar>
>   </target>
>
>   <target name="clean" depends="set-properties">
>     <delete dir="${fromdir}" />
>     <delete dir="${todir}" />
>   </target>
> </project>
> Cheers,
>
> Pete
>
> *-----------------------------------------------------*
> | "Faced with the choice between changing one's mind, |
> | and proving that there is no need to do so - almost |
> | everyone gets busy on the proof."                   |
> |              - John Kenneth Galbraith               |
> *-----------------------------------------------------*
>


Mime
View raw message