ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig R. McClanahan" <Craig.McClana...@eng.sun.com>
Subject Proposed Enhancement to "ant.bat" script
Date Mon, 04 Dec 2000 17:59:26 GMT
I'm evaluating the use of Ant's provided "ant" and "ant.bat" scripts in my own
build processes, rather than constructing a command line for Ant every time.
One key difference between the Unix and Windows versions of these scripts,
though, is that the Unix version supports a user customization script:

    if [ -f $HOME/.antrc ] ; then
        . $HOME/.antrc
    fi

In order to simulate this capability on the Windows platform, I propose that the
following line be added before Ant is actually executed:

    if exist "%HOME%\antrc_pre.bat" call "%HOME%\antrc_pre.bat"

and the following line after Ant is executed:

    if exist "%HOME%\antrc_post.bat" call "%HOME%\antrc_post.bat"

Why two scripts?  Because in the Unix case you typically set environment
variables that affect only the script that is currently running, whereas in
Windows the environment variables are essentially global.  Having two scripts
would let you set up (for example) a custom classpath in the antrc_pre.bat
script, and clean it up again in antrc_post.bat.

What do you think?

Craig McClanahan



Mime
View raw message