avalon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leif Mortenson <l...@silveregg.co.jp>
Subject Requested change to build.bat files.
Date Thu, 13 Dec 2001 03:02:29 GMT
Currently, if you run build in the jakarta-avalon project, the build.bat
script will set the AVALON_TOOLS environment variable to "tools". If I
then cd to the jakarta-avalon-phoenix project, and run the build.bat
script there, the AVALON_TOOLS script will already be set to "tools" so
the script will fail.

Here are two possible changes to build.bat that will each fix the problem:
1) Restore the original value of AVALON_TOOLS when the script completes.
This script also recovers nicely if the value of AVALON_TOOLS gets confused.
--------------------
@echo off

echo ------------
echo Build System
echo ------------

set OLD_AVALON_TOOLS=%AVALON_TOOLS%

if "%AVALON_TOOLS%"=="" goto findTools
if exist "%AVALON_TOOLS%" goto runAnt
echo The value of AVALON_TOOLS was not valid: %AVALON_TOOLS%
echo Looking for the tools directory...

set AVALON_TOOLS=
set OLD_AVALON_TOOLS=

:findTools

if exist "..\jakarta-avalon\tools\bin\ant.bat" set
AVALON_TOOLS=..\jakarta-avalon\tools
if exist "tools\bin\ant.bat" set AVALON_TOOLS=tools

if not "%AVALON_TOOLS%"=="" goto runAnt

echo "Unable to locate tools directory at "
echo "../jakarta-avalon/tools/ or tools/. "
echo "Aborting."
goto end

:runAnt
set ANT_HOME=%AVALON_TOOLS%
call %AVALON_TOOLS%\bin\ant.bat -logger
org.apache.tools.ant.NoBannerLogger -emacs -Dtools.dir=%AVALON_TOOLS% %1
%2 %3 %4 %5 %6 %7 %8

:end

set AVALON_TOOLS=%OLD_AVALON_TOOLS%
set OLD_AVALON_TOOLS=
--------------------

2) Switch the order of the statements that look for the tools dir. This
way the version that will work in all the projects will be preferred.
--------------------
@echo off

echo ------------
echo Build System
echo ------------

if not "%AVALON_TOOLS%"=="" goto runAnt

if exist "tools\bin\ant.bat" set AVALON_TOOLS=tools
if exist "..\jakarta-avalon\tools\bin\ant.bat" set
AVALON_TOOLS=..\jakarta-avalon\tools

if not "%AVALON_TOOLS%"=="" goto runAnt

echo "Unable to locate tools directory at "
echo "../jakarta-avalon/tools/ or tools/. "
echo "Aborting."
goto end

:runAnt
set ANT_HOME=%AVALON_TOOLS%
%AVALON_TOOLS%\bin\ant.bat -logger org.apache.tools.ant.NoBannerLogger
-emacs -Dtools.dir=%AVALON_TOOLS% %1 %2 %3 %4 %5 %6 %7 %8

:end
--------------------

Thanks,
Leif



--
To unsubscribe, e-mail:   <mailto:avalon-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:avalon-dev-help@jakarta.apache.org>


Mime
View raw message