Show
Ignore:
Timestamp:
07.10.2011 14:40:20 (9 years ago)
Author:
davidb
Message:

Some additional changes that allow both Lucene 2.x and 3.x be compiled up side-by-site

Location:
main/trunk/greenstone2/common-src/indexers/lucene-gs
Files:
3 modified

Legend:

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

    r23356 r24732  
    44 
    55LUCENE_JAR = ./lib/lucene-core-2.3.2.jar 
     6LUCENE3_JAR = ./lib/lucene-core-3.3.0.jar 
    67 
    78 
     
    1314    classes/org/greenstone/LuceneWrapper/GS2LuceneIndexer.class \ 
    1415    classes/org/greenstone/LuceneWrapper/GS2LuceneQuery.class \ 
    15     classes/org/greenstone/LuceneWrapper/LuceneQueryResult.class \ 
     16    classes/org/greenstone/LuceneWrapper/LuceneQueryResult.class 
     17 
     18LUCENE3_WRAPPER_OBJECTS = \ 
     19    classes3/org/greenstone/LuceneWrapper3/GS2Analyzer.class \ 
     20    classes3/org/greenstone/LuceneWrapper3/GS2IndexModifier.class \ 
     21    classes3/org/greenstone/LuceneWrapper3/GS2LuceneDelete.class \ 
     22    classes3/org/greenstone/LuceneWrapper3/GS2LuceneEditor.class \ 
     23    classes3/org/greenstone/LuceneWrapper3/GS2LuceneIndexer.class \ 
     24    classes3/org/greenstone/LuceneWrapper3/GS2LuceneQuery.class \ 
     25    classes3/org/greenstone/LuceneWrapper3/LuceneQueryResult.class \ 
     26    classes3/org/greenstone/LuceneWrapper3/SharedSoleneQuery.class \ 
     27    classes3/org/greenstone/LuceneWrapper3/SharedSoleneQueryResult.class 
    1628 
    1729LUCENE_WRAPPER_JAR = LuceneWrapper.jar 
    1830 
     31LUCENE3_WRAPPER_JAR = LuceneWrapper3.jar 
    1932 
    20 classes/%.class: src/%.java 
    21     mkdir -p classes && $(JAVAC) $(JAVACFLAGS) -classpath $(LUCENE_JAR):classes:. -d classes -sourcepath src/ src/$*.java 
     33 
     34classes/org/greenstone/LuceneWrapper/%.class: src/org/greenstone/LuceneWrapper/%.java 
     35    mkdir -p classes && $(JAVAC) $(JAVACFLAGS) -classpath $(LUCENE_JAR):classes:. -d classes -sourcepath src/ src/org/greenstone/LuceneWrapper/$*.java 
     36 
     37# For now, drop using JAVACFLAGS in compile line, as it typically sets 
     38# source and target to 1.4, only Lucene 3.x needsd version 1.5 or higher 
     39classes3/org/greenstone/LuceneWrapper3/%.class: src/org/greenstone/LuceneWrapper3/%.java 
     40    mkdir -p classes3 && $(JAVAC) -classpath $(LUCENE3_JAR):classes3:. -d classes3 -sourcepath src/ src/org/greenstone/LuceneWrapper3/$*.java 
    2241 
    2342LuceneWrapper.jar: $(LUCENE_WRAPPER_OBJECTS) 
     
    2544    $(JAR) cf $(LUCENE_WRAPPER_JAR) -C classes . 
    2645 
    27 all: $(LUCENE_WRAPPER_JAR) 
     46LuceneWrapper3.jar: $(LUCENE3_WRAPPER_OBJECTS) 
     47    cd classes3 && jar xf ../$(LUCENE3_JAR) 
     48    $(JAR) cf $(LUCENE3_WRAPPER_JAR) -C classes3 . 
    2849 
    29 install: $(LUCENE_WRAPPER_JAR) 
     50all: $(LUCENE_WRAPPER_JAR) $(LUCENE3_WRAPPER_JAR) 
     51 
     52install: all 
    3053 
    3154clean: 
    3255    /bin/rm -f $(LUCENE_WRAPPER_OBJECTS) $(LUCENE_WRAPPER_JAR) 
     56    /bin/rm -f $(LUCENE3_WRAPPER_OBJECTS) $(LUCENE3_WRAPPER_JAR) 
    3357 
    3458distclean: clean 
    3559    if test -e classes; then /bin/rm -r classes; fi 
    3660    if test -e $(LUCENE_WRAPPER_JAR); then /bin/rm -r $(LUCENE_WRAPPER_JAR); fi 
     61    if test -e classes3; then /bin/rm -r classes3; fi 
     62    if test -e $(LUCENE3_WRAPPER_JAR); then /bin/rm -r $(LUCENE3_WRAPPER_JAR); fi 
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/src/org/greenstone/LuceneWrapper3/GS2LuceneQuery.java

    r24726 r24732  
    4141import org.apache.lucene.search.BooleanQuery.TooManyClauses; 
    4242import org.apache.lucene.search.Filter; 
    43 import org.apache.lucene.search.Hit; 
    44 import org.apache.lucene.search.Hits; 
    4543import org.apache.lucene.search.IndexSearcher; 
    4644import org.apache.lucene.search.Query; 
  • main/trunk/greenstone2/common-src/indexers/lucene-gs/winMake.bat

    r19524 r24732  
    55rem ---- Where to put class files ---- 
    66set JAVACLASSDIR=classes 
     7set JAVACLASSDIR3=classes3 
    78 
    89rem ---- Name and location of java programs ---- 
     
    1718set LUCENE_JAR=.\lib\lucene-core-2.3.2.jar 
    1819set MYCLASSPATH=%LUCENE_JAR%;%JAVACLASSDIR% 
     20 
     21set LUCENE3_JAR=.\lib\lucene-core-3.3.0.jar 
     22set MYCLASSPATH3=%LUCENE3_JAR%;%JAVACLASSDIR3% 
    1923 
    2024if "%DEBUG%" == "" ( 
     
    3539:all 
    3640    if not exist %JAVACLASSDIR% mkdir %JAVACLASSDIR% 
    37     echo Compiling Greenstone Lucene Java classes ... 
     41    echo Compiling Greenstone Lucene version 2.x Java classes ... 
    3842    %JAVAC% -d %JAVACLASSDIR% -classpath %MYCLASSPATH% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper\*.java 
    3943    cd %JAVACLASSDIR% 
     
    4145    cd .. 
    4246    %JAR% cf LuceneWrapper.jar -C %JAVACLASSDIR% . 
     47    echo Compiling Greenstone Lucene version 3.x Java classes ... 
     48    %JAVAC% -d %JAVACLASSDIR3% -classpath %MYCLASSPATH3% %JAVACOPTIONS% -sourcepath src src\org\greenstone\LuceneWrapper3\*.java 
     49    cd %JAVACLASSDIR3% 
     50    %JAR% xf ..\%LUCENE3_JAR% 
     51    cd .. 
     52    %JAR% cf LuceneWrapper3.jar -C %JAVACLASSDIR3% . 
    4353    goto done 
    4454 
     
    5060    if exist %JAVACLASSDIR% rmdir /S /Q %JAVACLASSDIR% 
    5161        if exist LuceneWrapper.jar del LuceneWrapper.jar 
     62    if exist %JAVACLASSDIR3% rmdir /S /Q %JAVACLASSDIR3% 
     63        if exist LuceneWrapper3.jar del LuceneWrapper3.jar 
    5264    goto done  
    5365