4 Licensed to the Apache Software Foundation (ASF) under one or more
5 contributor license agreements. See the NOTICE file distributed with
6 this work for additional information regarding copyright ownership.
7 The ASF licenses this file to You under the Apache License, Version 2.0
8 the "License"); you may not use this file except in compliance with
9 the License. You may obtain a copy of the License at
11 http://www.apache.org/licenses/LICENSE-2.0
13 Unless required by applicable law or agreed to in writing, software
14 distributed under the License is distributed on an "AS IS" BASIS,
15 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 See the License for the specific language governing permissions and
17 limitations under the License.
20 <project name="contrib-build" xmlns:artifact="antlib:org.apache.maven.artifact.ant">
21 <echo>Building ${ant.project.name}...</echo>
23 <!-- TODO: adjust build.dir/dist.dir appropriately when a contrib project is run individually -->
24 <property name="build.dir" location="../../build/contrib/${ant.project.name}"/>
25 <property name="dist.dir" location="../../dist/contrib/${ant.project.name}"/>
26 <property name="maven.dist.dir" location="../../dist/maven"/>
28 <import file="../common-build.xml"/>
30 <available property="contrib.has.tests" type="dir" file="src/test" />
32 <!-- if you extend the classpath refid in one contrib's build.xml (add JARs), use this as basis: -->
33 <path id="base.classpath">
34 <pathelement location="${common.dir}/build/classes/java"/>
35 <pathelement path="${project.classpath}"/>
38 <!-- default classpath refid, can be overridden by contrib's build.xml (use the above base.classpath as basis): -->
39 <path id="classpath" refid="base.classpath"/>
41 <path id="test.base.classpath">
42 <path refid="classpath"/>
43 <pathelement location="${common.dir}/build/classes/test-framework"/>
44 <path refid="junit-path"/>
45 <pathelement location="${build.dir}/classes/java"/>
48 <path id="test.classpath" refid="test.base.classpath"/>
50 <path id="junit.classpath">
51 <path refid="test.classpath"/>
52 <pathelement location="${build.dir}/classes/test"/>
53 <pathelement path="${java.class.path}"/>
56 <target name="init" depends="common.init,compile-lucene-core"/>
57 <target name="compile-test" depends="init" if="contrib.has.tests">
58 <antcall target="common.compile-test" inheritRefs="true" />
60 <target name="test" depends="init" if="contrib.has.tests">
61 <antcall target="common.test" inheritRefs="true" />
63 <target name="build-artifacts-and-tests" depends="jar, compile-test" />
68 property="pom.xml.present">
71 <target name="dist-maven" if="pom.xml.present" depends="jar-core, jar-src, javadocs">
72 <taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
73 uri="antlib:org.apache.maven.artifact.ant"
74 classpathref="maven-ant-tasks.classpath"/>
77 <artifact-attachments>
78 <attach file="${build.dir}/${final.name}-src.jar"
79 classifier="sources"/>
80 <attach file="${build.dir}/${final.name}-javadoc.jar"
81 classifier="javadoc"/>
82 </artifact-attachments>
87 <target name="javadocs" depends="compile-core">
89 <mkdir dir="${javadoc.dir}/contrib-${name}"/>
91 destdir="${javadoc.dir}/contrib-${name}"
92 title="${Name} ${version} contrib-${name} API">
95 <packageset dir="${src.dir}"/>
98 <jarify basedir="${javadoc.dir}/contrib-${name}" destfile="${build.dir}/${final.name}-javadoc.jar"/>
102 <target name="javadocs-index.html" description="Generate line for index.html of JavaDocs">
103 <echo file="${javadoc.dir}/index.html" append="true">
105 <li><a href="contrib-${name}/index.html">${name}</a></li>
109 <macrodef name="contrib-uptodate">
110 <attribute name="name"/>
111 <attribute name="property"/>
112 <attribute name="jarfile"/>
113 <attribute name="contrib-src-name" default="@{name}"/>
115 <uptodate property="@{property}" targetfile="@{jarfile}">
116 <srcfiles dir="${common.dir}/contrib/@{contrib-src-name}/src/java" includes="**/*.java"/>
121 <property name="analyzers-common.jar" value="${common.dir}/build/contrib/analyzers/common/lucene-analyzers-${version}.jar"/>
122 <target name="check-analyzers-common-uptodate" unless="analyzers-common.uptodate">
123 <contrib-uptodate name="analyzers/common" jarfile="${analyzers-common.jar}" property="analyzers-common.uptodate"/>
125 <target name="jar-analyzers-common" unless="analyzers-common.uptodate" depends="check-analyzers-common-uptodate">
126 <ant dir="${common.dir}/contrib/analyzers/common" target="jar-core" inheritall="false">
127 <propertyset refid="uptodate.and.compiled.properties"/>
129 <property name="analyzers-common.uptodate" value="true"/>
132 <property name="facet.jar" value="${common.dir}/build/contrib/facet/lucene-facet-${version}.jar"/>
133 <target name="check-facet-uptodate" unless="facet.uptodate">
134 <contrib-uptodate name="facet" jarfile="${facet.jar}" property="facet.uptodate"/>
136 <target name="jar-facet" unless="facet.uptodate" depends="check-facet-uptodate">
137 <ant dir="${common.dir}/contrib/facet" target="jar-core" inheritall="false">
138 <propertyset refid="uptodate.and.compiled.properties"/>
140 <property name="facet.uptodate" value="true"/>
143 <property name="analyzers-smartcn.jar" value="${common.dir}/build/contrib/analyzers/smartcn/lucene-smartcn-${version}.jar"/>
144 <target name="check-analyzers-smartcn-uptodate" unless="analyzers-smartcn.uptodate">
145 <contrib-uptodate name="analyzers/smartcn" jarfile="${analyzers-smartcn.jar}" property="analyzers-smartcn.uptodate"/>
147 <target name="jar-analyzers-smartcn" unless="analyzers-smartcn.uptodate" depends="check-analyzers-smartcn-uptodate">
148 <ant dir="${common.dir}/contrib/analyzers/smartcn" target="jar-core" inheritAll="false">
149 <propertyset refid="uptodate.and.compiled.properties"/>
151 <property name="analyzers-smartcn.uptodate" value="true"/>
154 <property name="analyzers-stempel.jar" value="${common.dir}/build/contrib/analyzers/stempel/lucene-stempel-${version}.jar"/>
155 <target name="check-analyzers-stempel-uptodate" unless="analyzers-stempel.uptodate">
156 <contrib-uptodate name="analyzers/stempel" jarfile="${analyzers-stempel.jar}" property="analyzers-stempel.uptodate"/>
158 <target name="jar-analyzers-stempel" unless="analyzers-stempel.uptodate" depends="check-analyzers-stempel-uptodate">
159 <ant dir="${common.dir}/contrib/analyzers/stempel" target="jar-core" inheritAll="false">
160 <propertyset refid="uptodate.and.compiled.properties"/>
162 <property name="analyzers-stempel.uptodate" value="true"/>
165 <property name="grouping.jar" value="${common.dir}/build/contrib/grouping/lucene-grouping-${version}.jar"/>
166 <target name="check-grouping-uptodate" unless="grouping.uptodate">
167 <contrib-uptodate name="grouping" jarfile="${grouping.jar}" property="grouping.uptodate"/>
169 <target name="jar-grouping" unless="grouping.uptodate" depends="check-grouping-uptodate">
170 <ant dir="${common.dir}/contrib/grouping" target="jar-core" inheritAll="false">
171 <propertyset refid="uptodate.and.compiled.properties"/>
173 <property name="grouping.uptodate" value="true"/>
176 <property name="highlighter.jar" value="${common.dir}/build/contrib/highlighter/lucene-highlighter-${version}.jar"/>
177 <target name="check-highlighter-uptodate" unless="highlighter.uptodate">
178 <contrib-uptodate name="highlighter" jarfile="${highlighter.jar}" property="highlighter.uptodate"/>
180 <target name="jar-highlighter" unless="highlighter.uptodate" depends="check-highlighter-uptodate">
181 <ant dir="${common.dir}/contrib/highlighter" target="jar-core" inheritall="false">
182 <propertyset refid="uptodate.and.compiled.properties"/>
184 <property name="highlighter.uptodate" value="true"/>
187 <property name="icu.jar" value="${common.dir}/build/contrib/icu/lucene-icu-${version}.jar"/>
188 <target name="check-icu-uptodate" unless="icu.uptodate">
189 <contrib-uptodate name="icu" jarfile="${icu.jar}" property="icu.uptodate"/>
191 <target name="jar-icu" unless="icu.uptodate" depends="check-icu-uptodate">
192 <ant dir="${common.dir}/contrib/icu" target="jar-core" inheritAll="false">
193 <propertyset refid="uptodate.and.compiled.properties"/>
195 <property name="icu.uptodate" value="true"/>
198 <property name="memory.jar" value="${common.dir}/build/contrib/memory/lucene-memory-${version}.jar"/>
199 <target name="check-memory-uptodate" unless="memory.uptodate">
200 <contrib-uptodate name="memory" jarfile="${memory.jar}" property="memory.uptodate"/>
202 <target name="jar-memory" unless="memory.uptodate" depends="check-memory-uptodate">
203 <ant dir="${common.dir}/contrib/memory" target="jar-core" inheritall="false">
204 <propertyset refid="uptodate.and.compiled.properties"/>
206 <property name="memory.uptodate" value="true"/>
209 <property name="misc.jar" value="${common.dir}/build/contrib/misc/lucene-misc-${version}.jar"/>
210 <target name="check-misc-uptodate" unless="misc.uptodate">
211 <contrib-uptodate name="misc" jarfile="${misc.jar}" property="misc.uptodate"/>
213 <target name="jar-misc" unless="misc.uptodate" depends="check-misc-uptodate">
214 <ant dir="${common.dir}/contrib/misc" target="jar-core" inheritAll="false">
215 <propertyset refid="uptodate.and.compiled.properties"/>
217 <property name="misc.uptodate" value="true"/>
220 <property name="queries.jar" value="${common.dir}/build/contrib/queries/lucene-queries-${version}.jar"/>
221 <target name="check-queries-uptodate" unless="queries.uptodate">
222 <contrib-uptodate name="queries" jarfile="${queries.jar}" property="queries.uptodate"/>
224 <target name="jar-queries" unless="queries.uptodate" depends="check-queries-uptodate">
225 <ant dir="${common.dir}/contrib/queries" target="jar-core" inheritall="false">
226 <propertyset refid="uptodate.and.compiled.properties"/>
228 <property name="queries.uptodate" value="true"/>
231 <property name="queryparser.jar" value="${common.dir}/build/contrib/queryparser/lucene-queryparser-${version}.jar"/>
232 <target name="check-queryparser-uptodate" unless="queryparser.uptodate">
233 <contrib-uptodate name="queryparser" jarfile="${queryparser.jar}" property="queryparser.uptodate"/>
235 <target name="jar-queryparser" unless="queryparser.uptodate" depends="check-queryparser-uptodate">
236 <ant dir="${common.dir}/contrib/queryparser" target="jar-core" inheritall="false">
237 <propertyset refid="uptodate.and.compiled.properties"/>
239 <property name="queryparser.uptodate" value="true"/>
242 <property name="spatial.jar" value="${common.dir}/build/contrib/spatial/lucene-spatial-${version}.jar"/>
243 <target name="check-spatial-uptodate" unless="spatial.uptodate">
244 <contrib-uptodate name="spatial" jarfile="${spatial.jar}" property="spatial.uptodate"/>
246 <target name="jar-spatial" unless="spatial.uptodate" depends="check-spatial-uptodate">
247 <ant dir="${common.dir}/contrib/spatial" target="jar-core" inheritAll="false">
248 <propertyset refid="uptodate.and.compiled.properties"/>
250 <property name="spatial.uptodate" value="true"/>
253 <property name="spellchecker.jar" value="${common.dir}/build/contrib/spellchecker/lucene-spellchecker-${version}.jar"/>
254 <target name="check-spellchecker-uptodate" unless="spellchecker.uptodate">
255 <contrib-uptodate name="spellchecker" jarfile="${spellchecker.jar}" property="spellchecker.uptodate"/>
257 <target name="jar-spellchecker" unless="spellchecker.uptodate" depends="check-spellchecker-uptodate">
258 <ant dir="${common.dir}/contrib/spellchecker" target="jar-core" inheritAll="false">
259 <propertyset refid="uptodate.and.compiled.properties"/>
261 <property name="spellchecker.uptodate" value="true"/>