[seam-commits] Seam SVN: r9405 - trunk.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Thu Oct 23 23:28:28 EDT 2008


Author: dan.j.allen
Date: 2008-10-23 23:28:28 -0400 (Thu, 23 Oct 2008)
New Revision: 9405

Modified:
   trunk/seam
   trunk/seam.bat
Log:
JBSEAM-3585 (both issues)


Modified: trunk/seam
===================================================================
--- trunk/seam	2008-10-23 21:05:51 UTC (rev 9404)
+++ trunk/seam	2008-10-24 03:28:28 UTC (rev 9405)
@@ -1,16 +1,17 @@
 #!/bin/sh
-############################################
-#
-# seam-gen - Seam project and code generator
-#
-############################################
 
+##############################################
+#                                            #
+# seam-gen - Seam project and code generator #
+#                                            #
+############################################ #
+
 # Validate the JDK installation
 if [ -z "$JAVA_HOME" ]; then
     echo "The JAVA_HOME environment variable is not set"
     echo "Please point it to a JDK installation"
     exit 1
-elif [ ! -x "$JAVA_HOME"/bin/javac ]; then 
+elif [ ! -x "$JAVA_HOME/bin/javac" ]; then 
     echo "The JAVA_HOME environment variable should point to a JDK, not a JRE"
     exit 1
 fi
@@ -32,12 +33,11 @@
 fi
 
 SEAM_GEN_DIR="$SEAM_HOME/seam-gen"
-SEAM_COMMAND="${1}"
+SEAM_COMMAND="$1"
 
-echo "Location of seam script: $SEAM_HOME"
-echo "seam-gen template folder: $SEAM_GEN_DIR"
+echo "SEAM_HOME: $SEAM_HOME"
+echo "Using seam-gen sources from: $SEAM_GEN_DIR"
 
-# OS specific support (must be 'true' or 'false').
 cygwin=false;
 case "`uname`" in
     CYGWIN*)
@@ -50,7 +50,12 @@
 elif [ "$SEAM_COMMAND" = help ]; then
     cat "$SEAM_GEN_DIR/README"
 elif $cygwin; then
-    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" ${*}
+    # Must pass real Windows paths to Java (Java doesn't execute in the context of cgywin)
+    JAVA_HOME_WINPATH=`cygpath -aw "$JAVA_HOME"`
+    SEAM_HOME_WINPATH=`cygpath -aw "$SEAM_HOME"`
+    SEAM_GEN_DIR_WINPATH=`cygpath -aw "$SEAM_GEN_DIR"`
+    WORKING_DIR_WINPATH=`cygpath -aw "$WORKING_DIR"`
+    "$JAVA_HOME/bin/java" -cp "$JAVA_HOME_WINPATH\lib\tools.jar;$SEAM_HOME_WINPATH\build\lib\ant-launcher.jar;$SEAM_HOME_WINPATH\build\lib\ant-nodeps.jar;$SEAM_HOME_WINPATH\build\lib\ant.jar" -Dant.home="$SEAM_HOME_WINPATH\lib" org.apache.tools.ant.launch.Launcher -buildfile "$SEAM_GEN_DIR_WINPATH\build.xml" -Dworking.dir="$WORKING_DIR_WINPATH" "$@"
 else
-    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" ${*}
+    "$JAVA_HOME/bin/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" "$@"
 fi

Modified: trunk/seam.bat
===================================================================
--- trunk/seam.bat	2008-10-23 21:05:51 UTC (rev 9404)
+++ trunk/seam.bat	2008-10-24 03:28:28 UTC (rev 9405)
@@ -1,7 +1,12 @@
 @echo off
- at if not "%ECHO%" == ""  echo %ECHO%
 @if "%OS%" == "Windows_NT" setlocal
 
+rem ##############################################
+rem #                                            #
+rem # seam-gen - Seam project and code generator #
+rem #                                            #
+rem ##############################################
+
 set WORKING_DIR=%CD%
 if "%WORKING_DIR:~-1%" == "\" (
     set WORKING_DIR=%WORKING_DIR:~0,-1%
@@ -10,7 +15,7 @@
 if ["%SEAM_HOME%"] == [""] (
     set SEAM_HOME=%~dp0
 ) else (
-    if not exist "%SEAM_HOME\seam" (goto noseam)
+    if not exist "%SEAM_HOME\seam.bat" (goto noseam)
 )
 if "%SEAM_HOME:~-1%" == "\" (
     set SEAM_HOME=%SEAM_HOME:~0,-1%
@@ -19,9 +24,6 @@
 set SEAM_GEN_DIR=%SEAM_HOME%\seam-gen
 set COMMAND=%1%
 
-echo Location of seam script: %SEAM_HOME%
-echo seam-gen template folder: %SEAM_GEN_DIR%
-
 if [%COMMAND%] == [] (goto usage)
 
 if %COMMAND% == help (goto help)
@@ -30,8 +32,11 @@
 
 if not exist "%JAVA_HOME%\bin\javac.exe" (goto nojdk)
 
-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%" %*
+echo SEAM_HOME: %SEAM_HOME%
+echo Using seam-gen sources from: %SEAM_GEN_DIR%
 
+"%JAVA_HOME%\bin\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
@@ -48,11 +53,11 @@
 goto END_NO_PAUSE
 
 :usage
-more %SEAM_GEN_DIR%\USAGE
+more "%SEAM_GEN_DIR%\USAGE"
 goto END_NO_PAUSE
 
 :help
-more %SEAM_GEN_DIR%\README
+more "%SEAM_GEN_DIR%\README"
 goto END_NO_PAUSE
 
 :END_NO_PAUSE




More information about the seam-commits mailing list