ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ivan Ivanov <rambiusparkisan...@yahoo.com>
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
project.
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>

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

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 generic.properties, that will
conatain and define the mutual properties of your
projects.

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

--- "Mikael Petterson (KI/EAB)" 
<mikael.petterson@ericsson.com> 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:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



		
__________________________________
Do you Yahoo!?
New and Improved Yahoo! Mail - Send 10MB messages!
http://promotions.yahoo.com/new_mail 

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


Mime
View raw message