You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Eric Roberts <er...@tacc.utexas.edu> on 2004/08/03 19:02:12 UTC

problem using task

Hi 

 

I am having trouble getting the <fail/> task to work correctly for me.
I have the follow block of code:

 

 

<target>

    ...

<condition property="portlet-exists">

            <available file="${portlet.dir}/${app.name}/build.xml"/>

</condition>

 

<fail if="${portlet-exists}" message="The portlet already exists"/>

    ...

</target>

 

 

This code never fails even if the file specified above exists.  I have
tried using the "unless" attribute of <fail/> but that ALWAYS fails.  Am
I misunderstanding something?

 

Any help would be greatly appreciated.

 

--Eric

 

 

 


Re: problem using task

Posted by Peter Reilly <pe...@apache.org>.
You need to do <fail if="portlet-exist" message=" .. "/>

i.e. the name of the property and not the value of the property.

Peter
Eric Roberts wrote:

>Hi 
>
> 
>
>I am having trouble getting the <fail/> task to work correctly for me.
>I have the follow block of code:
>
> 
>
> 
>
><target>
>
>    ...
>
><condition property="portlet-exists">
>
>            <available file="${portlet.dir}/${app.name}/build.xml"/>
>
></condition>
>
> 
>
><fail if="${portlet-exists}" message="The portlet already exists"/>
>
>    ...
>
></target>
>
> 
>
> 
>
>This code never fails even if the file specified above exists.  I have
>tried using the "unless" attribute of <fail/> but that ALWAYS fails.  Am
>I misunderstanding something?
>
> 
>
>Any help would be greatly appreciated.
>
> 
>
>--Eric
>
> 
>
> 
>
> 
>
>
>  
>


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