ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "John Birtley" <John.Birt...@apollosoft.net>
Subject RE: Passing a property from sub project to main project
Date Sun, 27 Jul 2003 20:13:05 GMT
We encountered a similar problem (multie sub-projects all having to hang
off a master build) and solved the problem by having all of the
sub-projects in subscripts, but only at the <target>...</target> level,
and then using XML-level includes.

Not only did this take care of `passing' properties between subtasks and
the main task, but it also took care of dependencies in the sub-projects
- making sure each target was only invoked once.

Another added bonus of doing this is that it allows you to build up
`libraries' of reusable tasks that you can just cut and paste the entity
references into build scripts.

As an example:

	build.xml

		<project name="foo" basedir="." Default="all">

		<!--
		 ! XML entity references for the subscripts
		 ! -->			
		<!DOCTYPE project [
			<!ENTITY SubProject1 SYSTEM
"subscripts/subproject1.xml">
			<!ENTITY SubProject2 SYSTEM
"subscripts/subproject2.xml">
		]>

			<!--
			 ! Include the sub-projects
			 ! -->			
			&SubProject1;
			&SubProject2;

			<target name="all" depends="sub1, sub2">
			</target>
		</project>


	subscripts/subproject1.xml:
		<target name="sub1">
		</target>


	subscripts/subproject2.xml:
		<target name="sub2">
		</target>



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


Mime
View raw message