ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chris Winters <>
Subject Re: Typical Usage Question
Date Fri, 23 Feb 2001 22:08:56 GMT
* Spencer A Marks ( [010223 16:30]:
> What's better:
> -Call ant from a script that sets up the environment for ant (e.g. the
> classpath, other environment variable)
> -Call Ant directly and let build.xml be responsible for setting
>  everything up correctly. (e.g. the classpath)

Since developers here use Win32 and Unix machines I always try to make
as few assumptions as possible about the environment.

> How do people manage to keep build.xml (and any other wrapper files,
> if that is the recommended way to go) under source code control and
> still have site specific configurations available.

As a couple other people mentioned, a property file is the way to
go. But I'll be a little more concrete:

In a build.xml file, we'd typically have something like:

 	<property file="${user.home}/.readi/"/>

Since the ${user.home} environment variable is determined by Java
rather than Ant, and because it is available on Win32 (at least
Win2000) and Unix, it gives us someplace to start.

In that file, we have such items as:


And then in the build.xml we use these as such:


    <property name="deploy"            value="${jboss}/deploy"/>


     <copy tofile="${build}/${bean_client_file}"

Since it's centralized and many of the properties overlap, we use the
same property file for multiple projects (and multile build.xml

This has worked very well so far, and we make no assumptions regarding
the environment beyond the bare necessities (XML parser and the like).

Hope this was helpful.


View raw message