[seam-commits] Seam SVN: r9401 - trunk.
seam-commits at lists.jboss.org
seam-commits at lists.jboss.org
Thu Oct 23 14:53:05 EDT 2008
Author: dan.j.allen
Date: 2008-10-23 14:53:05 -0400 (Thu, 23 Oct 2008)
New Revision: 9401
Modified:
trunk/seam.bat
Log:
JBSEAM-3585 (sub-issue 2)
Modified: trunk/seam.bat
===================================================================
--- trunk/seam.bat 2008-10-23 18:50:06 UTC (rev 9400)
+++ trunk/seam.bat 2008-10-23 18:53:05 UTC (rev 9401)
@@ -1,35 +1,52 @@
@echo off
@if not "%ECHO%" == "" echo %ECHO%
- at if "%OS%" == "Windows_NT" setlocal
+ at if "%OS%" == "Windows_NT" setlocal
set WORKING_DIR=%CD%
-set SEAM_DIR=%~dp0
-if "%SEAM_DIR:~-1%" == "\" set SEAM_DIR=%SEAM_DIR:~0,-1%
-set SEAM_GEN_DIR=%SEAM_DIR%\seam-gen
+if "%WORKING_DIR:~-1%" == "\" (
+ set WORKING_DIR=%WORKING_DIR:~0,-1%
+)
+
+if ["%SEAM_HOME%"] == [""] (
+ set SEAM_HOME=%~dp0
+) else (
+ if not exist "%SEAM_HOME\seam" (goto noseam)
+)
+if "%SEAM_HOME:~-1%" == "\" (
+ set SEAM_HOME=%SEAM_HOME:~0,-1%
+)
+
+set SEAM_GEN_DIR=%SEAM_HOME%\seam-gen
set COMMAND=%1%
-set ARGS=%*
+echo Location of seam script: %SEAM_HOME%
+echo seam-gen template folder: %SEAM_GEN_DIR%
+
if [%COMMAND%] == [] (goto usage)
if %COMMAND% == help (goto help)
-if ["%JAVA_HOME%"] == [] (goto nojava)
+if ["%JAVA_HOME%"] == [""] (goto nojava)
if not exist "%JAVA_HOME%\bin\javac.exe" (goto nojdk)
-java -cp "%JAVA_HOME%\lib\tools.jar;%SEAM_DIR%\build\lib\ant-launcher.jar;%SEAM_DIR%\build\lib\ant-nodeps.jar;%SEAM_DIR%\build\lib\ant.jar" -Dant.home="%SEAM_DIR%\lib" org.apache.tools.ant.launch.Launcher -buildfile "%SEAM_GEN_DIR%\build.xml" -Dworking.dir=%WORKING_DIR% %ARGS%
+java -cp "%JAVA_HOME%\lib\tools.jar;%SEAM_HOME%\build\lib\ant-launcher.jar;%SEAM_HOME%\build\lib\ant-nodeps.jar;%SEAM_HOME%\build\lib\ant.jar" -Dant.home="%SEAM_HOME%\lib" org.apache.tools.ant.launch.Launcher -buildfile "%SEAM_GEN_DIR%\build.xml" -Dworking.dir="%WORKING_DIR%" %*
goto END_NO_PAUSE
:nojava
echo The JAVA_HOME environment variable is not set
-echo Please point it to a valid JDK installation
+echo Please point it to a JDK installation
goto END_NO_PAUSE
:nojdk
echo The JAVA_HOME environment variable should point to a JDK, not a JRE
goto END_NO_PAUSE
+:noseam
+echo The SEAM_HOME environment variable should point to a Seam distribution
+goto END_NO_PAUSE
+
:usage
more %SEAM_GEN_DIR%\USAGE
goto END_NO_PAUSE
@@ -38,4 +55,4 @@
more %SEAM_GEN_DIR%\README
goto END_NO_PAUSE
-:END_NO_PAUSE
\ No newline at end of file
+:END_NO_PAUSE
More information about the seam-commits
mailing list