ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Steve Loughran" <stev...@iseran.com>
Subject Re: Scaling to large projects
Date Tue, 04 Feb 2003 01:00:54 GMT

----- Original Message -----
From: "David McTavish" <dmctavish@SANDVINE.com>
To: "'Ant Users List'" <ant-user@jakarta.apache.org>
Sent: Monday, February 03, 2003 13:35
Subject: RE: Scaling to large projects



>
> What I was referring in my original email is when you have a project that
> relies on code you have developed in another project. (ie: maven depends
on
> ant). You could either:

> a) have a static binary from project A in the lib folder of project B

I have project B refer to the version in the dist dir of project A, usually.
Unless I want to decouple builds so that B1.12 runs against  A1.0 even while
A1.1 is being coded.

> b) dynamically compile and build the library in project A as part of the
> build process of project B.

The trick there is in the toplevel build file

-each sub project has its own targe that calls <ant> down to the proejct

-these targets state their dependencies

-so builds from the top do stuff in the right order.

Example:

  <target name="axis" depends="init" if="axis.src.found">
    <ant dir="${axis.home}" target="compile" inheritAll="false">
    </ant>
  </target>

   <target name="client" depends="init,axis">
     <ant dir="client" target="${target}" inheritAll="false">
       <property name="dist.dir" value="${dist.dir}"/>
     </ant>
   </target>

  <target name="server" depends="init,axis">
    <ant dir="server" target="${target}" inheritAll="false">
      <property name="dist.dir" value="${dist.dir}"/>
    </ant>
  </target>

   <target name="-all" depends="client,server">
   </target>

Then you have targets that call these with the target property set up
right:-


  <target name="dist">
    <antcall target="-all">
      <param name="target" value="default"/>
    </antcall>
  </target>



Mime
View raw message