The sub-task (build.xml) can write a property file (<echo file="tmp.properties" message="key=value"/>) wich the super-task (ci-build.xml) can read AFTER calling.
ci-build.xml <property name="tmp.file" value="tmp.properties"/> <ant target="xy"> <property name="tmp.file" value="${tmp.file}" /> </ant> <property file="${tmp.file}" /> <echo>SubTask has set ${result}</echo> build.xml <target name="xy"> <echo file="${tmp.file}" message="result=42" /> </target> Jan Matčrne (sorry, I´ve forgotten my name :-) -----Ursprüngliche Nachricht----- Von: Dave Draper [mailto:[EMAIL PROTECTED]] Gesendet am: Dienstag, 14. Januar 2003 22:29 An: 'Ant Users List' Betreff: RE: passing of properties from a child ant task to its parent If you are using <antcall> the answer is no. Targets executed via <antcall> have their own environment and property space and anything modified or set is NOT passed backed or returned to the "calling" target. I have seen <propertyfile> used to write out the updated values of properties and then when execution is returned to the calling target it opens the property file and reads the updated and new values. - Dave -----Original Message----- From: Ralph Jocham [mailto:[EMAIL PROTECTED]] Sent: Tuesday, January 14, 2003 16:21 To: [EMAIL PROTECTED] Subject: passing of properties from a child ant task to its parent Hi, I have 2 differnt build files -- one is a general one (build.xml) and the other is used by CruiseControl (ci-buld.xml). The ci-build.xml mainly uses the build.xml file with <ant> calls. This works fine but now I have the following situation. The targets to run junit tests are in build.xml. They are set to create a propery (junit.failure, junit.error) if a failure or error occurs. This happens in the bounds of the build.xml. When I test with <fail if="junit.error" message="error"/> in the ci-build.xml it is not set, though an error has happened. My question is, are created properties from the child ant task being passed back to the parent task??? Thanks, Ralph __________________________________________________ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>