ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Knuplesch, Juergen" <Juergen.Knuple...@icongmbh.de>
Subject AW: ant global properies (variable)
Date Thu, 28 Aug 2008 07:02:10 GMT
Am I right, that you use foreach from Antcontrib?

I guess that foreach does a usual ant task. This task never returns any properties to the
caller. It works only in one direction.

You could use the antcontrib for-Task combined with the antcontrib AntFetch Task.
In AntFetch (and antcallback) you can set the attribute "return ":

Example from teh antcontrib docu:
 <antfetch dir="${image.project} target="fillImageDirectory" return="image.directory"/>
    <echo>${image.directory}</echo>

Greetings


-- 
J├╝rgen Knuplesch                    
-----Urspr├╝ngliche Nachricht-----
Von: mindspin311 [mailto:connoc.mindspin@gmail.com] 
Gesendet: Mittwoch, 27. August 2008 19:58
An: user@ant.apache.org
Betreff: Re: ant global properies (variable)


Here's a simple version of what I'm trying to do.


<target name="test">
  <foreach list="${files}"
	          		delimiter=" "
	          		param="file"
	          		target="parse"
	          		trim="true"
	          		inheritall="true" />

  <echo message="unit.test.failure" /> <!-- Always false even when set to true in
parse!!!!! -->
  <!-- I want a conditional to be here that causes a failure iff there was one or more
failed unit tests (i.e. unit.test.failure is set to true -->

</target>



  
<target name="parse">
  <exec dir="." executable="phpunit" failonerror="false" 
  		  resultproperty="unit.test.failure.code">
  	  	<arg line="--log-xml bamboo-log-${basefile}.xml ${basefile} ${file}"
/>
  </exec>

  <if>
      <not>
        <equals arg1="${unit.test.failure.code}" arg2="0" />
      </not>
      <then>
		<property name="unit.test.failure" value="true" />
      </then>
      <else>
    	<echo message="THIS TEST SUCCEEDED" />
      </else>
    </if>
</target>
--
View this message in context: http://www.nabble.com/ant-global-properies-%28variable%29-tp19184177p19186036.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


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


Mime
View raw message