ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bhatia Saurabh \(CHA\)" <saurabh.bha...@etat.ge.ch>
Subject Recovering the return code from the called build.xml into the calling build.xml
Date Thu, 24 Nov 2005 09:49:44 GMT
Dear Community,

My calling build.xml makes a call to a target defined in a different
build.xml and this target does an exec. I do get the return value from
this exec in the called build.xml but I am looking for a solution for
recovering this resultproperty="run-test.result" in the calling code so
that I can invoke other targets in my calling build.xml based on the
return code I got from the called build.xml. (e.g I would like to send
an email with success notification if the return code = 0 or a failure
email notification if the return code is anything but 0).

Really appreciate your solutions and thanking in advance.

Saurabh
 

Calling build.xml ------------------------

<macrodef name="test-exec">
      		<attribute name="module-1"/>		
      		<sequential>
         		<echo message="Test du module @{module-1}
(lancement target run-test)" />         		
         		<ant dir="${revue.dir}/@{module-1}"
target="run-test" />  
         		<!--
         		<condition property="run-test.result"
value="${run-test.result}">
         		</condition>
         		-->
         		<echo message="Status of task run-test is
${run-test.result}" />         		
        	</sequential>
        </macrodef>


Called build.xml ----------------------------


<target name="run-test" description="lancement du test unitaire">
   <echo message="lancement du test unitaire EvenementMetier!!" />
   <exec dir="J:/RefonteAFC/Proto1.4/EvenementMetier/testunitaire" 
         newenvironment="true" 
         executable="TestUnitaire_auto.bat" 
         resolveexecutable="true" 
         output="dir.txt" 
         resultproperty="run-test.result" 
         failonerror="false" 
         vmlauncher="true">                  
   </exec>
   <echo message="runtest return code = ${run-test.result}" />
  </target>



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