You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Jesse Stockall <je...@cryptocard.com> on 2002/06/20 21:21:43 UTC

Fail task's if and unless do not seem to work like other tasks

Hi

I'm using ant 1.5 beta 2 with 1.3.1 on Linux and Win2000

Here is the build snipit

<target name="available" depends="tdefs, properties">
    <condition property="PCSC">
        <available classname="com.cryptocard.jpcsc.Card">
     	    <classpath location="${classes}"/>
	</available>
     </condition>
     <fail 
	message="com.cryptocard.jpcsc.PCSC must be compiled first"
	unless="${PCSC}"
     />
</target>

This is the debug output

available:
Finding class com.cryptocard.jpcsc.Card
Class java.lang.Object loaded from parent loader
Class com.cryptocard.jpcsc.Card loaded from ant loader
Class java.lang.Throwable loaded from parent loader
Class java.lang.ArrayIndexOutOfBoundsException loaded from parent loader
Finding class com.cryptocard.jpcsc.PCSCException
Class java.lang.RuntimeException loaded from parent loader
Class com.cryptocard.jpcsc.PCSCException loaded from ant loader
Class java.lang.NullPointerException loaded from parent loader
Condition true; setting PCSC to true
Setting project property: PCSC -> true

BUILD FAILED
/home/jesse/source/6.0/src/cpp/utilities/jpcsc/build.xml:81:
com.cryptocard.jpcsc.PCSC must be compiled first


The property is set but the Fail task is being run.

I also tried Stephan's Gump build from today with the same results.

Ideas?

-- 
 Jesse Stockall			|	Tel: 1+ 613.599.2441 ext. 243
 CRYPTOCard Corporation		|	Fax: 1+ 613.599.2442	 	
 Suite 304, 300 March Rd.	|	email: jesse@cryptocard.com
 Ottawa, ON, Canada K2K 2E2	|	web: www.cryptocard.com 
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Fail task's if and unless do not seem to work like other tasks

Posted by Jesse Stockall <je...@cryptocard.com>.
On Thu, 2002-06-20 at 15:30, Diane Holt wrote:
> Whenever the name of a property is being asked for, not the value, just
> use the name itself, without enclosing it in "${}". (In other words, your
> <fail> was running because you don't have a property named (literally)
> ${PCSC} set -- you have a property named PCSC set.


Thanks Diane

As usual you were right (and quick too).


-- 
 Jesse Stockall			|	Tel: 1+ 613.599.2441 ext. 243
 CRYPTOCard Corporation		|	Fax: 1+ 613.599.2442	 	
 Suite 304, 300 March Rd.	|	email: jesse@cryptocard.com
 Ottawa, ON, Canada K2K 2E2	|	web: www.cryptocard.com 
---------------------------------------------------------------------


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Fail task's if and unless do not seem to work like other tasks

Posted by Diane Holt <ho...@yahoo.com>.
--- Jesse Stockall <je...@cryptocard.com> wrote:
>      <fail 
> 	message="com.cryptocard.jpcsc.PCSC must be compiled first"
> 	unless="${PCSC}"

Whenever the name of a property is being asked for, not the value, just
use the name itself, without enclosing it in "${}". (In other words, your
<fail> was running because you don't have a property named (literally)
${PCSC} set -- you have a property named PCSC set.

Diane

=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>