lucene/solr/build.xml

170 lines
7.2 KiB
XML

<!-- Solr build file -->
<!--
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="solr-core" default="usage">
<description>Solr</description>
<property name="src.dir" location="src/java"/>
<!-- solr uses this as the test working directory: nocommit classpath -->
<property name="tests.userdir" value="src/test-files"/>
<path id="additional.dependencies">
<fileset dir="lib" includes="**/*.jar"/>
<fileset dir="example/lib" includes="**/*.jar"/>
</path>
<import file="common-build.xml"/>
<!-- add some descriptions to some inherited targets -->
<target name="compile" description="Compile the source code."
depends="compile-core, build-contrib"/>
<target name="test" description="Validate, then run core and contrib unit tests."
depends="validate-solr, common-solr.test, test-contrib"/>
<target name="test-core" description="Runs the core unit tests."
depends="common.test"/>
<target name="compile-test" description="Compile unit tests."
depends="compile-test-framework, common.compile-test"/>
<target name="javadocs" description="Generate javadocs for core, client, test-framework, and contrib"
depends="contrib-build.javadocs, javadocs-solrj, javadocs-test-framework, javadocs-contrib"/>
<target name="javadocs-core" description="Generate javadocs for core."
depends="contrib-build.javadocs"/>
<!-- hackish we have to call init/clover here, but solr core depends upon solrj? -->
<target name="compile-core" depends="init, clover, compile-analyzers-common,
compile-analyzers-phonetic, compile-suggest, compile-highlighter,
compile-memory, compile-misc, compile-queries, compile-spatial,
compile-solrj, common.compile-core, compile-webapp"
unless="solr-core.compiled">
</target>
<target name="compile-webapp" depends="compile-solrj">
<compile srcdir="src/webapp/src"
destdir="${build.dir}/classes/webapp">
<classpath refid="classpath"/>
</compile>
</target>
<!-- TODO: factor solrj into a separate dir so its a normal module?
we have to reinvent wheels the way it is now -->
<target name="compile-solrj" description="Compile the java client.">
<compile srcdir="src/common:src/solrj"
destdir="${build.dir}/classes/solrj">
<classpath refid="classpath"/>
</compile>
</target>
<!-- hacky? -->
<target name="compile-test-framework" depends="compile-core">
<compile srcdir="src/test-framework" destdir="${build.dir}/classes/test-framework">
<classpath refid="test.base.classpath"/>
</compile>
</target>
<target name="javadocs-solrj" depends="compile-solrj" description="Generates solrj javadoc documentation.">
<sequential>
<mkdir dir="${javadoc.dir}/solrj"/>
<invoke-javadoc
destdir="${javadoc.dir}/solrj"
title="${Name}-j ${version} API (${specversion})">
<sources>
<packageset dir="src/common"/>
<packageset dir="src/solrj"/>
</sources>
</invoke-javadoc>
</sequential>
</target>
<target name="javadocs-test-framework" depends="compile-test-framework"
description="Generates javadoc documentation for the Solr test-framework.">
<sequential>
<mkdir dir="${build.javadoc}/test-framework"/>
<path id="javadoc.classpath">
<path refid="test.classpath"/> <!-- nocommit switch to testframework.compile.classpath -->
</path>
<invoke-javadoc
destdir="${javadoc.dir}/test-framework"
title="${Name} ${version} Test Framework API (${specversion})">
<sources>
<packageset dir="src/test-framework" />
</sources>
</invoke-javadoc>
</sequential>
</target>
<!-- Default target: usage. Prints out instructions. -->
<target name="usage"
description="Prints out instructions">
<echo message="Welcome to the Solr project!" />
<echo message="Use 'ant example' to create a runnable example configuration." />
<echo message="Use 'ant run-example' to create and run the example." />
<echo message="And for developers:"/>
<echo message="Use 'ant clean' to clean compiled files." />
<echo message="Use 'ant compile' to compile the source code." />
<echo message="Use 'ant dist' to build the project WAR and JAR files." />
<echo message="Use 'ant javadoc' to build javadoc under build/docs/api" />
<echo message="Use 'ant generate-maven-artifacts' to generate maven artifacts." />
<echo message="Use 'ant package' to generate zip, tgz for distribution." />
<echo message="Use 'ant luke' to start luke. see: http://luke.googlecode.com" />
<echo message="Use 'ant test' to run unit tests." />
</target>
<!-- TODO: lucene/solr could share these -->
<target name="build-contrib" depends="compile-test"
description="Builds all contrib modules and their tests">
<contrib-crawl target="build-artifacts-and-tests"/>
</target>
<target name="javadocs-contrib" description="Generate javadocs for contrib classes"
depends="build-contrib">
<contrib-crawl target="javadocs" failonerror="true"/>
</target>
<target name="test-contrib" description="Run contrib unit tests."
depends="build-contrib">
<contrib-crawl target="test" failonerror="true"/>
</target>
<target name="compile-analyzers-common" unless="analyzers-common.uptodate">
<ant dir="${common.dir}/../modules/analysis/common" target="default" inheritAll="false"/>
</target>
<target name="compile-analyzers-phonetic" unless="analyzers-phonetic.uptodate">
<ant dir="${common.dir}/../modules/analysis/phonetic" target="default" inheritAll="false"/>
</target>
<target name="compile-suggest" unless="suggest.uptodate">
<ant dir="${common.dir}/../modules/suggest" target="default" inheritAll="false"/>
</target>
<target name="compile-highlighter" unless="highlighter.uptodate">
<ant dir="${common.dir}/contrib/highlighter" target="default" inheritAll="false"/>
</target>
<target name="compile-memory" unless="memory.uptodate">
<ant dir="${common.dir}/contrib/memory" target="default" inheritAll="false"/>
</target>
<target name="compile-misc" unless="misc.uptodate">
<ant dir="${common.dir}/contrib/misc" target="default" inheritAll="false"/>
</target>
<target name="compile-queries" unless="queries.uptodate">
<ant dir="${common.dir}/contrib/queries" target="default" inheritAll="false"/>
</target>
<target name="compile-spatial" unless="spatial.uptodate">
<ant dir="${common.dir}/contrib/spatial" target="default" inheritAll="false"/>
</target>
</project>