Changeset 29711 for gs3-extensions/solr/trunk/src/build.xml
- Timestamp:
- 2015-02-03T21:57:53+13:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gs3-extensions/solr/trunk/src/build.xml
r29707 r29711 9 9 10 10 <!-- greenstone3 paths --> 11 <property name="web.home" value="${basedir}/../../web"/> 11 <!-- http://stackoverflow.com/questions/3136849/how-do-i-convert-a-relative-path-in-ant-to-an-absolute-path 12 http://stackoverflow.com/questions/8295860/pathconvert-with-relative-file-names --> 13 <property name="web.home" location="${basedir}/../../web"/> <!-- location property creates an absolute path --> 12 14 <property name="localsite.collectdir" value="${web.home}/sites/localsite/collect"/> 13 15 <property name="web.classesdir" value="${web.home}/WEB-INF/classes"/> 14 16 <property name="web.libdir" value="${web.home}/WEB-INF/lib"/> 15 17 <property name="web.extdir" value="${web.home}/ext/solr"/> 18 19 <property name="tomcat.dir" location="${basedir}/../../packages/tomcat"/> <!-- location property creates an absolute path --> 20 <property name="tomcat.lib.dir" value="${tomcat.dir}/lib"/> 21 <property name="tomcat.context.dir" value="${tomcat.dir}/conf/Catalina/localhost"/> 16 22 17 23 <path id="compile.classpath"> … … 25 31 <include name="*.jar"/> 26 32 </fileset> 33 <pathelement location="lib/servlet-api-3.0.jar"/> 27 34 </path> 35 28 36 29 37 <!-- FILE LISTINGS.--> … … 149 157 <echo>Unzipping pre-built index</echo> 150 158 <unzip dest="${localsite.collectdir}/solr-jdbm-demo" src="${localsite.collectdir}/solr-jdbm-demo/index.zip" /> 151 152 153 </target> 154 159 </target> 160 161 <!-- Setting up solr to work with tomcat server instead of jetty server --> 162 <target name="solr-for-tomcat" description="Helper-target: setting up solr to work tomcat"> 163 164 <echo>Copying solr jars needed for running solr with tomcat: ${basedir}/lib/ext</echo> 165 <copy todir="${tomcat.lib.dir}"> 166 <fileset dir="lib/ext"> 167 <include name="*.jar"/> 168 </fileset> 169 </copy> 170 171 <!-- slf4j and commons logging bridge needed to avoid exception about incompatibility in tomcat log files--> 172 <echo>Copying ${basedir}/lib/ext/jcl-over-slf4j-1.6.6.jar again to ${web.libdir}</echo> 173 <copy todir="${web.libdir}"> 174 <filelist id="logging-bridge" dir="lib/ext" files="jcl-over-slf4j-1.6.6.jar"/> 175 </copy> 176 177 <echo>Moving xalan related jar files from ${web.libdir} to ${tomcat.lib.dir}, to share with solr</echo> 178 <move todir="${tomcat.lib.dir}"> 179 <filelist dir="${web.libdir}"> 180 <file name="xalan.jar"/> 181 <file name="xercesImpl.jar"/> 182 <file name="xml-apis.jar"/> 183 <file name="xsltc.jar"/> 184 <file name="serializer.jar"/> 185 </filelist> 186 </move> 187 188 <echo>Copying ${basedir}/webapps/solr.war to ${tomcat.dir}/webapps</echo> 189 <copy todir="${tomcat.dir}/webapps" file="webapps/solr.war" /> 190 <echo>Generating solr context file in ${tomcat.context.dir}</echo> 191 192 <!-- we want unix paths (forward slashes) in the tomcat context file --> 193 <pathconvert targetos="unix" property="gsdl3.web.home"> 194 <path path="${web.home}"/><!-- creates an absolute path--> 195 </pathconvert> 196 <pathconvert targetos="unix" property="tomcat.home"> 197 <path path="${tomcat.dir}"/><!-- creates an absolute path--> 198 </pathconvert> 199 <filter token="gsdl3home" value="${gsdl3.web.home}"/> 200 <filter token="tomcathome" value="${tomcat.home}"/> 201 <copy file="solr-tomcat-context.xml.in" tofile="${tomcat.context.dir}/solr.xml" filtering="true" overwrite="true"/> 202 203 </target> 155 204 156 205 <!-- copy the content of the web folder (avoiding the top-level .svn directory) --> … … 165 214 </target> 166 215 167 <target name="add-service" depends="copy-solr-web,copy-files,compile" description="Run this target to setup the Solr extension for Greenstone3" /> 168 169 170 <target name="del-service" 171 description="Run this target to unset the Solr extension for Greenstone3"> 172 216 217 <target name="add-service" depends="copy-solr-web,copy-files,solr-for-tomcat,compile" description="Run this target to setup the Solr extension for Greenstone3" /> 218 219 <target name="del-service" depends="del-files,del-solr-for-tomcat" 220 description="Run this target to unset the Solr extension for Greenstone3" /> 221 222 223 <target name="del-files" description="Helper-target to delete files for del-service target"> 173 224 <!-- failonerror is set to false in case some files don't exist 174 225 and can't be deleted therefore --> 175 176 177 178 <echo/> 179 <echo>Removing from gsdl3 properties area: properties/${property-files}</echo> 226 227 <echo/> 228 <echo>Removing from gsdl3 properties area: properties/${property-files}</echo> 180 229 <delete failonerror="false"> 181 230 <filelist dir="${web.classesdir}" files="${property-files}"/> … … 194 243 <echo/> 195 244 <echo>Removing solr-jdbm-demo collection from: ${localsite.collectdir}</echo> 196 <delete failonerror="false" includeEmptyDirs="true" dir="${localsite.collectcdir}/solr-jdbm-demo"/> 197 245 <delete failonerror="false" includeEmptyDirs="true" dir="${localsite.collectcdir}/solr-jdbm-demo"/> 246 247 </target> 248 249 <target name="del-solr-for-tomcat" description="Helper-target to remove files for getting solr to work with tomcat"> 250 251 <echo/> 252 <echo>Removing solr modifications to tomcat: context file, solr.war and deployed version, jar files</echo> 253 254 <!-- Actually need to ensure tomcat is not running at this point 255 But if solr.war is deleted first, it can't be re-deployed when deleting the solr folder subsequently 256 --> 257 <delete failonerror="false" file="${tomcat.dir}/webapps/solr.war"/> 258 <delete failonerror="false" includeEmptyDirs="true" dir="${tomcat.dir}/webapps/solr"/> 259 260 <delete failonerror="false" file="${tomcat.context.dir}/solr.xml"/> 261 262 <!-- delete all the jar files in tomcat/lib that were copied from ext/solr/lib/ext 263 which are all the jar files that are present in both tomcat/lib and ext/solr/lib/ext 264 https://ant.apache.org/manual/Types/selectors.html#presentselect --> 265 <delete failonerror="false"> 266 <fileset dir="${tomcat.lib.dir}" includes="**/*.jar"> 267 <present present="both" targetdir="lib/ext"/> 268 </fileset> 269 </delete> 270 271 <!-- remove logging bridge jar file that was added into greenstone 3 web lib area --> 272 <delete failonerror="false" file="${web.libdir}/jcl-over-slf4j-1.6.6.jar"/> 273 274 <!-- moving shared xalan related jar files back from tomcat lib to GS3 web lib --> 275 <move todir="${web.libdir}"> 276 <filelist dir="${tomcat.lib.dir}"> 277 <file name="xalan.jar"/> 278 <file name="xercesImpl.jar"/> 279 <file name="xml-apis.jar"/> 280 <file name="xsltc.jar"/> 281 <file name="serializer.jar"/> 282 </filelist> 283 </move> 284 285 <!--http://stackoverflow.com/questions/2140637/how-do-i-build-a-list-of-file-names--> 198 286 </target> 199 287
Note:
See TracChangeset
for help on using the changeset viewer.