ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <>
Subject Re: Advice on how to change buildfile structure
Date Fri, 09 Jul 2004 13:17:46 GMT
Hi Mikael, you my find these ideas useful:
1) Impose realtively unified directory structure for
your projects, say your project sources are in
<project-root>/src directory, compiled classes are in
<project-root>/bin directory, third party jars are in
<project-root>/lib and the distributions of the
projected will be made in <project-root>/dist, where
<project-root> is the upper folder of your concrete
2) Create for example a generic.xml that will contain
your "universal target":
<project name="generic" basedir="." default="usage">
    <target name="usage">
    <!-- Usage instructions here -->

    <target name="-init" description="Initializes
neede d proeprties and taskdefs">
        <property name="project.src"
        <property name="project.classes"
        <property name="project.lib"
    <target name="compile" depends="-init">
        <javac srcdir="${project.src}
            <claspath ....>
    <target name="jar" depends="compile">
    <target name="dist" depends="jar"
description="Create distribution">

3) Import this file in the other projects with
<import> . Now you will have compile, jar and dist
targets in your projects automatically.

Note: If you have a rich variety of projects using
rich variety of technlogies, you may find difficult to
unify their  file structure. You can use then a
property file, say, that will
conatain and define the mutual properties of your

HTH Ivan.
P.S. I am eager to see other's people opnion too.

--- "Mikael Petterson (KI/EAB)" 
<> wrote:
> Hi,
> I have a 4 buildfiles to build different
> subproducts. However I have found out that it is
> costly to update each one of the every time a 
> change ocurrs in e.g. compile target. I wish to have
> a generic compile, jar, init..... target that I can
> use in each build.
> Any hints on how I can do this? All pointers and
> suggestions are very much welcome!!
> Mikael 
> To unsubscribe, e-mail:
> For additional commands, e-mail:

Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages! 

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message