Index: gs3-extensions/solr/trunk/src/build.xml
===================================================================
--- gs3-extensions/solr/trunk/src/build.xml	(revision 28095)
+++ gs3-extensions/solr/trunk/src/build.xml	(revision 28096)
@@ -3,12 +3,26 @@
 
   <!-- DIRECTORY LOCATIONS -->
+  <!-- local ext paths -->
+  <property name="src.home" value="${basedir}/src/java"/>
+  <property name="build.home" value="${basedir}/build"/>
+
+  <!-- greenstone3 paths -->
   <property name="web.home" value="${basedir}/../../web"/>
   <property name="localsite.collectdir" value="${web.home}/sites/localsite/collect"/>
-  <property name="gsdlsrcdir" value="${basedir}/../../src/java/org/greenstone/gsdl3"/>
-  <property name="ext.gsdlsrcdir" value="${basedir}/src/java/org/greenstone/gsdl3"/>
-  <property name="classesdir" value="${web.home}/WEB-INF/classes"/>
-  <property name="jarwebdir" value="${web.home}/WEB-INF/lib"/>  
+ <property name="web.classesdir" value="${web.home}/WEB-INF/classes"/>
+  <property name="web.libdir" value="${web.home}/WEB-INF/lib"/>  
   <property name="web.extdir" value="${web.home}/ext/solr"/>
-  
+
+  <path id="compile.classpath">
+    <!-- gs3 jar files we need -->
+    <pathelement location="${web.libdir}/gsdl3.jar"/>
+    <pathelement location="${web.libdir}/LuceneWrapper3.jar"/>
+    <pathelement location="${web.libdir}/gson-1.7.1.jar"/>
+    <!-- local jar files -->
+    <fileset dir="lib/java">
+      <include name="*.jar"/>
+    </fileset>
+  </path>
+
   <!-- FILE LISTINGS.-->
   <!-- Created as property elements rather than as filelist elements, since
@@ -29,15 +43,15 @@
   
   <property name="java-service-files" 
-			value="SolrSearch.java		   	
-           GS2SolrSearch.java
-		   GS2SolrRetrieve.java"/>  
+    value="SolrSearch.java		   	
+    GS2SolrSearch.java
+    GS2SolrRetrieve.java"/>  
 		   
   <property name="java-util-files" 
-			value="SolrFacetWrapper.java
-			SolrQueryWrapper.java			
-			SolrQueryResult.java"/>  		   
+    value="SolrFacetWrapper.java
+    SolrQueryWrapper.java			
+    SolrQueryResult.java"/>  		   
   
-  <property name="property-files" 
-			value="SharedSoleneGS2FieldSearch.properties"/>  
+ <!-- <property name="property-files" 
+    value=""/>  -->
 
 			
@@ -51,26 +65,35 @@
   </target>			
   
+  <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">
+    <mkdir dir="${build.home}"/>
+    <javac srcdir="${src.home}"
+      destdir="${build.home}">
+      <classpath>
+	<path refid="compile.classpath"/>
+      </classpath>
+    </javac>
+    <jar destfile="${build.home}/gs3-solr.jar">
+      <fileset dir="${build.home}">
+        <include name="org/greenstone/gsdl3/**"/>
+      </fileset>
+      <manifest>
+        <attribute name="Built-By" value="${user.name}" />
+      </manifest>
+    </jar>
+    <copy file="${build.home}/gs3-solr.jar" todir="${web.libdir}"/>
+  </target>
+  
   <target name="copy-files" description="Helper-target: copy files across for add-service target">
-  
-	<echo>Adding to gsdl3 java code-base: 
-	${ext.gsdlsrcdir}/service's files ${java-service-files} 
-	AND ${ext.gsdlsrcdir}/util's files ${java-util-files}</echo>
-	
-	<copy todir="${gsdlsrcdir}/service">
-          <filelist id="java-src-files-service" dir="${ext.gsdlsrcdir}/service" files="${java-service-files}"/> 
-	</copy>
-	<copy todir="${gsdlsrcdir}/util">
-          <filelist id="java-src-files-util" dir="${ext.gsdlsrcdir}/util" files="${java-util-files}"/>		   
-	</copy>
-	
-	<echo/>
+  	
+    <!-- May want this back if we add in Solr .properties files-->
+<!--	<echo/>
 	<echo>Adding to gsdl3 properties area: properties/${property-files}</echo>
 	<copy todir="${classesdir}">
           <filelist id="prop-files" dir="properties" files="${property-files}"/>
 	</copy>
-
+-->
 	<echo/>
 	<echo>Adding to gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars}</echo>
-	<copy todir="${jarwebdir}">
+	<copy todir="${web.libdir}">
           <filelist id="jar-files" dir="lib/java" files="${jars}"/>
 	</copy>	
@@ -89,5 +112,5 @@
 	
 	<echo/>
-	<echo>Adding example solr-jdbm-demo collection to gsdl3/web/sites/localsite/collect</echo>
+	<echo>Adding example solr-jdbm-demo collection to ${localsite.collectdir}</echo>
 	<copy todir="${localsite.collectdir}/solr-jdbm-demo"
 	      preservelastmodified="true"
@@ -102,5 +125,5 @@
   
   
-  <target name="add-service" depends="copy-files" if="ext.web.exists"
+  <target name="add-service" depends="copy-files,compile" if="ext.web.exists"
 	description="Run this target to setup the Solr extension for Greenstone3">
 	
@@ -121,15 +144,6 @@
 	and can't be deleted therefore -->
 	
-	<echo>Removing from gsdl3 java code-base area:
-	${ext.gsdlsrcdir}/service's files ${java-service-files}
-	AND ${ext.gsdlsrcdir}/util's files ${java-util-files}</echo>	
-	
-	<delete failonerror="false">
-          <filelist dir="${gsdlsrcdir}/service" files="${java-service-files}"/> 
-	</delete>
-	<delete failonerror="false">
-          <filelist dir="${gsdlsrcdir}/util" files="${java-util-files}"/>		   
-	</delete>
-	
+
+<!--	
 	<echo/>
 	<echo>Removing from  gsdl3 properties area: properties/${property-files}</echo>
@@ -137,9 +151,9 @@
           <filelist dir="${classesdir}" files="${property-files}"/>
 	</delete>
-
+-->
 	<echo/>
-	<echo>Removing from gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars}</echo>
+	<echo>Removing from gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars} gs3-solr.jar</echo>
 	<delete failonerror="false">
-          <filelist dir="${jarwebdir}" files="${jars}"/>
+          <filelist dir="${web.libdir}" files="${jars} gs3-solr.jar"/>
 	</delete>	
 	
