ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hagen, Christian" <cha...@init-ka.de>
Subject AW: AW: if / unless ... Misanderstanding or problem ... ?
Date Thu, 12 Aug 2004 11:15:25 GMT
Hi Thomas,

I guess, you know the difference of

    if="executed" 

and

    if="${executed}"?

In your case you check, whether the property named "true" is _set_.


Chris


> -----Ursprüngliche Nachricht-----
> Von: Thomas SMETS [mailto:tsmets@tsmets.lautre.net] 
> Gesendet: Donnerstag, 12. August 2004 13:04
> An: user@ant.apache.org
> Cc: Jan.Materne@rzf.fin-nrw.de
> Betreff: Re: AW: if / unless ... Misanderstanding or problem ... ?
> 
> So why do I see :
> 
>       run.2:
>             [echo] Hello 2
> I have no problem having 2.1 & 2.1 being executed...
> but I should not see  "Hello 2 " anyhow
> 
> \T,
> 
> 
> 
> 
> > Nothing went wrong, you´re only expecting another behaviour :-)
> >
> > 1. executed dependend targets
> > 2. evaluate if/unless
> > 3. execute the target according to step 2
> >
> > Thats because you´ll often have a construct like
> >
> > <target name="check">
> >    <condition property="ok"> ...
> > </target>
> > <target name="do" depends="check" if="ok">
> >    <echo> all ok</echo>
> > </target>
> >
> >
> > Jan
> >
> >
> >
> >
> >> -----Ursprüngliche Nachricht-----
> >> Von: Thomas SMETS [mailto:tsmets@tsmets.lautre.net] Gesendet am: 
> >> Donnerstag, 12. August 2004 12:56
> >> An: user@ant.apache.org
> >> Betreff: if / unless ... Misanderstanding or problem ... ?
> >>
> >>
> >> Here is my build file :
> >> <project name="Test"
> >> 		 default="run"
> >> 		 basedir=".">
> >>
> >>   <!-- set global properties for this build -->
> >>   <property file="build.properties"/>
> >>
> >>   <target name="run.1.1" >
> >>   	<echo>Hello 1.1</echo>
> >>   </target>
> >>
> >>   <target name="run.1.2"  >
> >>   	<echo>Hello 1.2 </echo>
> >>   </target>
> >>
> >>   <target name="run.2.1" >
> >>   	<echo>Hello 2.1</echo>
> >>   </target>
> >>
> >>   <target name="run.2.2"  >
> >>   	<echo>Hello 2.2 </echo>
> >>   </target>
> >>
> >>   <target name="run.1"
> >>   		  depends="run.1.1,run.1.2"
> >>   		  if="${exploded}">
> >>   	<echo>Hello 1 </echo>
> >>   </target>
> >>
> >>   <target name="run.2"
> >>   		  depends="run.2.1,run.2.2"
> >>   		  unless="${exploded}">
> >>   	<echo>Hello 2 </echo>
> >>   </target>
> >>
> >>
> >>   <target name="run"
> >>   		  depends="run.1,run.2" >
> >>   	<echo>Hello
> >>   		exploded = ${exploded} </echo>
> >>   </target>
> >> </project>
> >>
> >>
> >> In the "build.properties" files, I have only the following line :
> >>
> >> exploded = true
> >>
> >> Now the problemis that the outcome is the following :
> >> ant -buildfile Test.xml
> >> Buildfile: Test.xml
> >>
> >> run.1.1:
> >>      [echo] Hello 1.1
> >>
> >> run.1.2:
> >>      [echo] Hello 1.2
> >>
> >> run.1:
> >>
> >> run.2.1:
> >>      [echo] Hello 2.1
> >>
> >> run.2.2:
> >>      [echo] Hello 2.2
> >>
> >> run.2:
> >>      [echo] Hello 2
> >>
> >> run:
> >>      [echo] Hello
> >>      [echo]             exploded = true
> >>
> >> BUILD SUCCESSFUL
> >> Total time: 0 seconds
> >>
> >>
> >> JDK is the 1.4 provided with BEA 8.1
> >> ANT is 1.6.2
> >>
> >> Any hint in what goes wrong ... ?
> >>
> >> \T,
> >>
> >>
> >>
> >> --
> >> Thomas SMETS
> >> rue J. Wytsmanstraat 62
> >> 1050 Brussels
> >>
> >>
> >>
> >> 
> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For 
> >> additional commands, e-mail: user-help@ant.apache.org
> >>
> 
> 
> --
> Thomas SMETS
> rue J. Wytsmanstraat 62
> 1050 Brussels
> 
> 
> 
> ---------------------------------------------------------------------
> 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