DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4943>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=4943

patch for Win* examples .bat files

           Summary: patch for Win* examples .bat files
           Product: Velocity
           Version: 1.1-rc2
          Platform: PC
        OS/Version: MacOS 9
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Testing
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


Hello, because WinNT cmd.exe by default expands variable on reading,
not when it is executed, construction like
        for %%i in (..\..\bin\*.jar) do set VELCP=%VELCP%;%%i
will just set VELCP variable to the last file found.
so i suggest next patch to apply:
diff -rwuP ori/anakia/build/build.bat new/anakia/build/build.bat
--- ori/anakia/build/build.bat  Thu Jan  1 00:00:00 1970
+++ new/anakia/build/build.bat  Thu Nov  8 08:01:34 2001
@@ -0,0 +1,26 @@
+REM
+REM  Thanks to Peter Donald <[EMAIL PROTECTED]>
+REM  for providing this and lcp.bat, so we don't
+REM  have to hunt down a win32 box :)
+REM
+
+if "%JAVA_HOME%" == "" goto javahomeerror
+
+set ANT_HOME=..\..\..\bin
+
+set LOCALCLASSPATH=
+for %%i in (..\..\..\build\lib\*.jar) do call lcp.bat %%i
+for %%i in (..\..\..\bin\*.jar) do call lcp.bat %%i
+
+echo %LOCALCLASSPATH%
+
+%JAVA_HOME%\bin\java.exe -classpath "%LOCALCLASSPATH%" org.apache.tools.ant.Mai
n -Dant.home=%ANT_HOME% %1 %2 %3 %4 %5 %6 %7 %8 %9
+
+goto end
+
+:javahomeerror
+echo "ERROR: JAVA_HOME not found in your environment."
+echo "Please, set the JAVA_HOME variable in your environment to match the"
+echo "location of the Java Virtual Machine you want to use."
+
+:end
diff -rwuP ori/anakia/build/lcp.bat new/anakia/build/lcp.bat
--- ori/anakia/build/lcp.bat    Thu Jan  1 00:00:00 1970
+++ new/anakia/build/lcp.bat    Thu Nov  8 08:01:34 2001
@@ -0,0 +1,2 @@
+set LOCALCLASSPATH=%LOCALCLASSPATH%;%1
+
diff -rwuP ori/app_example1/example.bat new/app_example1/example.bat
--- ori/app_example1/example.bat        Thu Nov  8 08:01:34 2001
+++ new/app_example1/example.bat        Sun Nov 18 11:22:57 2001
@@ -1,7 +1,9 @@
 @echo off

 set VELCP=.
-for %%i in (..\..\bin\*.jar) do set VELCP=%VELCP%;%%i
+for %%i in (..\..\bin\*.jar) do call ..\cpappend.bat %%i
+
+for %%i in (..\..\build\lib\*.jar) do  call ..\cpappend.bat %%i

 echo Using classpath:  %VELCP%

diff -rwuP ori/app_example2/example2.bat new/app_example2/example2.bat
--- ori/app_example2/example2.bat       Thu Nov  8 08:01:34 2001
+++ new/app_example2/example2.bat       Sun Nov 18 11:24:36 2001
@@ -1,7 +1,9 @@
 @echo off

 set VELCP=.
-for %%i in (..\..\bin\*.jar) do set VELCP=%VELCP%;%%i
+for %%i in (..\..\bin\*.jar) do call ..\cpappend.bat %%i
+
+for %%i in (..\..\build\lib\*.jar) do  call ..\cpappend.bat %%i

 echo Using classpath:  %VELCP%

diff -rwuP ori/cpappend.bat new/cpappend.bat
--- ori/cpappend.bat    Thu Jan  1 00:00:00 1970
+++ new/cpappend.bat    Sun Nov 18 11:18:04 2001
@@ -0,0 +1 @@
+set VELCP=%VELCP%;%1
diff -rwuP ori/logger_example/logger_example.bat new/logger_example/logger_examp
le.bat
--- ori/logger_example/logger_example.bat       Thu Nov  8 08:01:34 2001
+++ new/logger_example/logger_example.bat       Sun Nov 18 11:22:34 2001
@@ -1,7 +1,9 @@
 @echo off

 set VELCP=.
-for %%i in (..\..\bin\*.jar) do set VELCP=%VELCP%;%%i
+for %%i in (..\..\bin\*.jar) do call ..\cpappend.bat %%i
+
+for %%i in (..\..\build\lib\*.jar) do  call ..\cpappend.bat %%i

 echo Using classpath:  %VELCP%

diff -rwuP ori/xmlapp_example/xmlapp_example.bat new/xmlapp_example/xmlapp_examp
le.bat
--- ori/xmlapp_example/xmlapp_example.bat       Thu Nov  8 08:01:34 2001
+++ new/xmlapp_example/xmlapp_example.bat       Sun Nov 18 11:22:03 2001
@@ -1,9 +1,9 @@
 @echo off

 set VELCP=.
-for %%i in (..\..\bin\*.jar) do set VELCP=%VELCP%;%%i
+for %%i in (..\..\build\lib\*.jar) do  call ..\cpappend.bat %%i

 echo Using classpath:  %VELCP%

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to