ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Spencer A Marks <>
Subject Typical Usage Question
Date Fri, 23 Feb 2001 21:36:17 GMT
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)

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. 

For example, when you have to an absolute path (which could vary from machine to
machine) how do you generate / set this variable correctly. 

I'll illustrate my questions, by explaining how I'd solve this problem
with make. (note: I find the follow solution far too cumbersome; I am
hoping make has a more elegant equivalent.)

Using make, I'd call sed and do a search replace
on a specific token that where place holders for specific info. For
example, say I need to define a temp directory on a per machine

In a script I'd have "USER_TEMP_DIR/foo/fum/" and make would call sed
and replace USER_TEMP_DIR with the correct value from an environment
variable. At some point the user has to specify
USER_TEMP_DIR="/home/sam/tmp/" or something like that. 

Typically, I'd have a profile for each target machine also in source
code control. That target profile would be created and editted once (typically)
and in it I'd define USER_TEMP_DIR= for the particular host. make
would include that host file and USER_TEMP_DIR= would be included in
the environment correctly. 

While this method gets the job done, it is cumbersome and platform

I guess I am wondering how are similar problems are solved with Ant?

Thanks, Spencer

View raw message