ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "W. Sean Hennessy" <shenne...@goldenhourdata.com>
Subject RE: Difficulty with "unless" attribute
Date Thu, 12 Jun 2003 16:07:54 GMT
separate the buildstamp value property from the use as conditional
<project name="Test-bld" default="testit" >
<target name="init" unless="buildstamp.prp">
   <tstamp>
      <format property="buildstamp.date.val" pattern="yyyyMMdd-HHmm"/>
   </tstamp>
   <property name="buildstamp.prp" value="true"/>
</target>

<target name="testit" depends="init" >
 <echo message="buildstamp value ${buildstamp.date.val}"/>
</target>
</project>


init:

testit:
     [echo] buildstamp value 20030612-0906

BUILD SUCCESSFUL
Total time: 1 second
-----Original Message-----
From: Justin Maurer [mailto:jmaurer@defywire.com]
Sent: Thursday, June 12, 2003 8:50 AM
To: Ant Users List
Subject: Re: Difficulty with "unless" attribute


Yep, sorry. Couldn't cut & paste between machines :)

On Thu, 2003-06-12 at 11:43, Jacob Kjome wrote:
> Well, you are missing an end quote on the unless atrrbute, although that
> might just be a typo.
>
> Jake
>
> At 11:40 AM 6/12/2003 -0400, you wrote:
> >Greetings,
> >
> >         Much FAQ-reading and Google searching has led me here. I'm
having
> > some difficulty with the "unless" attribute of the <target> task. I have
> > a target, currently named init, with the sole purpose of setting a
> > property to be used as a buildstamp. Presently, it looks like this:
> >
> ><target name="init" unless="buildstamp>
> >         <tstamp>
> >                 <format property="buildstamp" pattern="yyyyMMdd-HHmm"/>
> >         </tstamp>
> >         <property name="buildstamp" value="blah"/>
> ></target>
> >
> >(the <property name...> doesn't affect the results - i put it in just to
> >be sure the property was being set...). I can refer to ${buildstamp}
later
> >in the file, once this target has been executed, but this target _keeps_
> >getting run, and buildstamp keeps getting changed (the lowest-level
module
> >we have depends on init, other resources depend on this module..).
> >
> >Thanks for any assistance, my sincerest apologies if I've asked a silly
> >question (I checked the FAQs!)!
> >
> >
> >Justin Maurer
> >Software Configuration Engineer
> >Defywire, Inc.
> >Direct:
> >Mobile:
> >Fax:
> >
> >Email: jmaurer@defywire.com
> >
> >"Enabling the Enterprise"
> >
> >
> >---------------------------------------------------------------------
> >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