ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sco...@javactivity.org
Subject "macrodef" for nested elements
Date Thu, 28 Apr 2005 15:18:16 GMT
I would like a way to reduce the boilerplate load in a situation such as
this:

	    <tar destfile="${build.root}/statics.tar">
	        <tarfileset dir="${build.root}/images" prefix="images"
	                          username="myuser" group="mygroup" mode="664"
dirmode="775"/>
	        <tarfileset dir="${build.root}/styles" prefix="styles"
	                          username="myuser" group="mygroup" mode="664"
dirmode="775"/>
	        <tarfileset dir="${build.root}/userguide" prefix="userguide"
	                          username="myuser" group="mygroup" mode="664"
dirmode="775"/>
	        <tarfileset dir="${build.root}/tutorial" prefix="tutorial"
	                          username="myuser" group="mygroup" mode="664"
dirmode="775">
	            <include name="*.swf"/>
		</tarfileset>
	        <tarfileset dir="$" 
	            username="myuser" group="mygroup" mode="664"
dirmode="775"/>
           </tar>

As you can see, all but one of the attributes of the tarfileset nested
elements are boilerplate, repeated at every instance, but there is no
way to default these.   I thought <macrodef> might provide some help
here, but it doesn't, since macrodef only provides bits of runnable
tasks, not nested sets of attributes.  A less flexible alternative,
still preferable to the above, would be to provide default values for
the nested elements in the outer <tar> task.  <tar> doesn't, at
present, provide this functionality.  That might be doable through
macrodef, but does macrodef allow variable numbers of nested elements?




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


Mime
View raw message