| <!-- |
| Licensed to the Apache Software Foundation (ASF) under one or more |
| contributor license agreements. See the NOTICE file distributed with |
| this work for additional information regarding copyright ownership. |
| The ASF licenses this file to You under the Apache License, Version 2.0 |
| (the "License"); you may not use this file except in compliance with |
| the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
| --> |
| |
| <project name="mcf-solr-4.x-plugin" default="help"> |
| |
| <target name="clean"> |
| <delete> |
| <fileset dir="." includes="apache-manifoldcf-solr-4.x-plugin-*"/> |
| </delete> |
| <delete dir="solr"/> |
| <delete dir="dist"/> |
| </target> |
| |
| <target name="download-solr"> |
| <mkdir dir="download" /> |
| <!-- Download and unpack binary artifact --> |
| <get src="http://archive.apache.org/dist/lucene/solr/4.6.1/solr-4.6.1-src.tgz" dest="download/solr.tgz"/> |
| <untar src="download/solr.tgz" dest="download/solr" compression="gzip"/> |
| </target> |
| |
| <target name="make-deps" depends="download-solr"> |
| </target> |
| |
| <target name="clean-deps"> |
| <delete dir="download"/> |
| </target> |
| |
| <target name="downloaded-condition"> |
| <available file="download/solr/solr-4.6.1/README.txt" property="CHANGES-found"/> |
| <condition property="downloaded"> |
| <and> |
| <isset property="CHANGES-found"/> |
| </and> |
| </condition> |
| </target> |
| |
| <target name="downloaded-check" depends="downloaded-condition" unless="downloaded"> |
| <echo message="Run 'make-deps' target first"/> |
| </target> |
| |
| <target name="copy-solr" depends="downloaded-check" if="downloaded"> |
| <copy todir="solr"> |
| <fileset dir="download/solr/solr-4.6.1"/> |
| </copy> |
| </target> |
| |
| <target name="copy-sources" depends="copy-solr" if="downloaded"> |
| <mkdir dir="solr/solr/contrib/mcf"/> |
| <copy todir="solr/solr/contrib/mcf"> |
| <fileset dir="mcf"> |
| <include name="**/*"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="compile" depends="copy-sources" if="downloaded"> |
| <ant dir="solr/solr/contrib/mcf" target="default"/> |
| </target> |
| |
| <target name="test" depends="copy-sources" if="downloaded"> |
| <ant dir="solr/solr/contrib/mcf" target="test"/> |
| </target> |
| |
| <target name="deliver" depends="compile" if="downloaded"> |
| <mkdir dir="dist"/> |
| <copy todir="dist"> |
| <fileset dir="solr/solr/build/contrib/solr-mcf"> |
| <include name="*.jar"/> |
| </fileset> |
| <fileset dir="mcf"> |
| <include name="README.txt"/> |
| <include name="NOTICE.txt"/> |
| <include name="DEPENDENCIES.txt"/> |
| <include name="LICENSE.txt"/> |
| </fileset> |
| </copy> |
| </target> |
| |
| <target name="build" depends="deliver" if="downloaded"/> |
| |
| <target name="set-version"> |
| <property name="release-version" value="1.2"/> |
| </target> |
| |
| <target name="create-source-zip" depends="set-version"> |
| <zip destfile="apache-manifoldcf-solr-4.x-plugin-${release-version}-src.zip" update="false"> |
| <zipfileset dir="." prefix="apache-manifoldcf-solr-4.x-plugin-${release-version}"> |
| <exclude name="/download/"/> |
| <exclude name="/solr/"/> |
| <exclude name="/dist/"/> |
| <exclude name="/apache-manifoldcf-solr-4.x-plugin-*"/> |
| </zipfileset> |
| </zip> |
| </target> |
| |
| <target name="create-source-tar" depends="set-version"> |
| <tar destfile="apache-manifoldcf-solr-4.x-plugin-${release-version}-src.tar.gz" compression="gzip" longfile="gnu"> |
| <tarfileset dir="." prefix="apache-manifoldcf-solr-4.x-plugin-${release-version}"> |
| <exclude name="/download/"/> |
| <exclude name="/solr/"/> |
| <exclude name="/dist/"/> |
| <exclude name="/apache-manifoldcf-solr-4.x-plugin-*"/> |
| </tarfileset> |
| </tar> |
| </target> |
| |
| <target name="create-bin-zip" depends="build,set-version" if="downloaded"> |
| <zip destfile="apache-manifoldcf-solr-4.x-plugin-${release-version}-bin.zip" update="false"> |
| <zipfileset dir="dist" prefix="apache-manifoldcf-solr-4.x-plugin-${release-version}"> |
| </zipfileset> |
| </zip> |
| </target> |
| |
| <target name="create-bin-tar" depends="build,set-version" if="downloaded"> |
| <tar destfile="apache-manifoldcf-solr-4.x-plugin-${release-version}-bin.tar.gz" compression="gzip" longfile="gnu"> |
| <tarfileset dir="dist" prefix="apache-manifoldcf-solr-4.x-plugin-${release-version}"> |
| </tarfileset> |
| </tar> |
| </target> |
| |
| <target name="image" depends="create-source-zip,create-source-tar,create-bin-zip,create-bin-tar" if="downloaded"/> |
| |
| <target name="help"> |
| <echo level="info"> |
| Apache ManifoldCF Solr 4.x Plugin build file. Use this file to |
| build the plugin distributables and run the tests. |
| |
| Useful targets are: |
| |
| clean-deps - Clean dependencies |
| make-deps - Download dependencies |
| clean - Clean the build area |
| build - Build jar under the 'dist' directory |
| test - Run the tests |
| image - Package the sources and binaries |
| |
| Prerequisites: This build Java jdk1.6.0 or above, |
| and Apache Ivy 2.2 or above. |
| </echo> |
| </target> |
| |
| <target name="-taskdef"> |
| <typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks"> |
| <classpath> |
| <fileset dir="." includes="rat*.jar"/> |
| </classpath> |
| </typedef> |
| </target> |
| <target name="rat-sources" depends="-taskdef" |
| description="runs the tasks over src/java excluding the license directory"> |
| <rat:report xmlns:rat="antlib:org.apache.rat.anttasks"> |
| <fileset dir="mcf/"> |
| <exclude name="CHANGES.txt"/> |
| </fileset> |
| </rat:report> |
| </target> |
| |
| </project> |