source: main/tags/2.41/gli/makegli.bat@ 24581

Last change on this file since 24581 was 6183, checked in by mdewsnip, 20 years ago

Added some special (ie. nasty) code to fix the javac version detection with the new Java 1.4.2 compiler.

  • Property svn:keywords set to Author Date Id Revision
File size: 6.6 KB
Line 
1@echo off
2
3
4:: -------- Compile the Greenstone Librarian Interface --------
5
6:: This script must be run from within the directory in which it lives
7if exist makegli.bat goto findJavac
8 echo This script must be run from the directory in which it resides.
9 goto exit
10
11
12:findJavac
13:: ---- Check Javac exists ----
14set JAVACPATH=
15
16:: Some users may set the above line manually
17if not "%JAVACPATH%" == "" goto testJavac
18
19 :: If it is set, use the JAVAHOME environment variable
20 if not "%JAVAHOME%" == "" goto javahome
21
22 :: Check if Javac is on the search path
23 echo %PATH%| winutil\which.exe javac.exe | winutil\setvar.exe JAVACPATH > setjavac.bat
24 call setjavac.bat
25 del setjavac.bat
26 if not "%JAVACPATH%" == "" goto testJavac
27
28 :: Still haven't found anything, so try looking in the registry (gulp!)
29 type nul > jdk.reg
30 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
31 type jdk.reg > jdk.txt
32 del jdk.reg
33
34 winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVACPATH > setjavac.bat
35 del jdk.txt
36 call setjavac.bat
37 del setjavac.bat
38
39 :: If nothing was found in the registry, we're stuck
40 if "%JAVACPATH%" == "" goto noJavac
41
42 set JAVACPATH=%JAVACPATH%\bin
43 goto testJavac
44
45:javahome
46 set JAVACPATH=%JAVAHOME%\bin
47
48:testJavac
49:: Check that a Javac executable has been found
50echo Checking Javac: %JAVACPATH%
51if exist "%JAVACPATH%\javac.exe" goto checkVer
52
53:noJavac
54 echo.
55 echo Failed to locate an appropriate version of Javac. You must install a
56 echo Java Development Kit (version 1.4 or greater) before compiling the
57 echo Greenstone Librarian Interface.
58 goto exit
59
60:checkVer
61:: Check that the version of Javac is new enough (1.4.0 or higher) to compile the GLI
62"%JAVACPATH%\javac.exe" -Xstdout javacchk.tmp -target 1.4
63if not errorlevel 1 goto makeGLI
64 :: Nasty special code for javac 1.4.2, since it complains about "no source files"
65 find "javac: no source files" javacchk.tmp >nul
66 if not errorlevel 1 goto makeGLI
67 del javacchk.tmp
68 echo.
69 echo The version of the Java Development Kit you have installed is too old
70 echo to compile the Greenstone Librarian Interface. Please install a new
71 echo version of the Java SDK (version 1.4 or newer) and rerun this script.
72 goto exit
73
74
75:makeGLI
76:: ---- Compile the GLI ----
77del javacchk.tmp
78echo.
79
80if "%1" == "" goto makeAll
81 :: If a file has been specified as a command-line argument, just compile that file
82 echo Compiling %1 and dependant classes...
83
84 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar %1
85
86 echo Done!
87 goto done
88
89:makeAll
90:: Otherwise compile the lot...
91echo Compiling the Greenstone Librarian Interface...
92
93"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/*.java
94"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/cdm/*.java
95"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/checklist/*.java
96"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/collection/*.java
97"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/file/*.java
98"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/gui/*.java
99"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/gui/border/*.java
100"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/gui/metaaudit/*.java
101"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/gui/tree/*.java
102"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/help/*.java
103"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/mem/*.java
104"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/msm/*.java
105"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/msm/parsers/*.java
106"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/shell/*.java
107"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/undo/*.java
108"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/util/*.java
109"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/calpa.jar;lib/jp.jar;lib/polloxml.jar;lib/qfslib.jar;lib/skinlf.jar;lib/nanoxml.jar src/org/greenstone/gatherer/valuetree/*.java
110
111echo Done!
112goto done
113
114:exit
115echo.
116pause
117
118:done
119:: ---- Clean up ----
120set JAVACPATH=
Note: See TracBrowser for help on using the repository browser.