Changeset 28096

Show
Ignore:
Timestamp:
20.08.2013 14:05:33 (6 years ago)
Author:
kjdon
Message:

now compile up solr-gs3 java classes into build dir in ext folder, and just copy jar file into greenstone3.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • gs3-extensions/solr/trunk/src/build.xml

    r27857 r28096  
    33 
    44  <!-- DIRECTORY LOCATIONS --> 
     5  <!-- local ext paths --> 
     6  <property name="src.home" value="${basedir}/src/java"/> 
     7  <property name="build.home" value="${basedir}/build"/> 
     8 
     9  <!-- greenstone3 paths --> 
    510  <property name="web.home" value="${basedir}/../../web"/> 
    611  <property name="localsite.collectdir" value="${web.home}/sites/localsite/collect"/> 
    7   <property name="gsdlsrcdir" value="${basedir}/../../src/java/org/greenstone/gsdl3"/> 
    8   <property name="ext.gsdlsrcdir" value="${basedir}/src/java/org/greenstone/gsdl3"/> 
    9   <property name="classesdir" value="${web.home}/WEB-INF/classes"/> 
    10   <property name="jarwebdir" value="${web.home}/WEB-INF/lib"/>   
     12 <property name="web.classesdir" value="${web.home}/WEB-INF/classes"/> 
     13  <property name="web.libdir" value="${web.home}/WEB-INF/lib"/>   
    1114  <property name="web.extdir" value="${web.home}/ext/solr"/> 
    12    
     15 
     16  <path id="compile.classpath"> 
     17    <!-- gs3 jar files we need --> 
     18    <pathelement location="${web.libdir}/gsdl3.jar"/> 
     19    <pathelement location="${web.libdir}/LuceneWrapper3.jar"/> 
     20    <pathelement location="${web.libdir}/gson-1.7.1.jar"/> 
     21    <!-- local jar files --> 
     22    <fileset dir="lib/java"> 
     23      <include name="*.jar"/> 
     24    </fileset> 
     25  </path> 
     26 
    1327  <!-- FILE LISTINGS.--> 
    1428  <!-- Created as property elements rather than as filelist elements, since 
     
    2943   
    3044  <property name="java-service-files"  
    31             value="SolrSearch.java           
    32            GS2SolrSearch.java 
    33            GS2SolrRetrieve.java"/>   
     45    value="SolrSearch.java           
     46    GS2SolrSearch.java 
     47    GS2SolrRetrieve.java"/>   
    3448            
    3549  <property name="java-util-files"  
    36             value="SolrFacetWrapper.java 
    37             SolrQueryWrapper.java            
    38             SolrQueryResult.java"/>             
     50    value="SolrFacetWrapper.java 
     51    SolrQueryWrapper.java            
     52    SolrQueryResult.java"/>             
    3953   
    40   <property name="property-files"  
    41             value="SharedSoleneGS2FieldSearch.properties"/>   
     54 <!-- <property name="property-files"  
     55    value=""/>  --> 
    4256 
    4357             
     
    5165  </target>          
    5266   
     67  <target name="compile" description="Compile up the solr java classes, jar them up, and install gs3-solr.jar into Greenstone's web/WEB-INF/lib dir"> 
     68    <mkdir dir="${build.home}"/> 
     69    <javac srcdir="${src.home}" 
     70      destdir="${build.home}"> 
     71      <classpath> 
     72    <path refid="compile.classpath"/> 
     73      </classpath> 
     74    </javac> 
     75    <jar destfile="${build.home}/gs3-solr.jar"> 
     76      <fileset dir="${build.home}"> 
     77        <include name="org/greenstone/gsdl3/**"/> 
     78      </fileset> 
     79      <manifest> 
     80        <attribute name="Built-By" value="${user.name}" /> 
     81      </manifest> 
     82    </jar> 
     83    <copy file="${build.home}/gs3-solr.jar" todir="${web.libdir}"/> 
     84  </target> 
     85   
    5386  <target name="copy-files" description="Helper-target: copy files across for add-service target"> 
    54    
    55     <echo>Adding to gsdl3 java code-base:  
    56     ${ext.gsdlsrcdir}/service's files ${java-service-files}  
    57     AND ${ext.gsdlsrcdir}/util's files ${java-util-files}</echo> 
    58      
    59     <copy todir="${gsdlsrcdir}/service"> 
    60           <filelist id="java-src-files-service" dir="${ext.gsdlsrcdir}/service" files="${java-service-files}"/>  
    61     </copy> 
    62     <copy todir="${gsdlsrcdir}/util"> 
    63           <filelist id="java-src-files-util" dir="${ext.gsdlsrcdir}/util" files="${java-util-files}"/>          
    64     </copy> 
    65      
    66     <echo/> 
     87     
     88    <!-- May want this back if we add in Solr .properties files--> 
     89<!--    <echo/> 
    6790    <echo>Adding to gsdl3 properties area: properties/${property-files}</echo> 
    6891    <copy todir="${classesdir}"> 
    6992          <filelist id="prop-files" dir="properties" files="${property-files}"/> 
    7093    </copy> 
    71  
     94--> 
    7295    <echo/> 
    7396    <echo>Adding to gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars}</echo> 
    74     <copy todir="${jarwebdir}"> 
     97    <copy todir="${web.libdir}"> 
    7598          <filelist id="jar-files" dir="lib/java" files="${jars}"/> 
    7699    </copy>  
     
    89112     
    90113    <echo/> 
    91     <echo>Adding example solr-jdbm-demo collection to gsdl3/web/sites/localsite/collect</echo> 
     114    <echo>Adding example solr-jdbm-demo collection to ${localsite.collectdir}</echo> 
    92115    <copy todir="${localsite.collectdir}/solr-jdbm-demo" 
    93116          preservelastmodified="true" 
     
    102125   
    103126   
    104   <target name="add-service" depends="copy-files" if="ext.web.exists" 
     127  <target name="add-service" depends="copy-files,compile" if="ext.web.exists" 
    105128    description="Run this target to setup the Solr extension for Greenstone3"> 
    106129     
     
    121144    and can't be deleted therefore --> 
    122145     
    123     <echo>Removing from gsdl3 java code-base area: 
    124     ${ext.gsdlsrcdir}/service's files ${java-service-files} 
    125     AND ${ext.gsdlsrcdir}/util's files ${java-util-files}</echo>     
    126      
    127     <delete failonerror="false"> 
    128           <filelist dir="${gsdlsrcdir}/service" files="${java-service-files}"/>  
    129     </delete> 
    130     <delete failonerror="false"> 
    131           <filelist dir="${gsdlsrcdir}/util" files="${java-util-files}"/>           
    132     </delete> 
    133      
     146 
     147<!--     
    134148    <echo/> 
    135149    <echo>Removing from  gsdl3 properties area: properties/${property-files}</echo> 
     
    137151          <filelist dir="${classesdir}" files="${property-files}"/> 
    138152    </delete> 
    139  
     153--> 
    140154    <echo/> 
    141     <echo>Removing from gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars}</echo> 
     155    <echo>Removing from gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars} gs3-solr.jar</echo> 
    142156    <delete failonerror="false"> 
    143           <filelist dir="${jarwebdir}" files="${jars}"/> 
     157          <filelist dir="${web.libdir}" files="${jars} gs3-solr.jar"/> 
    144158    </delete>    
    145159