ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ken Liu" <k...@auctionlogic.com>
Subject RE: Immutable Properties in 1.1?
Date Thu, 20 Jul 2000 20:31:51 GMT
Roger,

I did actually take Glenn's advice this morning (thanks Glenn!) and modified
his XSL stylesheet example to redo my build file.  However, the change made
my build file is IMHO not a good thing:

BEFORE:
<!-- AuctionManager target -->
<target name="AuctionManager.compile" depends="init,TXManager.interface">
	<property name="ejb.basedir" value="com\auctionlogic\auction"/>
	<property name="ejb.basename" value="AuctionManager"/>
	<property name="ejb.includes" value="*.java"/>
	<ant antfile="${include.dir}/ejb-build.xml" dir="." target="ejb.compile"/>
</target>
<target name="AuctionManager.build" depends="init,AuctionManager.compile">
	<property name="ejb.basedir" value="com\auctionlogic\auction"/>
	<property name="ejb.basename" value="AuctionManager"/>
	<ant antfile="${include.dir}/ejb-build.xml" dir="."
target="ejb.descriptor"/>
	<ant antfile="${include.dir}/ejb-build.xml" dir="."
target="ejb.container"/></target>



AFTER:
<!-- AuctionManager target -->
<target name="AuctionManager.compile" depends="init,TXManager.interface">
	<ant antfile="${include.dir}/ejb-build.xml" dir="." target="ejb.compile">
		<property name="ejb.basedir" value="com\auctionlogic\auction"/>
		<property name="ejb.basename" value="AuctionManager"/>
		<property name="ejb.includes" value="*.java"/>
	</ant>
</target>
<target name="AuctionManager.build" depends="init,AuctionManager.compile">
	<ant antfile="${include.dir}/ejb-build.xml" dir="."
target="ejb.descriptor">
		<property name="ejb.basedir" value="com\auctionlogic\auction"/>
		<property name="ejb.basename" value="AuctionManager"/>
	</ant>
	<ant antfile="${include.dir}/ejb-build.xml" dir="." target="ejb.container">
		<property name="ejb.basedir" value="com\auctionlogic\auction"/>
		<property name="ejb.basename" value="AuctionManager"/>
	</ant>
</target>



So you can see that nesting the properties in the <ant> tag potentially
creates more work for me from a maintenance standpoint because now I have
two sets of identical properties for each target.  It's also more difficult
to read.  Yes, its a Bad Thing.

Basically what I want is not necessarily mutable properties...I just need a
way to create variables so I can parameterize a reusable section of build
code.  Yes, subroutines for Ant.  Any suggestions?

BTW, the problem I see with using templated targets ala Jesse's patch is
that it would be difficult to define different "depends" for each different
target, no?

Ken


Mime
View raw message