ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rainer Noack" <rai...@noacks.net>
Subject RE: how can i undeclare taskdef?
Date Sun, 04 Apr 2004 10:01:43 GMT
Barry,
maybe I didn't understand you right, but unless works
for me well when i run ant with multiple targets.
example:
<project name="test" default="b" basedir=".">
<target name="a" unless="a.done">
  <echo>a</echo>
  <property name="a.done" value="true"/>
</target>
<target name="b" depends="a">
  <echo>b</echo>
</target>
<target name="c" depends="a">
  <echo>c</echo>
</target>
</project>

running "ant b c" (with Ant 1.6.1.) produces the following output:

a:
     [echo] a
b:
     [echo] b
a:
c:
     [echo] c

Which is exactly what expected.
Regards,
Rainer

> -----Original Message-----
> From: Baz [mailto:barry@goodconsultants.com] 
> Sent: Sunday, April 04, 2004 1:09 AM
> To: Ant Users List; rainer@noacks.net
> Subject: Re: how can i undeclare taskdef?
> 
> 
> Rainer,
> 
> I have added a line "<property name="is.test" value="true"/> 
> in the end of the task of the jsp compile. Hoping that when i 
> run "ant deploy deploy", running the target "deploy" second 
> time would see the "unless="is.test"". However, when i test 
> the value of is.test, the seocnd time running, it was not 
> initiated. So, your suggestion does not work.
> 
> Your suggestion will work if the same task run in one "ant 
> session" but i dont think it will work if i do "ant deploy deploy".
> 
> All, please enlight me.
> 
> Barry
> 
> ----- Original Message ----- 
> From: "Rainer Noack" <rainer@noacks.net>
> To: "'Ant Users List'" <user@ant.apache.org>
> Sent: Saturday, April 03, 2004 2:42 PM
> Subject: FW: how can i undeclare taskdef?
> 
> 
> > Barry,
> > sorry, you need to use depends AND unless attribute
> > if you're running ant with multiple targets.
> > example:
> >
> > <target name="jspctaskdef" unless="jspctaskdef.done">
> >   <property name="jspctaskdef.done" value="true"/>
> >   <taskdef .....  />
> > </target>
> >
> > <target name="jspc" depends="jspctaskdef">
> > ...
> > </target>
> >
> > you might also try out
> > <property name="ant.reuse.loader" value="true"/>
> > at the beginning of your build script or set it in the ANT_OPTS 
> > environment variable via -Dant.reuse.loader=true
> >
> > maybe this solves your problem with duplicate taskdef. Regards
> > Rainer
> > (now offline until Monday but let me know whether it works)
> >
> >
> > > -----Original Message-----
> > > From: barry@goodconsultants.com [mailto:barry@goodconsultants.com]
> > > Sent: Saturday, April 03, 2004 11:48 PM
> > > To: rainer@noacks.net
> > > Subject: Re: how can i undeclare taskdef?
> > >
> > >
> > >
> > >
> > > Rainer,
> > >
> > > Thanks for your prompt reply.
> > >
> > > Would you please detail how i can make sure it is only run once?
> > >
> > > The problem also described in another post. I have the
> > > taskdef for JspC in a
> > > jspc target which resides in the dist target which all will
> > > depends on.
> > >
> > > When running "ant deploy" or "ant all", everythings fine.
> > > However, when
> > > running "ant all deploy" or "ant deploy deploy" then it
> > > becomes a problem.
> > >
> > > Please let me know how i can "run once" or doing it correctly.
> > >
> > > How can i use "ant.reuse.loader"?
> > >
> > > thanks
> > >
> > > Barry
> > >
> > >
> > >
> >
> >
> > 
> ---------------------------------------------------------------------
> > 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