ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: AW: Path definition in macro
Date Fri, 10 Dec 2004 16:56:22 GMT
Quoting Jan.Materne@rzf.fin-nrw.de:

> sure, but there are problems if you call it multiple times.
> - properties are immutable and is logged
> - overriding paths results in a log message
>

Hi Jan,

I recall conversations about turning off logging for overridden paths, since it
is a pretty useful design pattern for build files, especially those using
<import> and re-defining paths to their liking.  Will a future Ant release make
this change?  For instance, in the imported build file I have....

    <path id="build.base.classpath.local"/>
    <path id="build.classpath.local"/>

    <!-- Define standard paths here.  These should *not* be overridden.  The
empty referenced paths defined above are there for exactly this purpose -->
    <path id="build.base.classpath">
        <path refid="build.base.classpath.local"/>
    </path>
    <path id="build.classpath">
        <path refid="build.classpath.local"/>
        <path refid="build.base.classpath"/>
    </path>


..then in the importing build file, I implement the path ".local" paths.  When
I run it, I always get...

Overriding previous definition of reference to build.base.classpath.local
Overriding previous definition of reference to build.classpath.local


I already know I'm doing that, and it is exactly what I intend.  Reminding me
that it is being done isn't helping, information-wise, and it causes
unnecessary concern by other developers wondering why these messages keep
getting spewed out.


Jake


> Jan
>
>
> > -----Urspr√ľngliche Nachricht-----
> > Von: Laran Evans [mailto:lc278@cornell.edu]
> > Gesendet am: Donnerstag, 9. Dezember 2004 18:20
> > An: Ant User Mailing List
> > Betreff: Path definition in macro
> >
> > Is it allowed to define paths in a macro, like this:
> >
> >    <macrodef name="configure-build-for-server">
> >      <attribute name="server-type"/>
> >      <sequential>
> >        <property name="my.dir.auto-deploy"
> >          value="${@{server-type}.dir.auto-deploy}"/>
> >
> >        <property name="my.dir.server.compat"
> >          value="${dir.@{server-type}.compat}"/>
> >
> >        <property name="my.pattern.server.compat"
> >          value="${pattern.@{server-type}.compat}"/>
> >
> >        <path id="my.lib.server-compat">
> >          <pathelement path="${lib.@{server-type}.compat}"/>
> >        </path>
> >
> >      </sequential>
> >    </macrodef>
> >
> > --
> > Laran Evans - Cornell University
> > p: (607) 255-6864 f: (607) 255-0327
> >
> >
> > ---------------------------------------------------------------------
> > 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