| <!-- |
| 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="7.6.2"/> |
| <property name="elasticsearch.mapper-attachments.version" value="3.1.2"/> |
| |
| <condition property="isWindows"> |
| <os family="windows" /> |
| </condition> |
| <condition property="isUnix"> |
| <os family="unix" /> |
| </condition> |
| |
| <target name="download-elasticsearch-unix" if="isUnix"> |
| <mkdir dir="build/download"/> |
| <get src="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${elasticsearch.version}-linux-x86_64.tar.gz" |
| dest="build/download/elasticsearch.tar.gz"/> |
| <gunzip src="build/download/elasticsearch.tar.gz"/> |
| <mkdir dir="test-materials/unix"/> |
| <untar src="build/download/elasticsearch.tar" dest="test-materials/unix"/> |
| <chmod dir="test-materials/unix/elasticsearch-${elasticsearch.version}" perm="ugo+rxw"> |
| <fileset dir="**/*"/> |
| </chmod> |
| <chmod file="test-materials/unix/elasticsearch-${elasticsearch.version}/bin/elasticsearch" perm="ugo+rx"/> |
| |
| </target> |
| |
| <target name="download-elasticsearch-windows" if="isWindows"> |
| <mkdir dir="build/download"/> |
| <get src="https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-${elasticsearch.version}-windows-x86_64.zip" |
| dest="build/download/elasticsearch.zip"/> |
| <mkdir dir="test-materials/windows"/> |
| <unzip src="build/download/elasticsearch.zip" dest="test-materials/windows"/> |
| </target> |
| |
| <target name="download-elasticsearch" depends="download-elasticsearch-unix,download-elasticsearch-windows"> |
| </target> |
| |
| <target name="download-dependencies" depends="download-elasticsearch"> |
| </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-unix" if="isUnix"> |
| <available file="test-materials/unix/elasticsearch-${elasticsearch.version}" property="tests-present"/> |
| </target> |
| |
| <target name="calculate-testcode-condition-windows" if="isWindows"> |
| <available file="test-materials/windows/elasticsearch-${elasticsearch.version}" property="tests-present"/> |
| </target> |
| |
| <target name="calculate-testcode-condition" depends="calculate-testcode-condition-unix,calculate-testcode-condition-windows"> |
| </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> |
| |
| <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> |