source: gli/trunk/makegli.bat@ 15135

Last change on this file since 15135 was 15135, checked in by kjdon, 16 years ago

Added in extra java files explicitly to compile line for GatherProg.java. This is because while Sun's javac + java does not seem to need them compiled, Microsoft's java JVM does. Before the change the net result was that GLI compiled with Sun's javac would throw an exception when GLI was running with Microsofts java, complaining it could not find the necessary class file.

  • Property svn:keywords set to Author Date Id Revision
File size: 7.7 KB
RevLine 
[5824]1@echo off
[6747]2set GLILANG=en
[5824]3
[6747]4
5:: -------- Compile the Greenstone Librarian Interface --------
6
[6570]7echo.
[6747]8if "%GLILANG%" == "en" echo Greenstone Librarian Interface (GLI)
[12453]9if "%GLILANG%" == "en" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
[6747]10if "%GLILANG%" == "en" echo GLI comes with ABSOLUTELY NO WARRANTY; for details see LICENSE.txt
11if "%GLILANG%" == "en" echo This is free software, and you are welcome to redistribute it
12
[6959]13if "%GLILANG%" == "es" echo Interfaz de la Biblioteca Digital Greenstone (Greenstone Librarian Interface - GLI)
[12453]14if "%GLILANG%" == "es" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
[6959]15if "%GLILANG%" == "es" echo La Interfaz de la Biblioteca Digital Greenstone NO INCLUYE ABSOLUTAMENTE NINGUNA GARANTÖA.
16if "%GLILANG%" == "es" echo Para mayor informaci¢n vea los t‚rminos de la licencia en LICENSE.txt
17if "%GLILANG%" == "es" echo Este es un software abierto, por lo que lo invitamos a que lo distribuya de forma gratuita
[6753]18
[6955]19if "%GLILANG%" == "fr" echo Interface du Biblioth‚caire Greenstone (Greenstone Librarian Interface - GLI)
[12453]20if "%GLILANG%" == "fr" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
[6955]21if "%GLILANG%" == "fr" echo GLI est fourni sans AUCUNE GARANTIE; pour des d‚tails, voir LICENSE.txt
22if "%GLILANG%" == "fr" echo Ceci est un logiciel libre, et vous ˆtes invit‚ …
[6754]23 le redistribuer
[7041]24
[12453]25if "%GLILANG%" == "ru" echo š¡«š®â¥ç­ë© š­â¥à䥩á Greenstone (Greenstone Librarian Interface - GLI)
[7041]26if "%GLILANG%" == "ru" echo Copyright (C) 2006, New Zealand Digital Library Project, University Of Waikato
27if "%GLILANG%" == "ru" echo ˆƒ ­¥ € ¥â €‘Ž‹ž’Ž ˆŠ€Šˆ• ƒ€€’ˆ‰; €¥â «š á¬. ¢ ⥪á⥠LICENSE.TXT
28if "%GLILANG%" == "ru" echo â® - ᢮¡®€­® à á¯à®áâ࠭塞®¥ ¯à®£à ¬¬­®¥ ®¡¥á¯¥ç¥­š¥ š ‚ë ¬®Š¥â¥ à á¯à®áâà ­ïâì ¥£®
[6570]29
[5824]30echo.
31
32:: This script must be run from within the directory in which it lives
[6747]33if exist makegli.bat goto findJavac
[6753]34 if "%GLILANG%" == "en" echo This script must be run from the directory in which it resides.
[6747]35 if "%GLILANG%" == "es" echo Este gui¢n deber  ejecutarse desde el directorio en el que reside.
[6754]36 if "%GLILANG%" == "fr" echo Ce script doit ˆtre ex‚cut‚ …
[5824]37 partir du r‚pertoire dans lequel il se trouve.
38 if "%GLILANG%" == "ru" echo â®â áªàš¯â €®«Š¥­ ¡ëâì ¢§ïâ š§ €šà¥ªâ®àšš, ¢ ª®â®à®© ®­ à á¯®«®Š¥­
39 goto exit
40
41
42:findJavac
43:: ---- Check Javac exists ----
44set JAVACPATH=
45
46:: Some users may set the above line manually
[6467]47if not "%JAVACPATH%" == "" goto testJavac
48
[5824]49 :: If it is set, use the JAVA_HOME environment variable
50 if not "%JAVA_HOME%" == "" goto javahome
51
52 :: Check if Javac is on the search path
53 echo %PATH%| winutil\which.exe javac.exe | winutil\setvar.exe JAVACPATH > setjavac.bat
54 call setjavac.bat
55 del setjavac.bat
56 if not "%JAVACPATH%" == "" goto testJavac
57
58 :: Still haven't found anything, so try looking in the registry (gulp!)
59 type nul > jdk.reg
60 regedit /E jdk.reg "HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit"
61 type jdk.reg > jdk.txt
62 del jdk.reg
63
64 winutil\findjava.exe jdk.txt | winutil\setvar.exe JAVACPATH > setjavac.bat
65 del jdk.txt
66 call setjavac.bat
67 del setjavac.bat
68
69 :: If nothing was found in the registry, we're stuck
70 if "%JAVACPATH%" == "" goto noJavac
71
72 set JAVACPATH=%JAVACPATH%\bin
73 goto testJavac
[6467]74
[5824]75:javahome
76 set JAVACPATH=%JAVA_HOME%\bin
77
[6747]78:testJavac
[6753]79:: Check that a Javac executable has been found
[6747]80if "%GLILANG%" == "en" echo Checking Javac: %JAVACPATH%
[6754]81if "%GLILANG%" == "es" echo Revisando Javac: %JAVACPATH%
[9862]82if "%GLILANG%" == "fr" echo V‚rification de Javac: %JAVACPATH%
[5824]83if "%GLILANG%" == "ru" echo à®¢¥àª  Javac: %JAVACPATH%
84if exist "%JAVACPATH%\javac.exe" goto makeGLI
85
[6747]86:noJavac
87 echo.
88 if "%GLILANG%" == "en" echo Failed to locate an appropriate version of Javac. You must install a
89 if "%GLILANG%" == "en" echo Java Development Kit (version 1.4 or greater) before compiling the
[6753]90 if "%GLILANG%" == "en" echo Greenstone Librarian Interface.
91
92 if "%GLILANG%" == "es" echo No se pudo localizar una versi¢n apropiada de Javac. Usted deber 
93 if "%GLILANG%" == "es" echo instalar un Kit de Desarrollo de Software Java (versi¢n 1.4 o superior)
94 if "%GLILANG%" == "es" echo antes de generar la documentaci¢n para la Interfaz de la Biblioteca
[6747]95 if "%GLILANG%" == "es" echo Digital Greenstone.
96
97 if "%GLILANG%" == "fr" echo Une version appropri‚e de Javac n'a pas pu ˆtre localis‚e. Vous devez
[6754]98 if "%GLILANG%" == "fr" echo installer un Kit de D‚veloppement Java (version 1.4 ou sup‚rieure)
99 if "%GLILANG%" == "fr" echo avant de produire la documentation de Greenstone Librarian Interface.
100
101 if "%GLILANG%" == "ru" echo ¥ 〠«®áì ®¯à¥€¥«šâì ¬¥áâ®­ å®Š€¥­š¥ ᮮ⢥âáâ¢ãî饩 ¢¥àášš Javac.
102 if "%GLILANG%" == "ru" echo ‚ë €®«Š­ë š­áâ ««šà®¢ âì Java Development Kit (¢¥àášï 1.4 š«š ¢ëè¥)
[5824]103 if "%GLILANG%" == "ru" echo ¯à¥Š€¥, 祬 £¥­¥àšà®¢ âì €®ªã¬¥­â æšî €«ï ¡š¡«š®â¥ç­®£®
104 if "%GLILANG%" == "ru" echo š­â¥àä¥©á  Greenstone.
[6747]105 goto exit
[5824]106
107
108:makeGLI
109:: ---- Compile the GLI ----
110
[10422]111if "%1" == "" goto makeAll
[8978]112 :: If a file has been specified as a command-line argument, just compile that file
[6753]113 echo.
[6747]114 if "%GLILANG%" == "en" echo Compiling %1 and dependent classes...
[6754]115 if "%GLILANG%" == "es" echo Compilando %1 y clases dependientes...
[5824]116 if "%GLILANG%" == "fr" echo Compilation de %1 et des classes d‚pendantes,,,
[11801]117 if "%GLILANG%" == "ru" echo Š®¬¯š«šà®¢ ­š¥ %1 š § ¢šáš¬ë¥ ª« ááë...
[5824]118
[6747]119 "%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar %1
[6753]120
[6747]121 if "%GLILANG%" == "en" echo Done!
[6754]122 if "%GLILANG%" == "es" echo ­Hecho!
[5927]123 if "%GLILANG%" == "fr" echo Termin‚!
[5824]124 if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
125 goto done
126
[10422]127:makeAll
128:: Otherwise compile the lot...
129
130:: Remove any existing class files first
[6747]131call clean.bat
[6753]132
[6747]133if "%GLILANG%" == "en" echo Compiling the Greenstone Librarian Interface...
[6754]134if "%GLILANG%" == "es" echo Compilando la Interfaz de la Biblioteca Digital Greenstone...
[5824]135if "%GLILANG%" == "fr" echo Compilation de Greenstone Librarian Interface,,,
[9336]136if "%GLILANG%" == "ru" echo Š®¬¯š«šà®¢ ­š¥ ¡š¡«š®â¥ç­®£® š­â¥àä¥©á  Greenstone...
[15135]137
138:: Compile the GLI
[11801]139:: Sun compiler (tested with 1.5 and 1.6) didn't compile DragTreeSelectionModel.java or MetadataAuditToolModel.java automatically, so we need to put them in explicitly
[14333]140"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererProg.java src/org/greenstone/gatherer/util/DragTreeSelectionModel.java src/org/greenstone/gatherer/metadata/MetadataAuditTableModel.java
[5824]141"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet.java
[9336]142"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/GathererApplet4gs3.java
[11801]143
[9315]144:: Compile the GEMS
[13386]145"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/;lib/apache.jar;lib/qfslib.jar src/org/greenstone/gatherer/gems/GEMS.java
146
147:: Compile the standalone programs needed on the server for remote building
148"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Zip*.java
[6747]149"%JAVACPATH%\javac.exe" -d classes/ -sourcepath src/ -classpath classes/ src/org/greenstone/gatherer/remote/Unzip.java
[6753]150
[6747]151if "%GLILANG%" == "en" echo Done!
[6754]152if "%GLILANG%" == "es" echo ­Hecho!
[5927]153if "%GLILANG%" == "fr" echo Termin‚!
[5824]154if "%GLILANG%" == "ru" echo ‚믮«­¥­®!
155goto done
156
157:exit
158echo.
[5927]159pause
[5824]160
161:done
162:: ---- Clean up ----
163set JAVACPATH=
Note: See TracBrowser for help on using the repository browser.