lucene/contrib/contrib-build.xml

107 lines
3.9 KiB
XML
Raw Normal View History

<?xml version="1.0"?>
<!--
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="contrib-build" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<echo>Building ${ant.project.name}...</echo>
<!-- TODO: adjust build.dir/dist.dir appropriately when a contrib project is run individually -->
<property name="build.dir" location="../../build/contrib/${ant.project.name}"/>
<property name="dist.dir" location="../../dist/contrib/${ant.project.name}"/>
<property name="maven.dist.dir" location="../../dist/maven"/>
<import file="../common-build.xml"/>
<property name="lucene.jar" location="${common.dir}/build/lucene-core-${version}.jar"/>
<available property="lucene.jar.present" type="file" file="${lucene.jar}"/>
<available property="lucene.tests.present" type="dir"
file="${common.dir}/build/classes/test" />
<available property="contrib.has.tests" type="dir" file="src/test" />
<path id="classpath">
<pathelement path="${lucene.jar}"/>
<pathelement path="${project.classpath}"/>
</path>
<path id="test.classpath">
<path refid="classpath"/>
<pathelement location="../../build/classes/test/"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/java"/>
</path>
<path id="junit.classpath">
<path refid="test.classpath"/>
<pathelement location="${build.dir}/classes/test"/>
<pathelement location="${build.dir}/classes/java"/>
<pathelement path="${java.class.path}"/>
</path>
<target name="build-lucene" unless="lucene.jar.present">
<ant dir="${common.dir}" target="jar-core" inheritAll="false"/>
</target>
<target name="build-lucene-tests" unless="lucene.tests.present">
<ant dir="${common.dir}" target="compile-test" inheritAll="false"/>
</target>
<target name="init" depends="common.init,build-lucene,build-lucene-tests"/>
<target name="compile-test" depends="init" if="contrib.has.tests">
<antcall target="common.compile-test" inheritRefs="true" />
</target>
<target name="test" depends="init" if="contrib.has.tests">
<antcall target="common.test" inheritRefs="true" />
</target>
<target name="build-artifacts-and-tests" depends="jar, compile-test" />
<available
type="file"
file="${pom.xml}"
property="pom.xml.present">
</available>
<target name="dist-maven" if="pom.xml.present" depends="compile-core, jar-src">
<sequential>
<m2-deploy>
<artifact-attachments>
<attach file="${build.dir}/${final.name}-src.jar"
classifier="sources"/>
<attach file="${build.dir}/${final.name}-javadoc.jar"
classifier="javadoc"/>
</artifact-attachments>
</m2-deploy>
</sequential>
</target>
<target name="javadocs">
<sequential>
<mkdir dir="${javadoc.dir}/contrib-${name}"/>
<invoke-javadoc
destdir="${javadoc.dir}/contrib-${name}"
title="${Name} ${version} contrib-${name} API">
<sources>
<link href="../"/>
<packageset dir="src/java"/>
</sources>
</invoke-javadoc>
<jarify basedir="${javadoc.dir}/contrib-${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
</project>