vitro/solr/build.xml

92 lines
3.3 KiB
XML
Raw Normal View History

2011-04-01 16:42:03 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!-- ===========================================
Deploy script for basic solr webapp for use by a vitro webapp.
Vitro should be deployed before this script is run.
=========================================== -->
<project name="vitroSolr" default="describe">
<property name="solr.build.dir" location="."/>
<property name="solr.example.dir" location="${solr.build.dir}/exampleSolr" />
<property name="solr.context.config.example" location="${solr.build.dir}/exampleSolrContext.xml"/>
<property name="solr.war" location="${solr.build.dir}/apache-solr-1.4.1.war"/>
<!-- =================================
target: describe
================================= -->
<target name="describe" description="--> Describe the targets (this is the default).">
<echo>
deploy - Deploy solr service for use by vitro.
</echo>
</target>
<!-- =================================
target: deploy
================================= -->
<target name="deploy" depends="properties" description="Deploy solr service for use by vitro.">
<property name="solr.home" location="${Vitro.home.directory}/solr"/>
<property name="solr.docbase" location="${solr.home}/solr.war"/>
<property name="solr.context.name" value="${webapp.name}solr"/>
<property name="solr.context.config" location="${solr.home}/${solr.context.name}.xml"/>
<!-- Create and copy the example directory to the solr.home directory. -->
<mkdir dir="${solr.home}"/>
<copy todir="${solr.home}">
<fileset dir="${solr.example.dir}" includes="**/*"/>
</copy>
<!-- Add the war file. -->
<copy todir="${solr.docbase}">
<fileset file="${solr.war}"/>
</copy>
<!-- Create the context configuration XML with expanded properties. -->
<copy tofile="${solr.context.config}" filtering="true">
<fileset file="${solr.context.config.example}"/>
<filterchain>
<expandproperties />
</filterchain>
</copy>
<!-- Place context configuration XML in tomcat config directory. -->
2011-04-01 18:55:46 +00:00
<copy todir="${tomcat.home}/conf/Catalina/localhost">
2011-04-01 16:42:03 +00:00
<fileset file="${solr.context.config}"/>
</copy>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: properties
- - - - - - - - - - - - - - - - - -->
<target name="properties">
2011-04-01 18:55:46 +00:00
<!--<property name="deploy.properties.file" location="deploy.properties" /> -->
<fail unless="deploy.properties.file"
message="The ant property deploy.properties.file must be defined to indicate the vitro deploy to create a solr service for." />
<fail message="There is no accessable deploy.properties file at &quot;${deploy.properties.file}&quot;.">
2011-04-01 16:42:03 +00:00
<condition>
<not>
<available file="${deploy.properties.file}" />
</not>
</condition>
</fail>
<property file="${deploy.properties.file}" />
<fail unless="tomcat.home"
message="${deploy.properties.file} must contain a value for tomcat.home" />
<fail unless="webapp.name"
message="${deploy.properties.file} must contain a value for webapp.name" />
<fail unless="Vitro.home.directory"
message="${deploy.properties.file} must contain a value for Vitro.home.directory"/>
</target>
</project>