ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Li, Jerry" <Jerry...@WorldChain.com>
Subject RE: Including a common build file with common targets.
Date Mon, 15 Oct 2001 16:13:51 GMT
I have put all my common targets into build_cfg.xml, and call it in my local
build.xml as the following:

<project default="compile" basedir=".">

<!-- =================================================================== -->

<!-- Initialization target -->

<!-- =================================================================== -->

<target name="init">

<tstamp/>

<property environment="ENV"/>

<property name="ANTCONF_DIR" value="${ENV.WORK_DIR}/src"/>

<property name="SRC" value="${user.dir}"/>

</target>

<!-- =================================================================== -->

<!-- Compiles the source directory -->

<!-- =================================================================== -->

<target name="compile" depends="init">

<ant antfile="${ANTCONF_DIR}/build_cfg.xml" target="compile"/>

</target>

</project>

 

Please note that I am using the ENV to specify where my build_cfg.xml.

jerry

-----Original Message-----
From: Albertus Vermeulen [mailto:AlbertusV@meb.co.za]
Sent: Monday, October 15, 2001 8:58 AM
To: 'ant-user@jakarta.apache.org'
Subject: Including a common build file with common targets.



Hi, 

I'm new to Ant and would like to move our current Makefiles to Ant. I have a
requirement to be able to include common properties and targets from a
shared file.

In the archives&faq I have seen recommendations to use a command of the
following syntax: 

<!DOCTYPE project [<!ENTITY common SYSTEM " file:./common.xml
<file:./common.xml> ">]> 

Unfortunately for me I don't have a fixed location for the common.xml file.
I need to use an environment variable to specify the location (i.e.
something like: file:$ <file:$> {SOME_DIR}/common.xml )and therefor the
above doesn't work for me.

Using <property environment="ENV"/> I can access environment properties from
a shared location but unfortunately not the common targets I need. 

<property file="${ENV.DEVELOP_HOME}/tools/make/.antproperties"/> 

Does anyone have some ideas? I saw someone mention the Jakarta-Taglibs
project, but I could not see where any files made reference to the
common.xml file ?

Any help would be greatly appreciated. 

Albertus 


-------------------------------------------------------------------------- 
Note:  The information contained in this message may be privileged and
confidential and protected from disclosure. If the reader of this message is
not the intended recipient, or an employee or agent responsible for
delivering this message to the intended recipient, you are hereby notified
that any dissemination, distribution or copying of this communication is
strictly prohibited. If you have received this communication in error,
please notify us immediately by replying to the message and deleting it from
your computer. Thank you. 
--------------------------------------------------------------------------

Mime
View raw message