ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jochen Hagenstroem <jochen.hagenstr...@adobe.com>
Subject Re: fail if a property ( p4.needsresolve ) is set
Date Thu, 19 Aug 2004 14:55:34 GMT
Thank you all.

I solved my proplem using the intermediate property approach:
		<condition property="dofail">
			<equals arg1="${p4.needsresolve}" arg2="1" />
		</condition>
		<antcall target="revert" /> <!-- only reverts if="dofail"  -->
		<fail message="Submit failed! Either one or both of the files 
'ARMVer.h' and 'gen_version.h' need to be resolved before submission." 
if="dofail" />

	<target name="revert" if="dofail">
		<p4revert view="//myproject/..." change="${p4.change}" />
	</target>

This also allows to call a conditional "p4 revert". I'm happy because 
it solves my problem. I don't like the resulting code very much but I 
still perfer it over using ant-contrib.sourceforge.net-additions 
because I have to stick to pure ant-1.6.1

Thanks again. great list! :)

jacques


On Aug 18, 2004, at 21:46, Matt Benson wrote:

> I have an unreasonable aversion to intermediate
> properties.
>
> -Matt
>
> --- Doug Lochart <dlochart@capecomputing.com> wrote:
>
>> Thanks for the 1.6.2 shortcut update,  those are
>> always welcome =)
>>
>> 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: "Matt Benson" <gudnabrsam@yahoo.com>
>> To: "Ant Users List" <user@ant.apache.org>
>> Sent: Wednesday, August 18, 2004 3:38 PM
>> Subject: Re: fail if a property ( p4.needsresolve )
>> is set
>>
>>
>>> 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
>>>>>
>>>>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message