lucene/dev-tools/validation/build.xml

173 lines
6.7 KiB
XML

<!--
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="validation" default="check-legal" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="build.dir" value="build"/>
<property name="dest.dir" value="${build.dir}/classes"/>
<property name="src.dir" value="src/main/java"/>
<property name="java.compat.version" value="1.5"/>
<property name="toplevel.dir" value="../.."/>
<property name="lib" location="lib" />
<path id="compile.classpath">
<fileset dir="${lib}">
<include name="*.jar" />
</fileset>
</path>
<path id="runtime.classpath">
<path refid="compile.classpath"/>
<pathelement location="${build.dir}/classes"/>
</path>
<target name="compile">
<mkdir dir="${dest.dir}" />
<javac destdir="${dest.dir}"
target="${java.compat.version}"
source="${java.compat.version}"
debug="on"
encoding="utf8"
includeAntRuntime="${javac.includeAntRuntime}"
srcdir="${src.dir}"
classpathref="compile.classpath">
<compilerarg line="-Xlint -Xlint:-deprecation -Xlint:-serial"/>
</javac>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<!--
>find . -name lib
./dev-tools/validation/lib
./lucene/contrib/ant/lib
./lucene/contrib/db/bdb/lib
./lucene/contrib/db/bdb-je/lib
./lucene/contrib/lucli/lib
./lucene/contrib/queries/lib
./lucene/lib
./modules/analysis/icu/lib
./modules/analysis/phonetic/lib
./modules/benchmark/lib
./solr/build/tests/solr/lib
./solr/build/web/WEB-INF/lib
./solr/client/ruby/flare/lib
./solr/client/ruby/flare/vendor/plugins/engines/lib
./solr/client/ruby/flare/vendor/plugins/flare/lib
./solr/client/ruby/solr-ruby/lib
./solr/client/ruby/solr-ruby/solr/lib
./solr/contrib/analysis-extras/lib
./solr/contrib/clustering/lib
./solr/contrib/dataimporthandler/lib
./solr/contrib/extraction/lib
./solr/contrib/uima/lib
./solr/example/example-DIH/solr/db/lib
./solr/example/example-DIH/solr/mail/lib
./solr/example/lib
./solr/example/work/Jetty_0_0_0_0_8983_solr.war__solr__k1kf17/webapp/WEB-INF/lib
./solr/lib
./solr/src/test-files/solr/lib
-->
<target name="check-legal-lucene" depends="compile">
<java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
<classpath>
<path refid="compile.classpath" />
<path refid="runtime.classpath" />
</classpath>
<!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
long time. This should be faster, but we could miss a directory
-->
<!-- Lucene -->
<arg value="-c" />
<arg value="${toplevel.dir}/lucene/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/lucene/contrib/ant/lib" />
<!-- BDB libs are downloaded, don't check them -->
<!--<arg value="-c" />
<arg value="${toplevel.dir}/lucene/contrib/db/bdb/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/lucene/contrib/db/bdb-je/lib" />-->
<arg value="-c" />
<arg value="${toplevel.dir}/lucene/contrib/lucli/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/lucene/contrib/queries/lib" />
</java>
</target>
<target name="check-legal-solr" depends="compile">
<java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
<classpath>
<path refid="compile.classpath" />
<path refid="runtime.classpath" />
</classpath>
<!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
long time. This should be faster, but we could miss a directory
-->
<!-- Solr -->
<arg value="-c" />
<arg value="${toplevel.dir}/solr/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/contrib/analysis-extras/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/contrib/clustering/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/contrib/dataimporthandler/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/contrib/extraction/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/contrib/uima/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/example/example-DIH/solr/db/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/example/example-DIH/solr/mail/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/example/example/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/solr/src/test-files/solr/lib" />
</java>
</target>
<target name="check-legal-modules" depends="compile">
<java classname="org.apache.lucene.validation.DependencyChecker" failonerror="true" fork="true">
<classpath>
<path refid="compile.classpath" />
<path refid="runtime.classpath" />
</classpath>
<!-- TODO: it might be better to just automatically find all directories that contain jar files, but that could take a
long time. This should be faster, but we could miss a directory
-->
<!-- Modules -->
<arg value="-c" />
<arg value="${toplevel.dir}/modules/analysis/icu/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/modules/analysis/phonetic/lib" />
<arg value="-c" />
<arg value="${toplevel.dir}/modules/benchmark/lib" />
</java>
</target>
<target name="check-legal" depends="check-legal-lucene, check-legal-solr, check-legal-modules"/>
<target name="validate-lucene" depends="check-legal-lucene" unless="validated-lucene"/>
<target name="validate-modules" depends="check-legal-modules" unless="validated-modules"/>
<target name="validate-solr" depends="check-legal-solr" unless="validated-solr"/>
<!-- Generic placeholder target for if we add other validation tasks -->
<target name="validate" depends="validate-lucene, validate-modules, validate-solr"/>
</project>