ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <>
Subject Re: want a sub task with <ant dir="../.." to fill in properties in calling project
Date Sat, 23 Aug 2003 17:30:06 GMT
the ant task does not have currently the ability to return properties or
The import task might be what you are looking for.
import is really like an include of another build.xml file; you can call
targets of the imported build.xml file just like normal targets.

so you can have your common.xml somewhere, and then have
projectxyz/build.xml looking like that

<project name="xyz">
<!-- common.xml contains the init target -->
<!-- resolution of import files is done relative to the dir of the importing
file -->
<import file="../common.xml"/>
<target name="compile" depends="init">
    <!-- init in ../common.xml will be invoked before compile is
executed -->
    <!-- your tasks here -->

----- Original Message -----
From: "Adam Hardy" <>
To: <>
Sent: Saturday, August 23, 2003 7:20 PM
Subject: want a sub task with <ant dir="../.." to fill in properties in
calling project

> I have around ten projects and I have a couple of tasks that are common
> to all of them.
> One of these is the init task which does alot of property setting, for
> instance for the deploy directories or the classpath refid.
> I would like to have my init task in a single build.xml and call that
> from each project's build.xml.
> I'm trying this with the ant task, but the properties and refids that
> the subproject sets are lost when the subproject is finished, and the
> main project can't access them.
> Is there a way of letting the main project see the settings that are
> defined in the subproject?
> thanks
> Adam
> --
> ant 1.6alpha + java 1.4.2 on Linux 2.4.20 RH9

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

View raw message