ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steven Newton" <snew...@standard.com>
Subject RE: The Elements of Ant Style
Date Mon, 22 Apr 2002 17:01:14 GMT
Is there a better way to have ant handle the copying of properties
files that are part of the build dependency than simply adding a
list of the files to copy?  Right now I have:
<target name="properties" description="copy properties and taglib definition files">
    <copy file="${srcdir}/transactions.properties"
          todir="${builddir}/classes"/>
    <!-- lots more lines like this one -->
</target>

Is there a better style recommendation for this sort of task?

Also, better notes on using the <available> tag to set up the 
build environment dynamically!

s

> -----Original Message-----
> From: Erik Hatcher [mailto:jakarta-ant@ehatchersolutions.com]
> Sent: Thursday, April 18, 2002 5:22 PM
> To: ant-dev; ant-user@jakarta.apache.org
> Subject: The Elements of Ant Style
> 
> 
> The Ant book that I'm co-authoring is entering its last phase 
> of development
> and we would like to involve the entire Ant community in our 
> efforts. The
> primary reason for doing this is because its fun and gives folks an
> opportunity to be a part of something we feel is very special.
> 
> One of our Appendices is titled "The Elements of Ant Style" 
> in honor of my
> most favorite Java book of all time, "The Elements of Java 
> Style". We want
> to make our Ant version similar in that it will be an 
> organized collection
> of Ant words of wisdom and little gems of advice to make our 
> build file
> writing that much better and elegant.  Here is an example:
> 
> - Build paths up from previously defined properties rather 
> than directly.
> 
> Don't do this:
>   <property name="build.dir" location="build"/>
>   <property name="build.classes" location="build/classes"/>
> 
> Do this instead:
>   <property name="build.dir" location="build"/>
>   <property name="build.classes" location="${build.dir}/classes"/>
> 
> Which would be followed by a brief explanation of why, which 
> in this case is
> so that you can override the value of build.dir and it will 
> in turn affect
> all subordinate mappings (and of course the subordinate 
> mappings could be
> reassigned individually if desired too in either case).
> 
> Here's what we are asking: Submit your gems of Ant wisdom 
> (they should be
> short and sweet, for the most part) to 
> antbook@ehatchersolutions.com or
> reply on the ant-user list. We will use our discretion for 
> which entries are
> accepted, and there are no promises that entries submitted 
> will be used. If
> you would NOT like your name attributed to the entry, please 
> state this in
> your submission, otherwise we will give you the attribution 
> (name only, not
> e-mail address) - be sure the name you want attributed is in 
> your e-mail
> header or stated in the text of your mail. The first to 
> submit a particula
> item (as there is likely to be duplication) wins.
> 
> The publisher posts complete sample chapters on their 
> website, and we will
> push to have this Appendix be one of them so that it is 
> freely available to
> the community - no promises as that is not within my direct 
> control though.
> 
>     Erik Hatcher
>     Steve Loughran
> 
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:ant-dev-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: 
> <mailto:ant-dev-help@jakarta.apache.org>
> 
> 

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


Mime
View raw message