ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Purushotham Kotlapatti <pkotlapa...@centrimed.com>
Subject Can we attach more than one listener to a build file
Date Fri, 27 Oct 2000 16:34:00 GMT
Hi All,

Can any one clarify this. Can we attach more than one listener to a build
file. I know we can attach one listener using -listener listenerclass.

Suggestions Please

Purush

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@bost.de]
Sent: Friday, October 27, 2000 9:16 AM
To: ant-dev@jakarta.apache.org
Subject: Re: reassigning perperty values?


>>>>> "GS" == Gottfried Szing <goofy@yasd.dhs.org> writes:

 GS> But there is no way to define an explicit override.

This is what I said, we probably need a way to say it is OK to
override this. IMHO the master build has to decide which are allowed
to be overriden and not the sub build.

Your example is very simple to solve BTW:

 GS> <target name="compileit"> 
 GS>   <property name="SOURCES" value="x1.java,x2.java" />
 GS>   <antcall target="compile_sources" />
 GS>
 GS>   <property name="SOURCES" value="x4.java,x3.java" />
 GS>   <antcall target="compile_sources" />
 GS> </traget>

what you want is

<target name="compileit"> 
  
  <antcall target="compile_sources">
    <param name="SOURCES" value="x1.java,x2.java" />
  </antcall>

  <antcall target="compile_sources">
    <param name="SOURCES" value="x4.java,x3.java" />
  </antcall>
</target>

which is a lot easier to understand IMHO.

And then as a short term solution (until we have decided on the future
of properties) you can write your own task, say mutableproperty that
does the same as <property> but doesn't check whether the property
already exists. You can always call Project.setProperty, it's just
<property> that doesn't want to override properties.

Stefan

Mime
View raw message