ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From peter reilly <peter.rei...@corvil.com>
Subject Re: problem with macrodefs 'expiring' in 1.6beta2.
Date Fri, 14 Nov 2003 09:11:34 GMT
I have not had time to look to this too deeply.
However, target registry-billingchannelbyapp and registry-client
both set and use the same property "pkg". As properties
are write only once, this will not work as expected.

Peter

On Thursday 13 November 2003 19:59, Corey Jewett wrote:
> These are imported (I checked and import does not cause the problem):
>
>    <macrodef name="pkg-jar">
>      <element name="pkg-classpath" optional="yes"/>
>
>      <sequential>
>        <javac destdir="${dest-java}" source="1.4" srcdir="${src-java}">
>          <classpath>
>            <pkg-classpath/>
>          </classpath>
>          <include name="${pkg-base}/${ant.project.name}/*.java"/>
>        </javac>
>        <jar basedir="${dest-java}"
> destfile="${dest-lib}/${ant.project.name}-${version}.jar" index="yes">
>          <include name="${pkg-base}/${ant.project.name}/*.class"/>
>        </jar>
>      </sequential>
>    </macrodef>
>
>    <macrodef name="subpkg-jar">
>      <attribute name="pkg-name"/>
>      <attribute name="pkg-srcpath"/>
>      <element name="pkg-classpath" optional="yes"/>
>
>      <sequential>
>        <javac destdir="${dest-java}" source="1.4" srcdir="${src-java}">
>          <classpath>
>            <pkg-classpath/>
>          </classpath>
>          <include
> name="${pkg-base}/${ant.project.name}/${pkg-srcpath}/*.java"/>
>        </javac>
>        <jar basedir="${dest-java}"
> destfile="${dest-lib}/${ant.project.name}-${pkg-name}-${version}.jar"
> index="yes">
>          <include
> name="${pkg-base}/${ant.project.name}/${pkg-srcpath}/*.class"/>
>        </jar>
>      </sequential>
>    </macrodef>
>
> These would be E, B, A, and C: (D is basically a clone of C)
>
>    <target name="all" depends="registry, registry-billingchannelbyapp,
> registry-contentapplication, registry-deviceidentifier"
> description="Create all jars"/>
>
>    <target name="registry" depends="registry-client" description="Create
> jar">
>      <pkg-jar>
>        <pkg-classpath>
>          <pathelement location="lib/avalon-framework-4.1.4.jar"/>
>          <pathelement location="lib/jms-1.0.2a.jar"/>
>          <pathelement location="lib/poolman-patched-0.1.jar"/>
>          <pathelement
> location="target/lib/registry-client-20031112-0000.jar"/>
>          <pathelement location="lib/util-jms-20031112-0000.jar"/>
>        </pkg-classpath>
>      </pkg-jar>
>    </target>
>
>    <target name="registry-client" depends="prep" description="Create
> jar">
>      <property name="pkg" value="client"/>
>      <subpkg-jar pkg-name="${pkg}" pkg-srcpath="${pkg}">
>        <pkg-classpath>
>          <pathelement location="lib/jms-1.0.2a.jar"/>
>          <pathelement location="lib/util-jms-20031112-0000.jar"/>
>        </pkg-classpath>
>      </subpkg-jar>
>    </target>
>
>    <target name="registry-billingchannelbyapp" depends="registry-client"
> description="Create jar">
>      <property name="pkg" value="billingchannelbyapp"/>
>      <subpkg-jar pkg-name="${pkg}" pkg-srcpath="${pkg}">
>        <pkg-classpath>
>          <pathelement location="lib/avalon-framework-4.1.4.jar"/>
>          <pathelement location="lib/poolman-patched-0.1.jar"/>
>          <pathelement
> location="target/lib/registry-client-${version}.jar"/>
>        </pkg-classpath>
>      </subpkg-jar>
>    </target>
>
> Corey
>
> On Thursday, November 13, 2003, at 10:31 AM, peter reilly wrote:
> > Hi,
> > Can you send the macro's that cause the problem
> > I used
> >   <macrodef name="macro1">
> >     <attribute name="x" default="n"/>
> >     <sequential>
> >       <echo>HEllo 1 ${x}</echo>
> >     </sequential>
> >   </macrodef>
> >   <macrodef name="macro2">
> >     <attribute name="x" default="y"/>
> >     <sequential>
> >       <echo>HEllo 2 ${x}</echo>
> >     </sequential>
> >   </macrodef>
> > and  ant E seemed to work correctly.
> > A:
> >      [echo] HEllo 1 n
> >
> > B:
> >      [echo] HEllo 2 y
> >
> > C:
> >      [echo] HEllo 1 n
> >
> > D:
> >      [echo] HEllo 1 n
> >
> > E:
> >
> > BUILD SUCCESSFUL
> >
> > Peter
> >
> > On Thursday 13 November 2003 18:08, Corey Jewett wrote:
> >> Started converting over to 1.6beta2 yesterday. Macrodef is a sweet
> >> feature, but it's not working properly with dependencies. Basically I
> >> have the following:
> >>
> >> <target name="A">
> >>    <macro1/>
> >> </target>
> >>
> >> <target name="B" depends="A">
> >>    <macro2/>
> >> </target>
> >>
> >> <target name="C" depends="A">
> >>    <macro1/>
> >> </target>
> >>
> >> <target name="D" depends="A">
> >>    <macro1/>
> >> </target>
> >>
> >> <target name="E" depends="B,C,D"/>
> >>
> >> A  -> works as expected.
> >> B  -> works as expected. Calls A appropriately.
> >> C  -> A is called and executes properly. But C does not execute
> >> properly.
> >> D  -> same as C.
> >> E  -> A runs properly. B runs properly. C and D do not execute
> >> properly.
> >>
> >> By not executing properly I mean that the target 'runs', but the macro
> >> does not appear to run at all.
> >>
> >> It's as if a macro's contents are disposed of once it has been used.
> >> The only workaround I've found is to cripple my build file by removing
> >> all offending 'depends' declarations and then calling ant repeatedly
> >> for each target.
> >>
> >> Corey
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> >> For additional commands, e-mail: user-help@ant.apache.org
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message