Ignore:
Timestamp:
07/16/14 21:53:44 (7 years ago)
Author:
ak19
Message:

Part of port from lucene3.3.0 to lucene4.7.2. Related to LuceneWrapper. 1. Updating the lucene-gs makefiles to allow compiling up Lucene4Wrapper.jar or Lucene3Wrapper.jar. Only the Linux Makefile.in has been tested so far. 2. Adding in the jar files necessary for Lucene4Wrapper into the lib folder's new lucene4 subfolder. 3. Updating the Lucene src code to use lucene4.7.2 instead of lucene3.3.0.

Location:
main/trunk/greenstone2/common-src/indexers/lucene-gs
Files:
18 added
2 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/Makefile.in

    r28370 r29148  
    22JAVACFLAGS = @JAVACFLAGS@
    33JAR = jar
     4JAVADEBUGFLAGS = #-Xlint:deprecation -Xlint:unchecked
     5
     6LUCENE_VER = 4.7.2
     7
    48
    59LUCENE3_JAR = ./lib/lucene-core-3.3.0.jar
     10#LUCENE3_JAR = ./lib/lucene-core-3.6.0.jar
     11
     12# To have a manifest file that lists the jar dependencies for a jar file:
     13
     14# http://docs.oracle.com/javase/tutorial/deployment/jar/downman.html
     15# https://blogs.oracle.com/olaf/entry/jdev_including_a_classpath_in
     16# http://www.coderanch.com/t/482185/java/java/classpath
     17# http://todayguesswhat.blogspot.co.nz/2011/03/jar-manifestmf-class-path-referencing.html
     18# http://stackoverflow.com/questions/9684737/class-not-found-despite-of-classpath-in-manifest
     19# http://stackoverflow.com/questions/219585/setting-multiple-jars-in-java-classpath
     20# JAVA 6 JVM and later allows use of wildcards in classpath
     21# http://stackoverflow.com/questions/11607873/escape-wildcard-processing-in-java-classpath/11608165#comment15368871_11608165
     22# http://docs.oracle.com/javase/6/docs/technotes/tools/windows/classpath.html
     23
     24
     25LUCENE4_WRAPPER_OBJECTS = \
     26    classes4/org/greenstone/LuceneWrapper4/GSLuceneConstants.class \
     27    classes4/org/greenstone/LuceneWrapper4/GSLuceneUtil.class \
     28    classes4/org/greenstone/LuceneWrapper4/GS2Analyzer.class \
     29    classes4/org/greenstone/LuceneWrapper4/GS2LuceneDelete.class \
     30    classes4/org/greenstone/LuceneWrapper4/GS2LuceneEditor.class \
     31    classes4/org/greenstone/LuceneWrapper4/GS2LuceneIndexer.class \
     32    classes4/org/greenstone/LuceneWrapper4/GS2LuceneQuery.class \
     33    classes4/org/greenstone/LuceneWrapper4/LuceneQueryResult.class \
     34    classes4/org/greenstone/LuceneWrapper4/SharedSoleneQuery.class \
     35    classes4/org/greenstone/LuceneWrapper4/SharedSoleneQueryResult.class
     36
     37LUCENE4_WRAPPER_JAR = LuceneWrapper4.jar
     38
    639
    740LUCENE3_WRAPPER_OBJECTS = \
     
    1952
    2053# For now, drop using JAVACFLAGS in compile line, as it typically sets
    21 # source and target to 1.4, only Lucene 3.x needsd version 1.5 or higher
     54# source and target to 1.4, only Lucene 3.x needs version 1.5 or higher
     55classes4/org/greenstone/LuceneWrapper4/%.class: src/org/greenstone/LuceneWrapper4/%.java
     56ifeq ($(GSDLOS),windows)
     57    mkdir -p classes4 && $(JAVAC) $(JAVADEBUGFLAGS) -classpath "lib/lucene4/*;classes4;." -d classes4 -sourcepath src/ src/org/greenstone/LuceneWrapper4/$*.java
     58else
     59    mkdir -p classes4 && $(JAVAC) $(JAVADEBUGFLAGS) -classpath "lib/lucene4/*:classes4:." -d classes4 -sourcepath src/ src/org/greenstone/LuceneWrapper4/$*.java
     60endif
     61
     62LuceneWrapper4.jar: $(LUCENE4_WRAPPER_OBJECTS)
     63    cd classes4 && for jar in ../lib/lucene4/*$(LUCENE_VER).jar; do \
     64        jar xf $$jar; \
     65    done
     66    $(JAR) cf $(LUCENE4_WRAPPER_JAR) -C classes4 .
     67
     68
    2269classes3/org/greenstone/LuceneWrapper3/%.class: src/org/greenstone/LuceneWrapper3/%.java
    2370ifeq ($(GSDLOS),windows)
     
    3178    $(JAR) cf $(LUCENE3_WRAPPER_JAR) -C classes3 .
    3279
    33 all: $(LUCENE3_WRAPPER_JAR)
     80
     81all: $(LUCENE4_WRAPPER_JAR)
     82# $(LUCENE3_WRAPPER_JAR)
    3483install: all
    3584
    3685clean:
     86    /bin/rm -f $(LUCENE4_WRAPPER_OBJECTS) $(LUCENE4_WRAPPER_JAR)
    3787    /bin/rm -f $(LUCENE3_WRAPPER_OBJECTS) $(LUCENE3_WRAPPER_JAR)
    3888
    3989distclean: clean
     90    if test -e classes4; then /bin/rm -r classes4; fi
     91    if test -e $(LUCENE4_WRAPPER_JAR); then /bin/rm -r $(LUCENE4_WRAPPER_JAR); fi
    4092    if test -e classes3; then /bin/rm -r classes3; fi
    4193    if test -e $(LUCENE3_WRAPPER_JAR); then /bin/rm -r $(LUCENE3_WRAPPER_JAR); fi
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/winMake.bat

    r27330 r29148  
    44
    55rem ---- Where to put class files ----
     6set JAVACLASSDIR4=classes4
    67set JAVACLASSDIR3=classes3
    78
     
    1516set JAVACOPTIONS=-deprecation -g -O
    1617
     18:: Note that both jar file lists need to be modified simultaneously when the jar dependencies are changed
     19set LUCENE4_JAR=.\lib\lucene-core-4.7.2.jar;.\lib\lucene-analyzers-common-4.7.2.jar;.\lib\lucene-analyzers-kuromoji-4.7.2.jar;.\lib\lucene-queryparser-4.7.2.jar
     20set UNJAR_LUCENE4_JAR=%JAR% xf ..\lib\lucene-core-4.7.2.jar && %JAR% xf ..\lib\lucene-lucene-analyzers-common-4.7.2.jar && %JAR% xf ..\lib\lucene-analyzers-kuromoji-4.7.2.jar %JAR% xf ..\lib\lucene-queryparser-4.7.2.jar
     21
    1722set LUCENE3_JAR=.\lib\lucene-core-3.3.0.jar
    1823set MYCLASSPATH3=%LUCENE3_JAR%;%JAVACLASSDIR3%
     24
     25
     26set MYCLASSPATH4=%LUCENE4_JAR%;%JAVACLASSDIR4%
    1927
    2028if "%DEBUG%" == "" (
     
    3341    goto done
    3442
     43:lucene3
     44       if not exist %JAVACLASSDIR3% mkdir %JAVACLASSDIR3%
     45       echo Compiling Greenstone Lucene version 3.x Java classes ...
     46       %JAVAC% -d %JAVACLASSDIR3% -classpath %MYCLASSPATH3% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper3\*.java
     47       cd %JAVACLASSDIR3%
     48       %JAR% xf ..\%LUCENE3_JAR%
     49       cd ..
     50       %JAR% cf LuceneWrapper3.jar -C %JAVACLASSDIR3% .
     51       goto done
     52
     53
    3554:all
    36     if not exist %JAVACLASSDIR3% mkdir %JAVACLASSDIR3%
    37     echo Compiling Greenstone Lucene version 3.x Java classes ...
    38     %JAVAC% -d %JAVACLASSDIR3% -classpath %MYCLASSPATH3% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper3\*.java
    39     cd %JAVACLASSDIR3%
    40     %JAR% xf ..\%LUCENE3_JAR%
     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    cd %JAVACLASSDIR4%
     59    %UNJAR_LUCENE4_JAR%
    4160    cd ..
    42     %JAR% cf LuceneWrapper3.jar -C %JAVACLASSDIR3% .
     61    %JAR% cf LuceneWrapper4.jar -C %JAVACLASSDIR4% .
    4362    goto done
    4463
     
    4867:clean
    4968    echo Cleaning up Greenstone Lucene ...
     69    if exist %JAVACLASSDIR4% rmdir /S /Q %JAVACLASSDIR4%
     70        if exist LuceneWrapper4.jar del LuceneWrapper4.jar
    5071    if exist %JAVACLASSDIR3% rmdir /S /Q %JAVACLASSDIR3%
    5172        if exist LuceneWrapper3.jar del LuceneWrapper3.jar
Note: See TracChangeset for help on using the changeset viewer.