source: gs3-extensions/solr/trunk/src/build.xml@ 29139

Last change on this file since 29139 was 29139, checked in by ak19, 6 years ago

Part of port from lucene3.3.0 to lucene4.7.2. Solr related. Updating webapps/solr.war file from 3.3 to 4.7.2. Updating build.xml file, and the two text files, one listing the source files and the other listing the jar files. Adding new contexts folder for solr4.7.2. Updated test folder with the correct classpath for solr 4.7.2.

File size: 7.0 KB
Line 
1<?xml version="1.0"?>
2<project name="gs3-solr-ext" default="usage" basedir=".">
3
4 <!-- 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 -->
10 <property name="web.home" value="${basedir}/../../web"/>
11 <property name="localsite.collectdir" value="${web.home}/sites/localsite/collect"/>
12 <property name="web.classesdir" value="${web.home}/WEB-INF/classes"/>
13 <property name="web.libdir" value="${web.home}/WEB-INF/lib"/>
14 <property name="web.extdir" value="${web.home}/ext/solr"/>
15
16 <path id="compile.classpath">
17 <!-- gs3 jar files we need -->
18 <pathelement location="${web.libdir}/gsdl3.jar"/>
19 <pathelement location="${web.libdir}/gutil.jar"/>
20 <pathelement location="${web.libdir}/LuceneWrapper4.jar"/>
21 <pathelement location="${web.libdir}/gson-1.7.1.jar"/>
22 <!-- local jar files -->
23 <fileset dir="lib/java">
24 <include name="*.jar"/>
25 </fileset>
26 </path>
27
28 <!-- FILE LISTINGS.-->
29 <!-- Created as property elements rather than as filelist elements, since
30 they can then be reused for the add-service and delete-service targets. -->
31 <property name="jars"
32 value="solr-core-4.7.2.jar
33 solr-solrj-4.7.2.jar
34 lucene-core-4.7.2.jar
35 lucene-analyzers-common-4.7.2.jar
36 lucene-analyzers-kuromoji-4.7.2.jar
37 lucene-analyzers-phonetic-4.7.2.jar
38 lucene-grouping-4.7.2.jar
39 lucene-highlighter-4.7.2.jar
40 lucene-queries-4.7.2.jar
41 lucene-queryparser-4.7.2.jar
42 lucene-memory-4.7.2.jar
43 lucene-misc-4.7.2.jar
44 lucene-spatial-4.7.2.jar
45 lucene-suggest-4.7.2.jar
46 httpclient-4.3.1.jar
47 httpcore-4.3.jar
48 httpmime-4.3.1.jar
49 commons-fileupload-1.2.1.jar
50 commons-io-2.1.jar
51 commons-lang-2.6.jar
52 velocity-1.6.1.jar
53 log4j-over-slf4j-1.6.6.jar
54 slf4j-api-1.6.6.jar
55 slf4j-jdk14-1.6.6.jar
56 spatial4j-0.4.1.jar
57 zookeeper-3.4.5.jar
58 guava 14.0.1"/>
59<!-- jcl-over-slf4j-1.6.6.jar
60 jul-to-slf4j-1.6.6.jar
61 log4j-1.2.16.jar
62 wstx-asl-3.2.7.jar
63-->
64<!--
65 lucene-spellchecker-3.3.0.jar replaced with lucene-suggest-4.7.2.jar, since both contain packages org/.../spell and org/.../suggest
66
67 commons-fileupload-1.2.1.jar - in solr war file
68 velocity-1.6.1.jar
69 log4j-over-slf4j-1.6.1.jar - have to download slf4j jar file for version 1.6.6
70 slf4j-jdk14-1.6.1.jar - have to download slf4j jar file for version 1.6.6
71 -->
72
73 <property name="java-service-files"
74 value="SolrSearch.java
75 GS2SolrSearch.java
76 GS2SolrRetrieve.java"/>
77
78 <property name="java-util-files"
79 value="SolrFacetWrapper.java
80 SolrQueryWrapper.java
81 SolrQueryResult.java"/>
82
83 <!-- <property name="property-files"
84 value=""/> -->
85
86
87 <!-- TARGETS -->
88 <target name="usage" description="Print a help message">
89 <echo message=" Execute 'ant -projecthelp' for a list of targets."/>
90 <echo message=" Execute 'ant -help' for Ant help."/>
91 <echo>To install the Solr extension for Greenstone3, run 'ant add-service'.
92 To remove the files and folders installed by add-service, run 'ant del-service'.
93 </echo>
94 </target>
95
96 <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">
97 <mkdir dir="${build.home}"/>
98 <javac srcdir="${src.home}" destdir="${build.home}" debug="true">
99 <classpath>
100 <path refid="compile.classpath"/>
101 </classpath>
102 </javac>
103 <jar destfile="${build.home}/gs3-solr.jar">
104 <fileset dir="${build.home}">
105 <include name="org/greenstone/gsdl3/**"/>
106 </fileset>
107 <manifest>
108 <attribute name="Built-By" value="${user.name}" />
109 </manifest>
110 </jar>
111 <copy file="${build.home}/gs3-solr.jar" todir="${web.libdir}"/>
112 </target>
113
114 <target name="copy-files" description="Helper-target: copy files across for add-service target">
115
116 <!-- May want this back if we add in Solr .properties files-->
117<!-- <echo/>
118 <echo>Adding to gsdl3 properties area: properties/${property-files}</echo>
119 <copy todir="${classesdir}">
120 <filelist id="prop-files" dir="properties" files="${property-files}"/>
121 </copy>
122-->
123 <echo/>
124 <echo>Adding to gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars}</echo>
125 <copy todir="${web.libdir}">
126 <filelist id="jar-files" dir="lib/java" files="${jars}"/>
127 </copy>
128
129 <echo/>
130 <echo>Creating web extension directory: ${web.extdir}</echo>
131 <mkdir dir="${web.extdir}"/>
132
133 <echo/>
134 <echo>Adding to gsdl3 web solr ext directory: solr.xml and solr.xml.in</echo>
135 <copy file="solr.xml.in" tofile="${web.extdir}/solr.xml.in"/>
136 <pathconvert targetos="unix" property="src.gsdl3.home.unix">
137 <path path="../../web"/>
138 </pathconvert>
139 <filter token="gsdl3home" value="${src.gsdl3.home.unix}"/>
140 <copy file="solr.xml.in" tofile="${web.extdir}/solr.xml" filtering="true" overwrite="true"/>
141
142 <echo/>
143 <echo>Adding example solr-jdbm-demo collection to ${localsite.collectdir}</echo>
144 <copy todir="${localsite.collectdir}/solr-jdbm-demo"
145 preservelastmodified="true"
146 failonerror="true" >
147 <fileset dir="${basedir}/collect/solr-jdbm-demo" includes="**"/>
148 </copy>
149 <echo>Unzipping pre-built index</echo>
150 <unzip dest="${localsite.collectdir}/solr-jdbm-demo" src="${localsite.collectdir}/solr-jdbm-demo/index.zip" />
151
152 <!-- copy the content of the web folder (avoiding the top-level .svn directory) -->
153 <available property="ext.web.exists" file="${basedir}/web" type="dir" />
154
155 </target>
156
157 <target name="add-service" depends="copy-files,compile"
158 description="Run this target to setup the Solr extension for Greenstone3"> <!--if="ext.web.exists"-->
159
160 <echo/>
161 <echo>Copy to gsdl3 web: the content of the ${basedir}/web folder (excluding .svn)</echo>
162 <copy todir="${web.extdir}">
163 <dirset dir="${basedir}/web">
164 <exclude name=".svn"/>
165 </dirset>
166 </copy>
167
168 </target>
169
170 <target name="del-service"
171 description="Run this target to unset the Solr extension for Greenstone3">
172
173 <!-- failonerror is set to false in case some files don't exist
174 and can't be deleted therefore -->
175
176
177<!--
178 <echo/>
179 <echo>Removing from gsdl3 properties area: properties/${property-files}</echo>
180 <delete failonerror="false">
181 <filelist dir="${classesdir}" files="${property-files}"/>
182 </delete>
183-->
184 <echo/>
185 <echo>Removing from gsdl3 web jar lib directory: ${basedir}/lib/java's ${jars} gs3-solr.jar</echo>
186 <delete failonerror="false">
187 <filelist dir="${web.libdir}" files="${jars} gs3-solr.jar"/>
188 </delete>
189
190 <echo/>
191 <echo>Removing web solr extension directory: ${web.extdir}</echo>
192 <delete failonerror="false" includeEmptyDirs="true" dir="${web.extdir}"/>
193
194 <echo/>
195 <echo>Removing solr-jdbm-demo collection from: ${localsite.collectdir}</echo>
196 <delete failonerror="false" includeEmptyDirs="true" dir="${localsite.collectcdir}/solr-jdbm-demo"/>
197
198 </target>
199
200</project>
Note: See TracBrowser for help on using the repository browser.