1 | @echo off
|
---|
2 |
|
---|
3 | echo Greenstone Librarian Interface (GLI)
|
---|
4 | echo Copyright (C) 2002 Greenstone Digital Libraries, University Of Waikato
|
---|
5 | echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
|
---|
6 | echo This is free software, and you are welcome to redistribute it
|
---|
7 | echo.
|
---|
8 |
|
---|
9 | :: -------- Compile the Greenstone Librarian Interface --------
|
---|
10 |
|
---|
11 | :: This script must be run from within the directory in which it lives
|
---|
12 | if exist makegli.bat goto findJavac
|
---|
13 | echo This script must be run from the directory in which it resides.
|
---|
14 | goto exit
|
---|
15 |
|
---|
16 |
|
---|
17 | :findJavac
|
---|
18 | :: ---- Check Javac exists ----
|
---|
19 | set JAVACPATH=
|
---|
20 |
|
---|
21 | :: Some users may set the above line manually
|
---|
22 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
23 |
|
---|
24 | :: If it is set, use the JAVAHOME environment variable
|
---|
25 | if not "%JAVAHOME%" == "" goto javahome
|
---|
26 |
|
---|
27 | :: Check if Javac is on the search path
|
---|
28 | echo %PATH%| winutil\which.exe javac.exe | winutil\setvar.exe JAVACPATH > setjavac.bat
|
---|
29 | call setjavac.bat
|
---|
30 | del setjavac.bat
|
---|
31 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
32 |
|
---|
33 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
34 | type nul > jdk.reg
|
---|
35 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
36 | type jdk.reg > jdk.txt
|
---|
37 | del jdk.reg
|
---|
38 |
|
---|
39 | winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVACPATH > setjavac.bat
|
---|
40 | del jdk.txt
|
---|
41 | call setjavac.bat
|
---|
42 | del setjavac.bat
|
---|
43 |
|
---|
44 | :: If nothing was found in the registry, we're stuck
|
---|
45 | if "%JAVACPATH%" == "" goto noJavac
|
---|
46 |
|
---|
47 | set JAVACPATH=%JAVACPATH%\bin
|
---|
48 | goto testJavac
|
---|
49 |
|
---|
50 | :javahome
|
---|
51 | set JAVACPATH=%JAVAHOME%\bin
|
---|
52 |
|
---|
53 | :testJavac
|
---|
54 | :: Check that a Javac executable has been found
|
---|
55 | echo Checking Javac: %JAVACPATH%
|
---|
56 | if exist "%JAVACPATH%\javac.exe" goto checkVer
|
---|
57 |
|
---|
58 | :noJavac
|
---|
59 | echo.
|
---|
60 | echo Failed to locate an appropriate version of Javac. You must install a
|
---|
61 | echo Java Development Kit (version 1.4 or greater) before compiling the
|
---|
62 | echo Greenstone Librarian Interface.
|
---|
63 | goto exit
|
---|
64 |
|
---|
65 | :checkVer
|
---|
66 | :: Check that the version of Javac is new enough (1.4.0 or higher) to compile the GLI
|
---|
67 | "%JAVACPATH%\javac.exe" -Xstdout javacchk.tmp -target 1.4
|
---|
68 | if not errorlevel 1 goto makeGLI
|
---|
69 | :: Nasty special code for javac 1.4.2, since it complains about "no source files"
|
---|
70 | find "javac: no source files" javacchk.tmp >nul
|
---|
71 | if not errorlevel 1 goto makeGLI
|
---|
72 | del javacchk.tmp
|
---|
73 | echo.
|
---|
74 | echo The version of the Java Development Kit you have installed is too old
|
---|
75 | echo to compile the Greenstone Librarian Interface. Please install a new
|
---|
76 | echo version of the Java SDK (version 1.4 or newer) and rerun this script.
|
---|
77 | goto exit
|
---|
78 |
|
---|
79 |
|
---|
80 | :makeGLI
|
---|
81 | :: ---- Compile the GLI ----
|
---|
82 | del javacchk.tmp
|
---|
83 | echo.
|
---|
84 |
|
---|
85 | if "%1" == "" goto makeAll
|
---|
86 | :: If a file has been specified as a command-line argument, just compile that file
|
---|
87 | echo Compiling %1 and dependant classes...
|
---|
88 |
|
---|
89 | "%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
|
---|
90 |
|
---|
91 | echo Done!
|
---|
92 | goto done
|
---|
93 |
|
---|
94 | :makeAll
|
---|
95 | :: Otherwise compile the lot...
|
---|
96 | echo Compiling the Greenstone Librarian Interface...
|
---|
97 |
|
---|
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/*.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/cdm/*.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/checklist/*.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/collection/*.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/file/*.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/gui/*.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/gui/border/*.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/gui/metaaudit/*.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/gui/tree/*.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/help/*.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/mem/*.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/msm/*.java
|
---|
110 | "%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
|
---|
111 | "%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
|
---|
112 | "%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
|
---|
113 | "%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
|
---|
114 | "%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
|
---|
115 |
|
---|
116 | echo Done!
|
---|
117 | goto done
|
---|
118 |
|
---|
119 | :exit
|
---|
120 | echo.
|
---|
121 | pause
|
---|
122 |
|
---|
123 | :done
|
---|
124 | :: ---- Clean up ----
|
---|
125 | set JAVACPATH=
|
---|