| <!-- |
| 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="elasticsearch" default="all"> |
| |
| <property environment="env"/> |
| <condition property="mcf-dist" value="${env.MCFDISTPATH}"> |
| <isset property="env.MCFDISTPATH"/> |
| </condition> |
| <property name="abs-dist" location="../../dist"/> |
| <condition property="mcf-dist" value="${abs-dist}"> |
| <not> |
| <isset property="env.MCFDISTPATH"/> |
| </not> |
| </condition> |
| |
| <import file="${mcf-dist}/connector-build.xml"/> |
| |
| <property name="elasticsearch.version" value="1.0.1"/> |
| |
| <target name="download-dependencies"> |
| |
| <mkdir dir="build/download"/> |
| <get src="http://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${elasticsearch.version}.tar.gz" |
| dest="build/download/elasticsearch.tar.gz"/> |
| <gunzip src="build/download/elasticsearch.tar.gz"/> |
| <untar src="build/download/elasticsearch.tar" dest="test-materials"/> |
| |
| <!-- download and install the attachment plugin --> |
| <mkdir dir="test-materials/elasticsearch-${elasticsearch.version}/plugins"/> |
| |
| <get src="https://github.com/elasticsearch/elasticsearch-mapper-attachments/archive/v2.0.0.RC1.zip" |
| dest="test-materials/elasticsearch-${elasticsearch.version}/plugins/mapper-attachments.zip"/> |
| |
| <unzip src="test-materials/elasticsearch-${elasticsearch.version}/plugins/mapper-attachments.zip" dest="test-materials/elasticsearch-${elasticsearch.version}/plugins/mapper-attachments"/> |
| |
| <chmod dir="test-materials/elasticsearch-${elasticsearch.version}" perm="ugo+rxw"> |
| <fileset dir="**/*"/> |
| </chmod> |
| <chmod file="test-materials/elasticsearch-${elasticsearch.version}/bin/plugin" perm="ugo+rx"/> |
| <chmod file="test-materials/elasticsearch-${elasticsearch.version}/bin/elasticsearch" perm="ugo+rx"/> |
| <chmod file="test-materials/elasticsearch-${elasticsearch.version}/bin/elasticsearch.in.sh" perm="ugo+rx"/> |
| |
| </target> |
| |
| <target name="download-cleanup"> |
| <delete> |
| <fileset dir="test-materials" excludes="README*.txt"/> |
| </delete> |
| </target> |
| |
| <target name="integration"> |
| <mkdir dir="dist/integration/elasticsearch"/> |
| <copy todir="dist/integration/elasticsearch"> |
| <fileset dir="../../lib/elasticsearch"/> |
| </copy> |
| <mkdir dir="dist/integration/elasticsearch-1.5"/> |
| <copy todir="dist/integration/elasticsearch-1.5"> |
| <fileset dir="../../lib/elasticsearch-1.5"/> |
| </copy> |
| </target> |
| |
| <target name="calculate-testcode-condition"> |
| <available file="test-materials/elasticsearch-${elasticsearch.version}" property="tests-present"/> |
| </target> |
| |
| <target name="pretest-warn" depends="calculate-testcode-condition" unless="tests-present"> |
| <echo message="Need ElasticSearch download in order to compile tests - run ant make-deps"/> |
| </target> |
| |
| <path id="connector-test-classpath"> |
| <path refid="mcf-connector-build.connector-test-classpath"/> |
| <fileset dir="test-materials/elasticsearch-${elasticsearch.version}"> |
| <include name="lib/*.jar"/> |
| <include name="plugins/mapper-attachments/*.jar"/> |
| </fileset> |
| </path> |
| |
| <target name="deliver-connector" depends="mcf-connector-build.deliver-connector"> |
| <antcall target="general-add-output-connector"> |
| <param name="connector-label" value="ElasticSearch"/> |
| <param name="connector-class" value="org.apache.manifoldcf.agents.output.elasticsearch.ElasticSearchConnector"/> |
| </antcall> |
| </target> |
| |
| </project> |