[5824] | 1 | @echo off
|
---|
[17945] | 2 | pushd "%CD%"
|
---|
| 3 | CD /D "%~dp0"
|
---|
[6747] | 4 | set GLILANG=en
|
---|
[5824] | 5 |
|
---|
[6747] | 6 |
|
---|
[32913] | 7 | :: Don't bother compiling GLI if there's no source code (e.g. if this is a binary only)
|
---|
| 8 | if not exist src (
|
---|
[32915] | 9 | echo WARNING: There is no gli source code ^(src directory^) to compile. Terminating makegli.
|
---|
[32913] | 10 | goto exit
|
---|
| 11 | )
|
---|
| 12 |
|
---|
[6747] | 13 | :: -------- Compile the Greenstone Librarian Interface --------
|
---|
| 14 |
|
---|
[6570] | 15 | echo.
|
---|
[6747] | 16 | if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
|
---|
[17945] | 17 | if "%GLILANG%" == "en" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
|
---|
[6747] | 18 | if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
|
---|
| 19 | if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
|
---|
| 20 |
|
---|
[6959] | 21 | if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
|
---|
[17945] | 22 | if "%GLILANG%" == "es" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
|
---|
[6959] | 23 | if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
|
---|
| 24 | if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los trminos de la licencia en LICENSE.txt
|
---|
| 25 | if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
|
---|
[6753] | 26 |
|
---|
[6955] | 27 | if "%GLILANG%" == "fr" echo Interface du Bibliothcaire Greenstone (Greenstone Librarian Interface - GLI)
|
---|
[17945] | 28 | if "%GLILANG%" == "fr" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
|
---|
[6955] | 29 | if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des dtails, voir LICENSE.txt
|
---|
| 30 | if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous tes invit
|
---|
[6754] | 31 | le redistribuer
|
---|
[7041] | 32 |
|
---|
[17945] | 33 | if "%GLILANG%" == "ru" echo š¡«š®â¥çë© šâ¥à䥩á Greenstone (Greenstone Librarian Interface - GLI)
|
---|
[7041] | 34 | if "%GLILANG%" == "ru" echo Copyright (C) 2008, New Zealand Digital Library Project, University Of Waikato
|
---|
| 35 | if "%GLILANG%" == "ru" echo ¥ € ¥â ; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
|
---|
| 36 | if "%GLILANG%" == "ru" echo â® - ᢮¡®€® à á¯à®áâà 塞®¥ ¯à®£à ¬¬®¥ ®¡¥á¯¥ç¥š¥ š ë ¬®Š¥â¥ à á¯à®áâà ïâì ¥£®
|
---|
[6570] | 37 |
|
---|
[5824] | 38 | echo.
|
---|
| 39 |
|
---|
| 40 | :: This script must be run from within the directory in which it lives
|
---|
[6747] | 41 | if exist makegli.bat goto findJavac
|
---|
[6753] | 42 | if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
|
---|
[6747] | 43 | if "%GLILANG%" == "es" echo Este gui¢n deber ejecutarse desde el directorio en el que reside.
|
---|
[6754] | 44 | if "%GLILANG%" == "fr" echo Ce script doit tre excut
|
---|
[5824] | 45 | partir du rpertoire dans lequel il se trouve.
|
---|
| 46 | if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ® à ᯮ«®Š¥
|
---|
| 47 | goto exit
|
---|
| 48 |
|
---|
| 49 |
|
---|
| 50 | :findJavac
|
---|
| 51 | :: ---- Check Javac exists ----
|
---|
| 52 | set JAVACPATH=
|
---|
| 53 |
|
---|
| 54 | :: Some users may set the above line manually
|
---|
[6467] | 55 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
| 56 |
|
---|
[5824] | 57 | :: If it is set, use the JAVA_HOME environment variable
|
---|
| 58 | if not "%JAVA_HOME%" == "" goto javahome
|
---|
| 59 |
|
---|
| 60 | :: Check if Javac is on the search path
|
---|
| 61 | echo %PATH%| winutil\which.exe javac.exe | winutil\setvar.exe JAVACPATH > setjavac.bat
|
---|
| 62 | call setjavac.bat
|
---|
| 63 | del setjavac.bat
|
---|
| 64 | if not "%JAVACPATH%" == "" goto testJavac
|
---|
| 65 |
|
---|
| 66 | :: Still haven't found anything, so try looking in the registry (gulp!)
|
---|
| 67 | type nul > jdk.reg
|
---|
| 68 | regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
|
---|
| 69 | type jdk.reg > jdk.txt
|
---|
| 70 | del jdk.reg
|
---|
| 71 |
|
---|
| 72 | winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVACPATH > setjavac.bat
|
---|
| 73 | del jdk.txt
|
---|
| 74 | call setjavac.bat
|
---|
| 75 | del setjavac.bat
|
---|
| 76 |
|
---|
| 77 | :: If nothing was found in the registry, we're stuck
|
---|
| 78 | if "%JAVACPATH%" == "" goto noJavac
|
---|
[35572] | 79 |
|
---|
[5824] | 80 | set JAVACPATH=%JAVACPATH%\bin
|
---|
| 81 |
|
---|
| 82 | goto testJavac
|
---|
[6467] | 83 |
|
---|
[35572] | 84 | :javahome
|
---|
| 85 | set JAVACPATH=%JAVA_HOME%\bin
|
---|
| 86 | :: In case this block of code, explicity jump to setJavacFlags
|
---|
| 87 | goto testJavac
|
---|
| 88 |
|
---|
| 89 | :: :javacFlags
|
---|
| 90 | :: This block used to set JAVACFLAGS if not already set
|
---|
| 91 | :: JAVACFLAGS is now explicitly set in the Release Kit, and so no longer needed here
|
---|
| 92 | :: if "%JAVACFLAGS%" == "" (
|
---|
| 93 | :: set JAVACFLAGS=-source 1.6 -target 1.6
|
---|
| 94 | :: )
|
---|
| 95 | :: if exists lib\rt-openjdk6.jar (
|
---|
| 96 | :: set JAVACFLAGS=%JAVACFLAGS -bootclasspath lib\rt-openjdk6.jar -extdirs ""
|
---|
| 97 | :: )
|
---|
| 98 | :: :: In case this block of code, explicity jump to testJavac
|
---|
[5824] | 99 | :: goto testJavac
|
---|
| 100 |
|
---|
[6747] | 101 | :testJavac
|
---|
[6753] | 102 | :: Check that a Javac executable has been found
|
---|
[6747] | 103 | if "%GLILANG%" == "en" echo Checking Javac: %JAVACPATH%
|
---|
[6754] | 104 | if "%GLILANG%" == "es" echo Revisando Javac: %JAVACPATH%
|
---|
[9862] | 105 | if "%GLILANG%" == "fr" echo Vrification de Javac: %JAVACPATH%
|
---|
[5824] | 106 | if "%GLILANG%" == "ru" echo ஢¥àª Javac: %JAVACPATH%
|
---|
| 107 | if exist "%JAVACPATH%\javac.exe" goto makeGLI
|
---|
| 108 |
|
---|
[6747] | 109 | :noJavac
|
---|
| 110 | echo.
|
---|
| 111 | if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Javac. You must install a
|
---|
| 112 | if "%GLILANG%" == "en" echo Java Development Kit (version 1.4 or greater) before compiling the
|
---|
[6753] | 113 | if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
|
---|
| 114 |
|
---|
| 115 | if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Javac. Usted deber
|
---|
| 116 | if "%GLILANG%" == "es" echo instalar un Kit de Desarrollo de Software Java (versi¢n 1.4 o superior)
|
---|
| 117 | if "%GLILANG%" == "es" echo antes de generar la documentaci¢n para la Interfaz de la Biblioteca
|
---|
[6747] | 118 | if "%GLILANG%" == "es" echo Digital Greenstone.
|
---|
| 119 |
|
---|
| 120 | if "%GLILANG%" == "fr" echo Une version approprie de Javac n'a pas pu tre localise. Vous devez
|
---|
[6754] | 121 | if "%GLILANG%" == "fr" echo installer un Kit de Dveloppement Java (version 1.4 ou suprieure)
|
---|
| 122 | if "%GLILANG%" == "fr" echo avant de produire la documentation de Greenstone Librarian Interface.
|
---|
| 123 |
|
---|
| 124 | if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥á⮠宊€¥š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Javac.
|
---|
| 125 | if "%GLILANG%" == "ru" echo ë €®«Šë šáâ ««šà®¢ âì Java Development Kit (¢¥àášï 1.4 š«š ¢ëè¥)
|
---|
[5824] | 126 | if "%GLILANG%" == "ru" echo ¯à¥Š€¥, 祬 £¥¥àšà®¢ âì €®ªã¬¥â æšî €«ï ¡š¡«š®â¥ç®£®
|
---|
| 127 | if "%GLILANG%" == "ru" echo šâ¥à䥩á Greenstone.
|
---|
[6747] | 128 | goto exit
|
---|
[5824] | 129 |
|
---|
| 130 |
|
---|
| 131 | :makeGLI
|
---|
| 132 | :: ---- Compile the GLI ----
|
---|
| 133 |
|
---|
[10422] | 134 | if "%1" == "" goto makeAll
|
---|
[8978] | 135 | :: If a file has been specified as a command-line argument, just compile that file
|
---|
[6753] | 136 | echo.
|
---|
[6747] | 137 | if "%GLILANG%" == "en" echo Compiling %1 and dependent classes...
|
---|
[6754] | 138 | if "%GLILANG%" == "es" echo Compilando %1 y clases dependientes...
|
---|
[5824] | 139 | if "%GLILANG%" == "fr" echo Compilation de %1 et des classes dpendantes,,,
|
---|
[37326] | 140 | if "%GLILANG%" == "ru" echo ®¬¯š«šà®¢ š¥ %1 š § ¢šáš¬ë¥ ª« ááë...
|
---|
[5824] | 141 |
|
---|
[6747] | 142 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar %1
|
---|
[6753] | 143 |
|
---|
[6747] | 144 | if "%GLILANG%" == "en" echo Done!
|
---|
[6754] | 145 | if "%GLILANG%" == "es" echo Hecho!
|
---|
[5927] | 146 | if "%GLILANG%" == "fr" echo Termin!
|
---|
[5824] | 147 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
| 148 | goto done
|
---|
| 149 |
|
---|
[10422] | 150 | :makeAll
|
---|
| 151 | :: Otherwise compile the lot...
|
---|
| 152 |
|
---|
| 153 | :: Remove any existing class files first
|
---|
[6747] | 154 | call clean.bat
|
---|
[6753] | 155 |
|
---|
[6747] | 156 | if "%GLILANG%" == "en" echo Compiling the Greenstone Librarian Interface...
|
---|
[6754] | 157 | if "%GLILANG%" == "es" echo Compilando la Interfaz de la Biblioteca Digital Greenstone...
|
---|
[5824] | 158 | if "%GLILANG%" == "fr" echo Compilation de Greenstone Librarian Interface,,,
|
---|
[9336] | 159 | if "%GLILANG%" == "ru" echo ®¬¯š«šà®¢ š¥ ¡š¡«š®â¥ç®£® šâ¥à䥩á Greenstone...
|
---|
[17845] | 160 |
|
---|
[37326] | 161 | :: Compile the GLI
|
---|
[36179] | 162 | :: Sun compiler (tested with 1.5 and 1.6) didn't compile DragTreeSelectionModel.java or MetadataAuditTableModel.java automatically, so we need to put them in explicitly
|
---|
[37326] | 163 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java src/org/greenstone/gatherer/metadata/MetadataAuditTableModel.java
|
---|
[36179] | 164 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[37326] | 165 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar src/org/greenstone/gatherer/WebGatherer.java
|
---|
[36179] | 166 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[37326] | 167 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar src/org/greenstone/gatherer/GathererApplet.java
|
---|
[36179] | 168 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[9336] | 169 | :: "%JAVACPATH%\javac.exe" $JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
|
---|
[37326] | 170 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[36179] | 171 | :: Compile the GEMS
|
---|
[13386] | 172 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/jna.jar;lib/jna-platform.jar;lib/qfslib.jar;lib/rsyntaxtextarea.jar;lib/webswing-api.jar src/org/greenstone/gatherer/gems/GEMS.java
|
---|
[35572] | 173 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[36179] | 174 | :: Compile the standalone programs needed on the server for remote building
|
---|
[35572] | 175 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Zip*.java
|
---|
[36179] | 176 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[13386] | 177 | "%JAVACPATH%\javac.exe" %JAVACFLAGS% -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Unzip.java
|
---|
[6747] | 178 | if %ERRORLEVEL% NEQ 0 goto exit
|
---|
[6753] | 179 |
|
---|
[6747] | 180 | if "%GLILANG%" == "en" echo Done!
|
---|
[6754] | 181 | if "%GLILANG%" == "es" echo Hecho!
|
---|
[5927] | 182 | if "%GLILANG%" == "fr" echo Termin!
|
---|
[5824] | 183 | if "%GLILANG%" == "ru" echo 믮«¥®!
|
---|
| 184 | goto done
|
---|
| 185 |
|
---|
[17945] | 186 | :exit
|
---|
[37235] | 187 | echo.
|
---|
| 188 | popd
|
---|
| 189 | set JAVACPATH=
|
---|
[5824] | 190 | echo exiting with error.
|
---|
| 191 | exit /b %ERRORLEVEL%
|
---|
[5927] | 192 | pause
|
---|
[5824] | 193 |
|
---|
[17945] | 194 | :done
|
---|
[5824] | 195 | :: ---- Clean up ----
|
---|
| 196 | popd
|
---|
| 197 | set JAVACPATH=
|
---|