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
|
---|
7 | if 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 ----
|
---|
14 | set JAVACPATH=
|
---|
15 |
|
---|
16 | :: Some users may set the above line manually
|
---|
17 | if 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
|
---|
50 | echo Checking Javac: %JAVACPATH%
|
---|
51 | if 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
|
---|
63 | if 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 ----
|
---|
77 | del javacchk.tmp
|
---|
78 | echo.
|
---|
79 |
|
---|
80 | if "%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...
|
---|
91 | echo 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 |
|
---|
111 | echo Done!
|
---|
112 | goto done
|
---|
113 |
|
---|
114 | :exit
|
---|
115 | echo.
|
---|
116 | pause
|
---|
117 |
|
---|
118 | :done
|
---|
119 | :: ---- Clean up ----
|
---|
120 | set JAVACPATH=
|
---|