ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Creating new JARs based on property change
Date Thu, 17 Mar 2005 06:33:19 GMT
<target name="jar.notSigned" unless="shouldSign">
  ...only jar the files...
</target>

<target name="jar.signed" if="shouldSign"> 
   ...jar and sign...
</target>

<target name="jar" depends="jar.notSigned,jar.signed"/>


Jan

> -----Ursprüngliche Nachricht-----
> Von: Rainer Noack [mailto:rainer@noacks.net]
> Gesendet am: Mittwoch, 16. März 2005 22:56
> An: 'Ant Users List'
> Betreff: RE: Creating new JARs based on property change
> 
> Holger,
> 
> I'm not really sure what you mean.
> Either you have one "boolean" property that tells you cfg has 
> changed or not
> Or you have two properties with last and current cfg.
> 
> In both cases you can use a combination of <condition> task 
> and target's
> <if> attribute:
> 
> 
> Example for the second (more complex) case:
> 
> <target name="loadprop">
>   <property name="cfg" location="..."/>
>   <property file="lastcfg.properties" prefix="old"/>
>   <condition property="cfg.changed">
>     <not><equals arg1="${cfg}" arg2="${old.cfg}"/></not>
>   </condition>
> </target>
> 
> <target name="removejar" depends="loadprop" if="cfg.changed">
>   <delete file="my.jar"/>
>   <echo file="lastcfg.properties">${cfg}
>   </echo>
> </target>
> 
> <import file="${cfg}"/>
> 
> Make sure to have "removejar" in your depends chain.
> 
> Instead of the additional target you can also use 
> ant-contrib's <if> task.
> 
> Cheers
> 
> Rainer
> 
> > -----Original Message-----
> > From: Holger Rauch [mailto:holger.rauch@heitec.de] 
> > Sent: Wednesday, March 16, 2005 5:52 PM
> > To: Ant Users List; rainer@noacks.net
> > Subject: Re: Creating new JARs based on property change
> > 
> > 
> > On Wed, 16 Mar 2005, Rainer Noack wrote:
> > 
> > > Remove the existing jar.
> > 
> > Sure, but I only want to remove the existing JAR if the 
> > property indicating whether the JAR is supposed to be signed 
> > has changed since otherwise I end up rebuilding the JAR file 
> > even though it wasn't necessary. This property is set in a 
> > build file that's loaded via <property name="cfg" 
> > location="..."> and then <import file="${cfg}" />. What's the 
> > proper way to determine a property change in such a case?
> > 
> > TIA.
> > 
> > 
> ---------------------------------------------------------------------
> > 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