ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rebhan, Gilbert" <Gilbert.Reb...@huk-coburg.de>
Subject RE: Checking whether a property is set
Date Fri, 09 Nov 2007 11:39:09 GMT
 
-----Original Message-----
From: Rob Wilson [mailto:netplay@gmail.com] 
Sent: Friday, November 09, 2007 12:22 PM
To: Ant Users List
Subject: Checking whether a property is set

/*
I can check whether a file exists and set a property, but can I check
whether a property exists and set a property based on whether it
exists?

I don't mind how this is checked, I just need to make sure that my
JUnit test stops if the property isn't set.
*/

you can call  your target with unless

<target name="runJUnit" unless="yourproperty">
...

so it runs only when yourproperty is not set

also possible =
<target name="runJUnit">
<if> 
  <isset property="yourproperty"/> ...
  <then>
  ...
  </then>
  <else>
 ...
  </else>
</if>
</target>



Regards, Gilbert



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message