ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Chalko <>
Subject Re: Import use cases, basedir behavior and target, property prefixing
Date Wed, 15 Jan 2003 20:34:54 GMT
Claas Thiele wrote:

> Costin Manolache wrote:
>> Nick Chalko wrote:
>>>> (2) linking subprojects in a large project
>>> I do not think (2) is a usecase for import.  I think it is better
>>> handled by the "ant" task.
>> I think (2) is an important usecase - at least for me.
>> If you use import, you can call any target you want from any
>> of the build files, reuse fragments and targets
>> from other build files, etc.
> Possible disadvantages of <ant> use:
> - cannot span dependencies to 'imported' targets
> - cannot access properties and data (i.e. xmlcatalogs, ...) of 
> 'imported' files
> Example for missing dependecy feature:
> Assuming some subprojects. Each subproject uses a common library to be 
> build before building the subproject.
> Calling the subprojects from main project via <ant> activates the 
> build of common lib for each subproject even it is not nessesary.

I would leave inter project depenencies to Gump, or some other tool.

I think use case 2 complicates import with providing enough to really 
handle what users want out of use case 2.

Let me try  to give a use case 2 example

<project name="main" >
    <import name="common/build.xml">  
    <import name="sub1/build.xml">
    <import name="sub2/build.xml">

    <target name = "compile" depends "sub1-build.compile, 
sub2-build.compile" />

<project name ="common>
      <target name="compile" />

<project name ="sub1">
      <target name="compile"  depends="common-build.compile,sub2.compile"/>

<project name ="sub2-build">
      <target name="compile"  depends="common.compile"/>

given this  case 2 would suggest
ant compile  
would execute  common-compile,  sub2-build.compile, sub1-build.compile

even getting this is not enough,  you still have to hangle classpath.
ant -f sub2/build.xml  
will fail unless you add
<import file="../"/>

There is to many complications for import to handle on it's own.  

Let another tool handle it.

Nick Chalko                                         Show me the code.
  Ant + autodownloadable build plugins + needed jars autodownload.

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

View raw message