[5824] | 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 |
|
---|
| 62 | :: Check that the version of Javac is new enough (1.4.0 or higher) to compile the GLI
|
---|
| 63 | "%JAVACPATH%\javac.exe" -Xstdout nul -target 1.4
|
---|
| 64 | if not errorlevel 1 goto makeGLI
|
---|
| 65 | echo.
|
---|
| 66 | echo The version of the Java Development Kit you have installed is too old
|
---|
| 67 | echo to compile the Greenstone Librarian Interface. Please install a new
|
---|
| 68 | echo version of the Java SDK (version 1.4 or newer) and rerun this script.
|
---|
| 69 | goto exit
|
---|
| 70 |
|
---|
| 71 |
|
---|
| 72 | :makeGLI
|
---|
| 73 | :: ---- Compile the GLI ----
|
---|
| 74 | echo.
|
---|
| 75 |
|
---|
| 76 | if "%1" == "" goto makeAll
|
---|
| 77 | :: If a file has been specified as a command-line argument, just compile that file
|
---|
| 78 | echo Compiling %1 and dependant classes...
|
---|
| 79 |
|
---|
| 80 | "%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
|
---|
| 81 |
|
---|
| 82 | echo Done!
|
---|
[5927] | 83 | goto done
|
---|
[5824] | 84 |
|
---|
| 85 | :makeAll
|
---|
| 86 | :: Otherwise compile the lot...
|
---|
| 87 | echo Compiling the Greenstone Librarian Interface...
|
---|
| 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 src/org/greenstone/gatherer/*.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/cdm/*.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/checklist/*.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/collection/*.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/file/*.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/*.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/border/*.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/metaaudit/*.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/gui/tree/*.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/help/*.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/mem/*.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/*.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/msm/parsers/*.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/shell/*.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/undo/*.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/util/*.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/valuetree/*.java
|
---|
| 106 |
|
---|
| 107 | echo Done!
|
---|
[5927] | 108 | goto done
|
---|
[5824] | 109 |
|
---|
| 110 | :exit
|
---|
| 111 | echo.
|
---|
| 112 | pause
|
---|
| 113 |
|
---|
[5927] | 114 | :done
|
---|
[5824] | 115 | :: ---- Clean up ----
|
---|
| 116 | set JAVACPATH=
|
---|