ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject RE: adding the same manifest to all jars
Date Wed, 26 May 2004 05:34:00 GMT
It can not.
Some things come to my mind:
1. rename the propriate include file to a fix name by a wrapper script
   example: build.xml, one.inc, two.inc
     rename one.inc _current_.inc
     call ant
   and in build.xml you include _current_.inc
2. Use manifest´s ID and REFID attributes
   BUT: id is present, refid not ... 
   so you have to modify that a little bit :-)

<import> wont work because you can do it only on top level ...


IDEA! <presetdef>

Use presetdef to redefine your jar-command. One redifinition for each
manifest.
Do that in an own target for each redifinition. Then just call the target
before, you
want to have.

<target name="define-jar-mf1">
   <presetdef name="myjar">
       <jar><manifest.../></jar>
   </presetdef>
</target>

<target name="define-jar-mf2">
   <presetdef name="myjar">       <!-- same name here! -->
       <jar><manifest.../></jar>  <!-- but other mf -->
   </presetdef>
</target>

<target name="define-jar">
    <property name="which-mf" value="mf2"/> <!-- default -->
    <antcall target="define-jar-${which-mf}"/>
</target>

<target name="jar" depends="define-jar">
    <myjar .../>
</target>


I´m not sure whether the <antcall> works or whether it opens a new scope for

definitions. Then you´ll have to make a komplex structure with depending
targets
and if/unless clauses (would be easer to use AntContribs if/then in this
case :-)


Jan



> -----Original Message-----
> From: Liam Howlett [mailto:liamho@nortelnetworks.com]
> Sent: Tuesday, May 25, 2004 2:59 PM
> To: Ant Users List
> Subject: RE: adding the same manifest to all jars
> 
> 
> That sounds good! but how can an include be overwritten by a command
> line option?
> 
> Liam.
> 
> On Tue, 2004-05-25 at 08:36, Jan.Materne@rzf.fin-nrw.de wrote:
> > I would try a xml-include.
> > 
> > Jan
> > 
> > > -----Original Message-----
> > > From: Liam Howlett [mailto:liamho@nortelnetworks.com]
> > > Sent: Tuesday, May 25, 2004 2:30 PM
> > > To: Ant Users List
> > > Subject: adding the same manifest to all jars
> > > 
> > > 
> > > Hello,
> > > 
> > > I was wondering if there was an easier way than manually 
> > > adding the same
> > > manifest section to each xml file that is called by a 
> subant call.  I
> > > want a default that could be overwritten if the xml file is called
> > > separate.  The only way I can currently see working is 
> making a module
> > > and calling the module.
> > > 
> > > Thanks for any help in advance,
> > > Liam
> > > 
> > > 
> > > 
> ---------------------------------------------------------------------
> > > 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
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message