root/main/trunk/gli/makejar.bat @ 29729

Revision 29729, 7.1 KB (checked in by ak19, 5 years ago)

First part of commit fixing up GLI to work with commit of reviosion 29687. In revision 29687 web.xml got split into web.xml and servlets.xml, which the first included as an entity. GLI parses web.xml and other XML files on startup, and now requires an EntityResolver? to parse the inclusion of servlets.xml in web.xml. The use of an EntityResolver? when parsing web.xml was also required in the GS3 server application code (in GS3/src/java), and worked there. The same change however didn't work in GLI, because the xerces and xml-apis (sax) classes used by GLI were not the same as what the GS3 server code used. The contents of xercesImpl.jar and xml-apis.jar used by GS3 have now replaced what was there in the older apache.jar, the rest of the contents are the same as before because they don't seem to be tightly coupled with the xerces and xml-apis parts of the apache.jar contents, whereas these two are.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1echo off
2setlocal enabledelayedexpansion
3
4pushd "%CD%"
5CD /D "%~dp0"
6set GLILANG=en
7
8:: This script must be run from within the directory in which it lives
9if exist makejar.bat goto findJar
10    if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
11    if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
12    if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ … partir du r‚pertoire dans lequel il se trouve.
13    if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
14    goto exit
15
16
17
18
19:findJar
20:: ---- Check jar exists ----
21set JARPATH=
22
23:: Some users may set the above line manually
24if not "%JARPATH%" == "" goto testJar
25
26    :: If it is set, use the JAVA_HOME environment variable
27    if not "%JAVA_HOME%" == "" goto javahome
28
29    :: Check if jar is on the search path
30    echo %PATH%| winutil\which.exe jar.exe | winutil\setvar.exe JARPATH > setjar.bat
31    call setjar.bat
32    del setjar.bat
33    if not "%JARPATH%" == "" goto testJar
34
35    :: Still haven't found anything, so try looking in the registry (gulp!)
36    type nul > jdk.reg
37    regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
38    type jdk.reg > jdk.txt
39    del jdk.reg
40
41    winutil\findjava.exe jdk.txt | winutil\setvar.exe JARPATH > setjar.bat
42    del jdk.txt
43    call setjar.bat
44    del setjar.bat
45
46    :: If nothing was found in the registry, we're stuck
47    if "%JARPATH%" == "" goto noJar
48
49    set JARPATH=%JARPATH%\bin
50    goto testJar
51
52:javahome
53    set JARPATH=%JAVA_HOME%\bin
54
55:testJar
56:: Check that a jar executable has been found
57if "%GLILANG%" == "en" echo Checking jar: %JARPATH%
58if "%GLILANG%" == "es" echo Revisando jar: %JARPATH%
59if "%GLILANG%" == "fr" echo V‚rification de jar: %JARPATH%
60if "%GLILANG%" == "ru" echo à®¢¥àª  jar: %JARPATH%
61if exist "%JARPATH%\jar.exe" goto checkCompile
62
63:noJar
64    echo.
65    if "%GLILANG%" == "en" echo Failed to locate an appropriate version of jar. You must install a
66    if "%GLILANG%" == "en" echo Java Development Kit (version 1.4 or greater) before compiling the
67    if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
68
69    if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de jar. Usted deber 
70    if "%GLILANG%" == "es" echo instalar un Kit de Desarrollo de Software Java (versi¢n 1.4 o superior)
71    if "%GLILANG%" == "es" echo antes de generar la documentaci¢n para la Interfaz de la Biblioteca
72    if "%GLILANG%" == "es" echo Digital Greenstone.
73
74    if "%GLILANG%" == "fr" echo Une version appropri‚e de jar n'a pas pu ˆtre localis‚e. Vous devez
75    if "%GLILANG%" == "fr" echo installer un Kit de D‚veloppement Java (version 1.4 ou sup‚rieure)
76    if "%GLILANG%" == "fr" echo avant de produire la documentation de Greenstone Librarian Interface.
77
78    if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš jar.
79    if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë š­áâ ««šà®¢ âì Java Development Kit (¢¥àášï 1.4 š«š ¢ëè¥)
80    if "%GLILANG%" == "ru" echo ¯à¥Š€¥, 祬 £¥­¥àšà®¢ âì €®ªã¬¥­â æšî €«ï ¡š¡«š®â¥ç­®£®
81    if "%GLILANG%" == "ru" echo š­â¥àä¥©á  Greenstone.
82    goto exit
83
84
85
86:checkCompile
87:: Check that the GLI has been compiled
88if exist classes\org\greenstone\gatherer\GathererProg.class goto makeJar
89    if "%GLILANG%" == "es"  (
90    echo Usted necesita compilar la Interfaz de la Biblioteca Digital Greenstone
91    echo ^(por medio de makegli.sh^) antes de ejecutar este guión.
92    )
93    if "%GLILANG%" == "fr" (
94    echo Vous devez compiler le Greenstone Interface ^(en utilisant makegli.sh^)
95    echo avant d'exécuter ce script.
96    )
97    if "%GLILANG%" == "ru" (
98    echo ÷Ù ÄÏÌÖÎÙ ËÏÍÐÉÌÉÒÏ×ÁÔØ ÂÉÂÌÉÏÔÅÞÎÙÊ ÉÎÔÅÒÆÅÊÓ Greenstone
99    echo ^(ÉÓÐÏÌØÚÕÑ makegli.sh^) ÐÅÒÅÄ ××ÏÄÏÍ ÜÔÏÇÏ ÓËÒÉÐÔÁ
100    )
101    if "%GLILANG%" == "en" (
102    echo You need to compile the Greenstone Librarian Interface ^(using makegli.sh^)
103    echo before running this script.
104    )
105    goto exit
106fi
107
108
109:makeJar
110:: All the GLI class files and supporting libraries are put into the "jar" directory
111
112echo Assuming that Java code is freshly compiled...
113
114if NOT exist jar (
115  mkdir jar
116
117  cd jar
118  "!JARPATH!\jar" xf ..\lib\apache.jar com org javax
119  "!JARPATH!\jar" xf ..\lib\qfslib.jar de
120  "!JARPATH!\jar" xf ..\lib\rsyntaxtextarea.jar org
121  cd ..
122)
123
124:: Copy the latest version of the GLI classes into the jar directory
125if exist jar\org\greenstone (
126  rmdir /q /s jar\org\greenstone
127)
128xcopy /i /e /q classes\org\greenstone jar\org\greenstone
129
130:: Some of the things to go into the JAR file are optional, and may not exist
131set optional=
132if exist collect.zip (
133    set optional=%optional% collect.zip
134)
135
136:: Recreate the metadata.zip file (contains the GLI metadata directory)
137if exist metadata.zip (
138  del /f metadata.zip
139)
140winutil\zip.exe -r metadata.zip metadata >NUL
141
142
143:: Build up a list of all the loose files in the classes directory, which includes
144:: both feedback.properties and all dictionary*.properties files, since they all need
145:: to be included in the resulting GLI.jar file.
146:: This type of FOR statement does not recurse into subdirs, which is what we want
147:: as we want to include all the loose files in the toplevel classes dir in GLI.jar
148::for %%G in (classes\*.properties) do echo file is %%G
149set propfiles=
150for %%G in (classes\*) do (call :concat %%G)
151::echo Property files list: %propfiles%
152goto :jarcmd
153
154:concat
155set propfiles=%propfiles% %1
156goto :eof
157
158:jarcmd
159:: Jar everything up
160::"%JARPATH%\jar" cf GLI.jar .java.policy metadata.zip %optional% help -C classes dictionary.properties -C classes dictionary_es.properties -C classes dictionary_fr.properties -C classes dictionary_ru.properties -C classes feedback.properties -C classes images -C classes xml -C jar com -C jar de -C jar org -C jar javax
161
162:: include all the properties (and other loose) files in the toplevel classes directory into the GLI.jar
163:: (Do something similar to get any and all folders inside the toplevel jar folder included into GLI.jar?)
164"%JARPATH%\jar" cf GLI.jar .java.policy metadata.zip %optional% help %propfiles% -C classes images -C classes xml -C jar com -C jar de -C jar org -C jar javax
165
166
167:: Tidy up
168del /f metadata.zip
169
170:: Generate the GLIServer.jar file for remote building
171"%JARPATH%\jar" cf GLIServer.jar -C classes org/greenstone/gatherer/remote
172
173:: ---- Make signed JAR file for the applet, if desired ----
174if  (%1) == (-sign) (
175
176    if not exist appletstore (
177      "!JARPATH!\keytool" -genkey -alias privateKey -keystore appletstore -storepass greenstone
178    )
179
180    if exist SignedGatherer.jar del /f SignedGatherer.jar
181    if exist appletpasswd (
182      echo Using jarsigner to make signed jar file ...
183      "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey < appletpasswd >NUL 2>NUL
184      echo ... done.
185    ) ELSE (
186      "!JARPATH!\jarsigner" -keystore appletstore -signedjar SignedGatherer.jar GLI.jar privateKey
187    )
188    echo Installing SignedGatherer in ..\bin\java
189    move SignedGatherer.jar ..\bin\java\SignedGatherer.jar
190)
191:exit
192
193popd
194endlocal
Note: See TracBrowser for help on using the browser.