[4958] | 1 | @echo off
|
---|
| 2 |
|
---|
| 3 |
|
---|
[5008] | 4 | :: -------- Compile the Greenstone Librarian Interface --------
|
---|
[4958] | 5 |
|
---|
[5026] | 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 |
|
---|
[5008] | 12 | :findJavac
|
---|
| 13 | :: ---- Check Javac exists ----
|
---|
| 14 | set JAVACPATH=
|
---|
[4958] | 15 |
|
---|
[5008] | 16 | :: Some users may set the above line manually
|
---|
| 17 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
[4958] | 18 |
|
---|
[5008] | 19 | :: If it is set, use the JAVAHOME environment variable
|
---|
| 20 | if not "%JAVAHOME%" == "" goto javahome
|
---|
[4958] | 21 |
|
---|
[5008] | 22 | :: Check if Javac is on the search path
|
---|
[5015] | 23 | echo %PATH%| winutil\which javac.exe | winutil\setvar JAVACPATH > setjavac.bat
|
---|
[5008] | 24 | call setjavac.bat
|
---|
| 25 | del setjavac.bat
|
---|
| 26 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
[4958] | 27 |
|
---|
[5008] | 28 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
[5021] | 29 | type nul > jdk.reg
|
---|
[5008] | 30 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
[5021] | 31 | type jdk.reg > jdk.txt
|
---|
| 32 | del jdk.reg
|
---|
[4958] | 33 |
|
---|
[5015] | 34 | winutil\findjava jdk.txt | winutil\setvar JAVACPATH > setjavac.bat
|
---|
[5021] | 35 | del jdk.txt
|
---|
[5008] | 36 | call setjavac.bat
|
---|
| 37 | del setjavac.bat
|
---|
[4958] | 38 |
|
---|
[5008] | 39 | :: If nothing was found in the registry, we're stuck
|
---|
| 40 | if "%JAVACPATH%" == "" goto noJavac
|
---|
[4958] | 41 |
|
---|
[5008] | 42 | set JAVACPATH=%JAVACPATH%\bin
|
---|
| 43 | goto testJavac
|
---|
[4958] | 44 |
|
---|
[5008] | 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
|
---|
[5021] | 62 | "%JAVACPATH%\javac.exe" -Xstdout nul -target 1.4
|
---|
[5008] | 63 | if not errorlevel 1 goto makeGLI
|
---|
| 64 | echo.
|
---|
| 65 | echo The version of the Java Development Kit you have installed is too old
|
---|
| 66 | echo to compile the Greenstone Librarian Interface. Please install a new
|
---|
| 67 | echo version of the Java SDK (version 1.4 or newer) and rerun this script.
|
---|
| 68 | goto exit
|
---|
| 69 |
|
---|
| 70 |
|
---|
| 71 | :makeGLI
|
---|
| 72 | :: ---- Compile the GLI ----
|
---|
| 73 | echo.
|
---|
| 74 |
|
---|
| 75 | if "%1" == "" goto makeAll
|
---|
| 76 | :: If a file has been specified as a command-line argument, just compile that file
|
---|
| 77 | echo Compiling %1 and dependant classes...
|
---|
| 78 |
|
---|
| 79 | "%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
|
---|
| 80 |
|
---|
| 81 | echo Done!
|
---|
| 82 | goto exit
|
---|
| 83 |
|
---|
| 84 | :makeAll
|
---|
| 85 | :: Otherwise compile the lot...
|
---|
[4958] | 86 | echo Compiling the Greenstone Librarian Interface...
|
---|
[5008] | 87 |
|
---|
| 88 | "%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
|
---|
| 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 src/org/greenstone/gatherer/cdm/*.java
|
---|
| 90 | "%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
|
---|
| 91 | "%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
|
---|
| 92 | "%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
|
---|
| 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/gui/*.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/gui/border/*.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/gui/metaaudit/*.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/gui/tree/*.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/help/*.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/mem/*.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/msm/*.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/msm/parsers/*.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/shell/*.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/undo/*.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/util/*.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/valuetree/*.java
|
---|
| 105 |
|
---|
[4958] | 106 | echo Done!
|
---|
| 107 |
|
---|
[5008] | 108 | :exit
|
---|
| 109 | echo.
|
---|
| 110 | pause
|
---|
| 111 |
|
---|
| 112 | :: ---- Clean up ----
|
---|
| 113 | set JAVACPATH=
|
---|