dcsimg
"if" like structure
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Luciano_Mantuaneli
Posted On:   Wednesday, June 14, 2006 03:54 PM

Hello! I'm trying to fail my build depending on a value returned by an java task, but i can't figure it out... I tried to use fail task and condition task but it prove to be useless, cuz the "if" atribute on fail task referes to the existence of an atribute, instead of its value... I jus't can't figure it out... My code follow... ... classname="${classname}" fork="true" outputproperty="user.response" failonerror="true"> Feature: "${featureJar}${featureJarIndex}.jar" Plugin: "${pluginJar}${pluginVersion}.jar" OW: "${over   More>>

Hello!


I'm trying to fail my build depending on a value returned by an java task, but i can't figure it out... I tried to use fail task and condition task but it prove to be useless, cuz the "if" atribute on fail task referes to the existence of an atribute, instead of its value... I jus't can't figure it out...


My code follow...


			
...


classname="${classname}"
fork="true"
outputproperty="user.response"
failonerror="true">






Feature: "${featureJar}${featureJarIndex}.jar"
Plugin: "${pluginJar}${pluginVersion}.jar"
OW: "${overwriteJar}"



arg1="${user.response}"
arg2="${endBuild}"/>


Build aborted by user...

...


Thanks in advance!


[]'s

   <<Less

Re: "if" like structure

Posted By:   Robert_Lybarger  
Posted On:   Wednesday, June 14, 2006 06:42 PM

... that would probably be okay, though, since the "condition" task is described in the manual to only actually set the property value should the condition evaluate to true, and not set the property value at all otherwise. I really don't like the behavior of this stuff either, and a similar (but different) thing bit me recently. Worst case is you could write a custom ant task if you can't get the "core" stuff to work. Still, from my understanding, your approach should work, so you might put some debugging "echo" tasks in a few places to make sure the values are what you think they are.
About | Sitemap | Contact