root/main/trunk/greenstone2/common-src/indexers/lucene-gs/winMake.bat @ 29155

Revision 29155, 2.2 KB (checked in by ak19, 5 years ago)

Making the windows winMake.bat that creates the Lucene4Wrapper.jar more like the linux one, by using a for statement to include the jar files in the Make All target that generates the jar

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
Line 
1@echo off
2
3set LUCENEHOME=.
4
5set LUCENE_VER=4.7.2
6
7rem ---- Where to put class files ----
8set JAVACLASSDIR4=classes4
9set JAVACLASSDIR3=classes3
10
11rem ---- Name and location of java programs ----
12set JAVAC="%JAVA_HOME%\bin\javac"
13set JAVAH="%JAVA_HOME%\bin\javah"
14set JAVA="%JAVA_HOME%\bin\java"
15set JAVADOC="%JAVA_HOME%\bin\javadoc"
16set JAR="%JAVA_HOME%\bin\jar"
17
18::set JAVACOPTIONS=-deprecation -g -O
19set JAVACOPTIONS=
20
21:: Note that both jar file lists need to be modified simultaneously when the jar dependencies are changed
22set LUCENE4_JAR=.\lib\lucene4\lucene-core-4.7.2.jar;.\lib\lucene4\lucene-analyzers-common-4.7.2.jar;.\lib\lucene4\lucene-analyzers-kuromoji-4.7.2.jar;.\lib\lucene4\lucene-queryparser-4.7.2.jar
23set LUCENE3_JAR=.\lib\lucene-core-3.3.0.jar
24
25set MYCLASSPATH4=%LUCENE4_JAR%;%JAVACLASSDIR4%
26set MYCLASSPATH3=%LUCENE3_JAR%;%JAVACLASSDIR3%
27
28
29if "%DEBUG%" == "" (
30  set MAKE_VARS=DEBUG=0
31) else (
32  set MAKE_VARS=DEBUG=%DEBUG%
33)
34
35if ""%1"" == """" goto all
36if ""%1"" == ""all"" goto all
37if ""%1"" == ""install"" goto install
38if ""%1"" == ""clean"" goto clean
39
40:unknown
41    echo Error: Unrecognized argument %1.
42    goto done
43
44:lucene3
45       if not exist %JAVACLASSDIR3% mkdir %JAVACLASSDIR3%
46       echo Compiling Greenstone Lucene version 3.x Java classes ...
47       %JAVAC% -d %JAVACLASSDIR3% -classpath %MYCLASSPATH3% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper3\*.java
48       cd %JAVACLASSDIR3%
49       %JAR% xf ..\%LUCENE3_JAR%
50       cd ..
51       %JAR% cf LuceneWrapper3.jar -C %JAVACLASSDIR3% .
52       goto done
53
54:all
55    if not exist %JAVACLASSDIR4% mkdir %JAVACLASSDIR4%
56    echo Compiling Greenstone Lucene version 4.x Java classes ...
57    %JAVAC% -d %JAVACLASSDIR4% -classpath %MYCLASSPATH4% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper4\*.java
58    pushd %JAVACLASSDIR4%
59    for %%G in (..\lib\lucene4\*%LUCENE_VER%.jar) do %JAR% xf %%G
60    popd
61    %JAR% cf LuceneWrapper4.jar -C %JAVACLASSDIR4% .   
62    goto done
63
64:install
65    goto done
66
67:clean
68    echo Cleaning up Greenstone Lucene ...
69    if exist %JAVACLASSDIR4% rmdir /S /Q %JAVACLASSDIR4%
70        if exist LuceneWrapper4.jar del LuceneWrapper4.jar
71    if exist %JAVACLASSDIR3% rmdir /S /Q %JAVACLASSDIR3%
72        if exist LuceneWrapper3.jar del LuceneWrapper3.jar
73    goto done
74
75:done
76
Note: See TracBrowser for help on using the browser.