ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Benson <gudnabr...@yahoo.com>
Subject Re: fail if a property ( p4.needsresolve ) is set
Date Wed, 18 Aug 2004 19:38:22 GMT
To set the pseudo-property Doug described, you don't
really need another target.  You can use the following
within a target:

<condition property="dofail">
  <equals arg1="${p4.needresolve}" arg2="1" />
</condition>
<fail if="dofail" />

Beginning with Ant 1.6.2, the following shortcut is
available:

<fail>
  <condition>
    <equals arg1="${p4.needresolve}" arg2="1" />
  </condition>
</fail>

HTH,
Matt

--- Doug Lochart <dlochart@capecomputing.com> wrote:

> The "if" test merely tests for the existence of a
> property, not its value.
> You will need to restructure your build a bit to
> either only set/unset the
> property as needed or have another target that sets
> a pseudo property if the
> value of p4.needresolve is a 1 and then have "fail"
> test the pseudo
> property.
> 
> You can also use the ant-contrib "if" task
> 
> doug
> 
> 
> Now I've gained some understanding
> Of the only world that we see.
> Things that I once dreamed of
> Have become reality.
> 
> These walls that still surround me
> Still contain the same old me,
> Just one more who's searching for
> A world that ought to be.
> ----- Original Message ----- 
> From: "jacques couzteau" <lists@bitfaeule.net>
> To: "Ant Users List" <user@ant.apache.org>
> Sent: Wednesday, August 18, 2004 3:28 PM
> Subject: fail if a property ( p4.needsresolve ) is
> set
> 
> 
> > Hi all,
> >
> > here is a simple qustion:
> >
> > I want my ant target to fail if a given property
> is set. to be more
> > precise, I want my target to fail if my last
> submit to my
> > perforce-depot has failed because a file needed to
> be resolved. In that
> > case i can see that a file needed to resolve
> because the property
> > 'p4.needsresolve' is set to 1.
> >
> > What i had in mind was the following:
> >
> > <fail message="Submit failed! Either one or both
> of the files
> > 'ARMVer.h' and 'gen_version.h need to be resolved
> before submission.'"
> > if="p4.needsresolve" />
> >
> > Unfortunately  the fail task is executed no matter
> what p4.needsresolve
> > is set to.
> >
> > How can I accomplish my goal?
> >
> >
> > tia
> >
> > jacques
> >
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
Yahoo! Mail is new and improved - Check it out!
http://promotions.yahoo.com/new_mail

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


Mime
View raw message