LUCENE-3753: Restructure the Lucene build system

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1241588 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-02-07 19:59:05 +00:00
parent 8b939cb7d2
commit eb0ab3d392
1249 changed files with 465 additions and 255 deletions

View File

@ -1,10 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="lucene/src/test-framework/java"/>
<classpathentry kind="src" output="bin.tests-framework" path="lucene/src/test-framework/resources"/>
<classpathentry kind="src" path="lucene/src/java"/>
<classpathentry kind="src" path="lucene/src/resources"/>
<classpathentry kind="src" path="lucene/src/test"/>
<classpathentry kind="src" path="lucene/core/src/java"/>
<classpathentry kind="src" path="lucene/core/src/resources"/>
<classpathentry kind="src" path="lucene/core/src/test"/>
<classpathentry kind="src" path="lucene/contrib/demo/src/java"/>
<classpathentry kind="src" path="lucene/contrib/demo/src/resources"/>
<classpathentry kind="src" path="lucene/contrib/demo/src/test"/>
@ -18,6 +16,8 @@
<classpathentry kind="src" path="lucene/contrib/sandbox/src/test"/>
<classpathentry kind="src" path="lucene/contrib/spatial/src/java"/>
<classpathentry kind="src" path="lucene/contrib/spatial/src/test"/>
<classpathentry kind="src" path="lucene/test-framework/src/java"/>
<classpathentry kind="src" output="bin.tests-framework" path="lucene/test-framework/src/resources"/>
<classpathentry kind="src" path="modules/analysis/common/src/java"/>
<classpathentry kind="src" path="modules/analysis/common/src/resources"/>
<classpathentry kind="src" path="modules/analysis/common/src/test"/>

View File

@ -1,16 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="false">
<output url="file://$MODULE_DIR$/build/classes/java" />
<output-test url="file://$MODULE_DIR$/build/classes/test" />
<output url="file://$MODULE_DIR$/build/lucene-idea/classes/java" />
<output-test url="file://$MODULE_DIR$/build/lucene-idea/classes/test" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/test-framework/resources" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test-framework/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/tools/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/src/test" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/test-framework/src/resources" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/test-framework/src/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/core/src/resources" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/core/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/tools/src/java" isTestSource="false" />
<sourceFolder url="file://$MODULE_DIR$/core/src/test" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build" />
<excludeFolder url="file://$MODULE_DIR$/dist" />
</content>

View File

@ -32,8 +32,8 @@
<name>Lucene Core</name>
<description>Apache Lucene Java Core</description>
<properties>
<module-directory>lucene</module-directory>
<build-directory>../build</build-directory>
<module-directory>lucene/core</module-directory>
<build-directory>../build/lucene-maven</build-directory>
</properties>
<dependencies>
<dependency>
@ -56,19 +56,19 @@
<directory>${build-directory}</directory>
<outputDirectory>${build-directory}/classes/java</outputDirectory>
<testOutputDirectory>${build-directory}/classes/test</testOutputDirectory>
<sourceDirectory>java</sourceDirectory>
<sourceDirectory>src/java</sourceDirectory>
<resources>
<resource>
<directory>resources</directory>
<directory>src/resources</directory>
</resource>
</resources>
<testSourceDirectory>test</testSourceDirectory>
<testSourceDirectory>src/test</testSourceDirectory>
<testResources>
<testResource>
<directory>test-framework/resources</directory>
<directory>../test-framework/src/resources</directory>
</testResource>
<testResource>
<directory>test-framework/java</directory>
<directory>../test-framework/src/java</directory>
<excludes>
<exclude>**/*.java</exclude>
</excludes>
@ -136,7 +136,7 @@
</goals>
<configuration>
<sources>
<source>test-framework</source>
<source>../test-framework/src/java</source>
</sources>
</configuration>
</execution>

View File

@ -32,8 +32,8 @@
<name>Lucene parent POM</name>
<description>Lucene parent POM</description>
<modules>
<module>src</module>
<module>src/test-framework</module>
<module>core</module>
<module>test-framework</module>
<module>contrib</module>
</modules>
<build>

View File

@ -24,7 +24,7 @@
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-parent</artifactId>
<version>@version@</version>
<relativePath>../../pom.xml</relativePath>
<relativePath>../pom.xml</relativePath>
</parent>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-test-framework</artifactId>
@ -32,8 +32,8 @@
<name>Lucene Test Framework</name>
<description>Apache Lucene Java Test Framework</description>
<properties>
<module-directory>lucene/src/test-framework</module-directory>
<build-directory>../../build</build-directory>
<module-directory>lucene/test-framework</module-directory>
<build-directory>../build/test-framework</build-directory>
</properties>
<dependencies>
<dependency>
@ -52,11 +52,11 @@
</dependencies>
<build>
<directory>${build-directory}</directory>
<outputDirectory>${build-directory}/classes/test-framework</outputDirectory>
<sourceDirectory>java</sourceDirectory>
<outputDirectory>${build-directory}/classes/java</outputDirectory>
<sourceDirectory>src/java</sourceDirectory>
<resources>
<resource>
<directory>resources</directory>
<directory>src/resources</directory>
</resource>
<resource>
<directory>${project.build.sourceDirectory}</directory>

View File

@ -0,0 +1,111 @@
#!/usr/bin/perl
#
# This script can be used to fix up paths that were moved as a result
# of the structural changes committed as part of LUCENE-3753.
#
# Input is on STDIN, output is to STDOUT
#
# Example use:
#
# perl LUCENE-3753.patch.hack.pl <my.pre-LUCENE-3753.patch >my.post-LUCENE-3753.patch
#
#
# 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.
#
use strict;
use warnings;
my @moves = (
'lucene/src/java'
=> 'lucene/core/src/java',
'lucene/src/test'
=> 'lucene/core/src/test',
'lucene/src/resources'
=> 'lucene/core/src/resources',
'lucene/src/site'
=> 'lucene/site',
'lucene/src/test-framework/java'
=> 'lucene/test-framework/src/java',
'lucene/src/test-framework/resources'
=> 'lucene/test-framework/src/resources',
'lucene/src/tools/java'
=> 'lucene/tools/src/java',
'lucene/src/tools/javadoc'
=> 'lucene/tools/javadoc',
'lucene/src/tools/prettify'
=> 'lucene/tools/prettify',
'dev-tools/maven/lucene/src/pom.xml.template'
=> 'dev-tools/maven/lucene/core/pom.xml.template',
'dev-tools/maven/lucene/src/test-framework/pom.xml.template'
=> 'dev-tools/maven/lucene/test-framework/pom.xml.template',
);
my @copies = ();
my $diff;
while (<>) {
if (/^Index/) {
my $next_diff = $_;
&fixup_paths if ($diff);
$diff = $next_diff;
} else {
$diff .= $_;
}
}
&fixup_paths; # Handle the final diff
sub fixup_paths {
for (my $move_pos = 0 ; $move_pos < $#moves ; $move_pos += 2) {
my $source = $moves[$move_pos];
my $target = $moves[$move_pos + 1];
if ($diff =~ /^Index: \Q$source\E/) {
$diff =~ s/^Index: \Q$source\E/Index: $target/;
$diff =~ s/\n--- \Q$source\E/\n--- $target/;
$diff =~ s/\n\+\+\+ \Q$source\E/\n+++ $target/;
$diff =~ s/\nProperty changes on: \Q$source\E/\nProperty changes on: $target/;
last;
}
}
print $diff;
for (my $copy_pos = 0 ; $copy_pos < $#copies ; $copy_pos += 2) {
my $source = $copies[$copy_pos];
my $target = $copies[$copy_pos + 1];
if ($diff =~ /^Index: \Q$source\E/) {
my $new_diff = $diff;
$new_diff =~ s/^Index: \Q$source\E/Index: $target/;
$new_diff =~ s/\n--- \Q$source\E/\n--- $target/;
$new_diff =~ s/\n\+\+\+ \Q$source\E/\n+++ $target/;
$new_diff =~ s/\nProperty changes on: \Q$source\E/\nProperty changes on: $target/;
print $new_diff;
last;
}
}
}

View File

@ -899,6 +899,17 @@ Build
(Steve Rowe, hossman)
* LUCENE-3753: Restructure the Lucene build system:
- Created a new Lucene-internal module named "core" by moving the java/
and test/ directories from lucene/src/ to lucene/core/src/.
- Eliminated lucene/src/ by moving all its directories up one level.
- Each internal module (core/, test-framework/, and tools/) now has its own
build.xml, from which it is possible to run module-specific targets.
lucene/build.xml delegates all build tasks (via
<ant dir="internal-module-dir"> calls) to these modules' build.xml files.
(Steve Rowe)
======================= Lucene 3.5.0 =======================
Changes in backwards compatibility policy

View File

@ -10,12 +10,12 @@ later bugfix releases should not be tested (the reason is that the new version m
compatible to the last base version, bugfixes should not taken into account):
* cd lucene/backwards
* svn rm src/test src/test-framework lib/lucene-core*.jar
* svn rm core/src/test test-framework lib/lucene-core*.jar
* svn commit (1st commit; you must do this, else you will corrupt your checkout)
* svn cp https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_X_Y_0/lucene/src/test-framework src
* svn cp https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_X_Y_0/lucene/src/test src
* svn cp https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_X_Y_0/lucene/test-framework ./
* svn cp https://svn.apache.org/repos/asf/lucene/dev/tags/lucene_solr_X_Y_0/lucene/core/src/test core/src/
* Copy the lucene-core.jar from the last release tarball to lib.
* Check that everything is correct: The backwards folder should contain a src/ folder
that now contains "test" and "test-framework". The files should be the ones from the last version.
* Check that everything is correct: The backwards folder should contain folders "core/src/test/"
and "test-framework/". The files should be the ones from the last version.
* Run "ant test-backwards"
* Commit the stuff again (2nd commit)

View File

@ -17,35 +17,17 @@
limitations under the License.
-->
<project name="core" default="default" basedir="."
<project name="lucene" default="default" basedir="."
xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<property name="junit.includes" value="**/Test*.java"/>
<import file="common-build.xml"/>
<!-- Build classpath -->
<path id="classpath">
<pathelement location="${build.dir}/classes/java"/>
</path>
<path id="test.classpath">
<pathelement location="${build.dir}/classes/test-framework"/>
<path refid="classpath"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/test"/>
</path>
<path id="junit.classpath">
<pathelement location="${build.dir}/classes/test-framework"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/test"/>
<pathelement location="${build.dir}/classes/java"/>
<pathelement path="${java.class.path}"/>
<pathelement location="${common.dir}/build/core/classes/java"/>
</path>
<patternset id="binary.build.dist.patterns"
includes="${final.name}*.jar,lucene-test-framework*.jar,docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
includes="docs/,contrib/*/*.jar,contrib/*/*.war, contrib/*/*/*.jar"
excludes="*-src.jar"
/>
<patternset id="binary.root.dist.patterns"
@ -57,9 +39,11 @@
<!-- Prepares the build directory -->
<!-- ================================================================== -->
<target name="test-core" depends="common.test"
description="Runs unit tests for the core Lucene code"
/>
<target name="test-core" description="Runs unit tests for the core Lucene code">
<ant dir="${common.dir}/core" target="test" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="test" depends="test-core, test-contrib, test-backwards"
description="Runs all unit tests (core, contrib and back-compat)"
/>
@ -90,13 +74,13 @@
<!-- TODO: separate test-framework from core tests (because META-INF duplicates in trunk) -->
<!-- compile branch tests against previous version JAR file -->
<compile-test-macro srcdir="${backwards.dir}/src/test-framework/java" destdir="${build.dir.backwards}/classes/test"
<compile-test-macro srcdir="${backwards.dir}/test-framework/src/java" destdir="${build.dir.backwards}/classes/test"
test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"/>
<!-- Copy the resources folder (if existent) -->
<copy todir="${build.dir.backwards}/classes/test">
<fileset dir="${backwards.dir}/src/test-framework/resources" erroronmissingdir="no"/>
<fileset dir="${backwards.dir}/test-framework/src/resources" erroronmissingdir="no"/>
</copy>
<compile-test-macro srcdir="${backwards.dir}/src/test" destdir="${build.dir.backwards}/classes/test"
<compile-test-macro srcdir="${backwards.dir}/core/src/test" destdir="${build.dir.backwards}/classes/test"
test.classpath="backwards.test.compile.classpath" javac.source="${javac.source.backwards}" javac.target="${javac.target.backwards}"/>
@ -133,7 +117,7 @@
Note: we disable multiplier/nightly because the purpose is to find API breaks
-->
<test-macro
dataDir="${backwards.dir}/src/test"
dataDir="${backwards.dir}/core/src/test"
tempDir="${build.dir.backwards}/test"
junit.classpath="backwards.junit.classpath"
junit.output.dir="${junit.output.dir.backwards}"
@ -157,13 +141,7 @@
</parallel>
</target>
<!-- ================================================================== -->
<!-- J A R -->
<!-- ================================================================== -->
<!-- -->
<!-- ================================================================== -->
<target name="compile-core" depends="jflex-notice, javacc-notice, common.compile-core"/>
<target name="compile-core" depends="compile-lucene-core"/>
<!-- ================================================================== -->
<!-- D O C U M E N T A T I O N -->
@ -173,7 +151,7 @@
<target name="docs">
<!-- copies the docs over to the docs folder -->
<copy todir="build/docs">
<fileset dir="src/site/build/site"/>
<fileset dir="site/build/site"/>
</copy>
</target>
@ -198,18 +176,15 @@
</target>
<target name="javadocs-core" description="Generate javadoc for core classes">
<sequential>
<mkdir dir="${javadoc.dir}/core"/>
<invoke-javadoc
destdir="${javadoc.dir}/core"
title="${Name} ${version} core API">
<sources>
<packageset dir="src/java"/>
<link href=""/>
</sources>
</invoke-javadoc>
<jarify basedir="${javadoc.dir}/core" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
<ant dir="${common.dir}/core" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="javadocs-test-framework">
<ant dir="${common.dir}/test-framework" target="javadocs" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<target name="javadocs-contrib" description="Generate javadoc for contrib classes">
@ -240,12 +215,12 @@
<pathelement location="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"/>
</path>
<invoke-javadoc
destdir="${javadoc.dir}/all">
<invoke-javadoc overview="${common.dir}/core/src/java/overview.html"
destdir="${javadoc.dir}/all">
<sources>
<!-- TODO: find a dynamic way to do include multiple source roots -->
<packageset dir="src/java"/>
<packageset dir="src/test-framework/java"/>
<packageset dir="core/src/java"/>
<packageset dir="test-framework/src/java"/>
<!-- please keep this list up to date, and in alpha order... -->
@ -307,6 +282,12 @@
<patternset refid="binary.root.dist.patterns"/>
</zipfileset>
<zipfileset dir="${build.dir}" includes="build-demo.xml" fullpath="lucene-${version}/build.xml"/>
<zipfileset prefix="lucene-${version}" dir="${build.dir}/core">
<patternset includes="lucene-core*.jar" excludes="*-src.jar"/>
</zipfileset>
<zipfileset prefix="lucene-${version}" dir="${build.dir}/test-framework">
<patternset includes="lucene-test-framework*.jar" excludes="*-src.jar"/>
</zipfileset>
<zipfileset prefix="lucene-${version}" dir="${build.dir}">
<patternset refid="binary.build.dist.patterns"/>
</zipfileset>
@ -325,6 +306,12 @@
<delete file="${build.dir}/lucene-${version}.tar"/>
<delete file="${dist.dir}/lucene-${version}.tgz"/>
<tar tarfile="${build.dir}/lucene-${version}.tar" longfile="gnu">
<tarfileset prefix="lucene-${version}" dir="${build.dir}/core">
<patternset includes="lucene-core*.jar" excludes="*-src.jar"/>
</tarfileset>
<tarfileset prefix="lucene-${version}" dir="${build.dir}/test-framework">
<patternset includes="lucene-test-framework*.jar" excludes="*-src.jar"/>
</tarfileset>
<tarfileset prefix="lucene-${version}" dir=".">
<patternset refid="binary.root.dist.patterns"/>
</tarfileset>
@ -376,9 +363,9 @@
<svn-export-source source.dir="."/>
<!-- Exclude javadoc package-list files under licenses incompatible with the ASL -->
<delete dir="${svn.export.dir}/src/tools/javadoc/java6"/>
<delete dir="${svn.export.dir}/tools/javadoc/java6"/>
<build-changes changes.src.dir="${svn.export.dir}/src/site/changes"
<build-changes changes.src.dir="${svn.export.dir}/site/changes"
changes.target.dir="${svn.export.dir}/docs/changes"/>
<tar tarfile="${source.package.file}" compression="gzip" longfile="gnu">
<tarfileset prefix="lucene-${version}" dir="${svn.export.dir}"/>
@ -419,8 +406,7 @@
</target>
<target name="generate-maven-artifacts"
depends="package, jar-src, jar-test-framework-src, javadocs">
<target name="generate-maven-artifacts" depends="package, javadocs">
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
@ -429,24 +415,13 @@
<m2-deploy pom.xml="../pom.xml"/> <!-- Lucene/Solr grandparent POM -->
<m2-deploy pom.xml="pom.xml"/> <!-- Lucene parent POM -->
<m2-deploy pom.xml="src/pom.xml"> <!-- Lucene core POM -->
<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>
<m2-deploy pom.xml="src/test-framework/pom.xml"
jar.file="${build.dir}/lucene-test-framework-${version}.jar">
<artifact-attachments>
<attach file="${build.dir}/lucene-test-framework-${version}-src.jar"
classifier="sources"/>
<attach file="${build.dir}/lucene-test-framework-${version}-javadoc.jar"
classifier="javadoc"/>
</artifact-attachments>
</m2-deploy>
<subant target="dist-maven" failonerror="true" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="${common.dir}/core" includes="build.xml"/>
<fileset dir="${common.dir}/test-framework" includes="build.xml"/>
</subant>
<contrib-crawl target="dist-maven"/>
</sequential>
</target>
@ -470,52 +445,18 @@
antfile="build.xml"
/>
</target>
<macrodef name="createLevAutomaton">
<attribute name="n"/>
<sequential>
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${python.exe}" failonerror="true">
<arg line="createLevAutomata.py @{n} True"/>
</exec>
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${python.exe}" failonerror="true">
<arg line="createLevAutomata.py @{n} False"/>
</exec>
</sequential>
</macrodef>
<target name="createLevAutomata" depends="check-moman,clone-moman,pull-moman">
<createLevAutomaton n="1"/>
<createLevAutomaton n="2"/>
</target>
<target name="check-moman">
<condition property="moman.cloned">
<available file="src/java/org/apache/lucene/util/automaton/moman"/>
</condition>
</target>
<target name="clone-moman" unless="moman.cloned">
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${hg.exe}" failonerror="true">
<arg line="clone -r ${moman.rev} ${moman.url} moman"/>
</exec>
</target>
<target name="pull-moman" if="moman.cloned">
<exec dir="src/java/org/apache/lucene/util/automaton/moman"
executable="${hg.exe}" failonerror="true">
<arg line="pull -f -r ${moman.rev}"/>
</exec>
</target>
<target name="build-contrib" depends="compile-test"
<target name="build-contrib" depends="common.compile-test"
description="Builds all contrib modules and their tests">
<contrib-crawl target="build-artifacts-and-tests"/>
</target>
<target name="test-contrib" depends="build-contrib">
<target name="compile-test" depends="compile-lucene-core,compile-test-framework"
description="Builds core, test-framework, and contrib tests">
<contrib-crawl target="compile-test" failonerror="true"/>
</target>
<target name="test-contrib" depends="compile-test">
<contrib-crawl target="test" failonerror="true"/>
</target>
@ -558,39 +499,18 @@
<patch patchfile="${patch.file}" strip="0"/>
</target>
<target name="jar-test-framework" depends="compile-test-framework">
<jarify basedir="${build.dir}/classes/test-framework" destfile="${build.dir}/lucene-test-framework-${version}.jar"
title="Lucene Search Engine: Test Framework" />
</target>
<target name="javadocs-test-framework">
<sequential>
<mkdir dir="${javadoc.dir}/test-framework"/>
<invoke-javadoc
overview="src/test-framework/java/overview.html"
destdir="${javadoc.dir}/test-framework"
title="${Name} ${version} Test Framework API">
<sources>
<packageset dir="src/test-framework/java"/>
<link offline="true" href="${javadoc.link.junit}"
packagelistLoc="${javadoc.packagelist.dir}/junit"/>
<link href=""/>
</sources>
</invoke-javadoc>
<jarify basedir="${javadoc.dir}/test-framework" destfile="${build.dir}/lucene-test-framework-${version}-javadoc.jar"
title="Lucene Search Engine: Test Framework" />
</sequential>
</target>
<target name="jar-test-framework-src" depends="init">
<jarify basedir="${tests-framework.src.dir}" destfile="${build.dir}/lucene-test-framework-${version}-src.jar"
title="Lucene Search Engine: Test Framework">
<fileset dir="${tests-framework.src.dir}/../resources" erroronmissingdir="no"/>
</jarify>
<target name="jar-test-framework">
<ant dir="${common.dir}/test-framework" target="jar-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
</target>
<!-- Override common-build.xml definition to check for the jar already being up-to-date -->
<target name="jar-core" depends="check-lucene-core-uptodate,compile-core" unless="lucene-core.uptodate">
<jarify/>
<target name="jar-core" depends="check-lucene-core-uptodate,compile-lucene-core" unless="lucene-core.uptodate">
<ant dir="${common.dir}/core" target="jar-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="core.compiled" value="true"/>
<property name="lucene-core.uptodate" value="true"/>
</target>
</project>

View File

@ -25,7 +25,7 @@
<dirname file="${ant.file.common}" property="common.dir"/>
<property name="dev-tools.dir" value="${common.dir}/../dev-tools"/>
<property name="prettify.dir" value="${common.dir}/src/tools/prettify"/>
<property name="prettify.dir" value="${common.dir}/tools/prettify"/>
<property name="maven.build.dir" value="${build.dir}/maven"/>
<!-- Give user a chance to override without editing this file
@ -63,7 +63,7 @@
</path>
<path id="tools.runtime.classpath">
<pathelement location="${common.dir}/build/classes/tools"/>
<pathelement location="${common.dir}/build/tools/classes/java"/>
</path>
<path id="maven-ant-tasks.classpath">
@ -115,7 +115,7 @@
<property name="javadoc.link" value="http://download.oracle.com/javase/6/docs/api/"/>
<property name="javadoc.link.junit" value="http://junit.sourceforge.net/javadoc/"/>
<property name="javadoc.packagelist.dir" value="${common.dir}/src/tools/javadoc"/>
<property name="javadoc.packagelist.dir" value="${common.dir}/tools/javadoc"/>
<available file="${javadoc.packagelist.dir}/java6/package-list" property="javadoc.java6.packagelist.exists"/>
<property name="javadoc.access" value="protected"/>
<property name="javadoc.charset" value="utf-8"/>
@ -131,7 +131,7 @@
</fileset>
</path>
<property name="changes.src.dir" value="${common.dir}/src/site/changes"/>
<property name="changes.src.dir" value="${common.dir}/site/changes"/>
<property name="changes.target.dir" value="${common.dir}/build/docs/changes"/>
<property name="project.name" value="site"/> <!-- todo: is this used by anakia or something else? -->
@ -139,13 +139,13 @@
<property name="src.dir" location="src/java"/>
<property name="tests.src.dir" location="src/test"/>
<property name="tests-framework.src.dir" location="${common.dir}/src/test-framework/java"/>
<property name="tests-framework.src.dir" location="${common.dir}/test-framework/src/java"/>
<property name="build.dir" location="build"/>
<!-- Needed in case a contrib needs the original build, also for compile-tools to be called from contrib -->
<property name="common.build.dir" location="${common.dir}/build"/>
<property name="tests.lockdir" location="${common.build.dir}"/>
<property name="dist.dir" location="dist"/>
<property name="maven.dist.dir" location="dist/maven"/>
<property name="dist.dir" location="${common.dir}/dist"/>
<property name="maven.dist.dir" location="${dist.dir}/maven"/>
<property name="m2.repository.url" value="file://${maven.dist.dir}"/>
<property name="m2.repository.private.key" value="${user.home}/.ssh/id_dsa"/>
@ -222,7 +222,7 @@
<patternset id="lucene.local.src.package.patterns"
includes="src/,index.html,*build*.xml,docs/,*.txt,contrib/,lib/,backwards/"
excludes="**/pom.xml,**/*.iml,src/site/build/"
excludes="**/pom.xml,**/*.iml,site/build/"
/>
<target name="clean"
@ -456,48 +456,37 @@
</sequential>
</macrodef>
<property name="lucene-core.jar" value="${common.dir}/build/lucene-core-${version}.jar"/>
<property name="lucene-core.jar" value="${common.dir}/build/core/lucene-core-${version}.jar"/>
<target name="check-lucene-core-uptodate" unless="lucene-core.uptodate">
<uptodate property="lucene-core.uptodate" targetfile="${lucene-core.jar}">
<srcfiles dir="${common.dir}/src/java" includes="**/*.java"/>
<srcfiles dir="${common.dir}/core/src/java" includes="**/*.java"/>
</uptodate>
</target>
<target name="jar-lucene-core" unless="lucene-core.uptodate" depends="check-lucene-core-uptodate">
<ant dir="${common.dir}" target="jar-core" inheritAll="false">
<ant dir="${common.dir}/core" target="jar-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="lucene-core.uptodate" value="true"/>
</target>
<target name="compile-lucene-core" unless="core.compiled">
<ant dir="${common.dir}" target="compile-core" inheritAll="false">
<ant dir="${common.dir}/core" target="compile-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="core.compiled" value="true"/>
</target>
<path id="test-framework.classpath">
<path refid="ant-path"/>
<path refid="test.classpath"/>
</path>
<target name="compile-test-framework" depends="compile-core">
<compile-test-macro srcdir="${tests-framework.src.dir}" destdir="${common.dir}/build/classes/test-framework"
test.classpath="test-framework.classpath"/>
<!-- Copy the resources folder (if existent) -->
<copy todir="${common.dir}/build/classes/test-framework">
<fileset dir="${tests-framework.src.dir}/../resources" erroronmissingdir="no"/>
</copy>
<target name="compile-test-framework" unless="lucene.test.framework.compiled">
<ant dir="${common.dir}/test-framework" target="compile-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="lucene.test.framework.compiled" value="true"/>
</target>
<target name="compile-tools">
<compile
srcdir="${common.dir}/src/tools/java"
destdir="${common.build.dir}/classes/tools">
<classpath refid="classpath"/>
</compile>
<ant dir="${common.dir}/tools" target="compile-core" inheritAll="false"/>
</target>
<target name="compile-test" depends="compile-test-framework">
<target name="compile-test" depends="compile-core,compile-test-framework">
<compile-test-macro srcdir="${tests.src.dir}" destdir="${build.dir}/classes/test"
test.classpath="test.classpath"/>
</target>
@ -778,6 +767,24 @@
<target name="default" depends="jar-core"/>
<available type="file" file="pom.xml" property="pom.xml.present"/>
<target name="dist-maven" if="pom.xml.present" depends="jar-core, jar-src, javadocs">
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
<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="rat-sources-typedef">
<typedef resource="org/apache/rat/anttasks/antlib.xml" uri="antlib:rat.anttasks">
<classpath>
@ -948,7 +955,7 @@
-->
<!-- Lucene -->
<arg value="-c" />
<arg value="${basedir}/lib" />
<arg value="${common.dir}/lib" />
</java>
</target>

View File

@ -31,7 +31,7 @@
<!-- if you extend the classpath refid in one contrib's build.xml (add JARs), use this as basis: -->
<path id="base.classpath">
<pathelement location="${common.dir}/build/classes/java"/>
<pathelement location="${common.dir}/build/core/classes/java"/>
<pathelement path="${project.classpath}"/>
</path>
@ -39,7 +39,7 @@
<path id="classpath" refid="base.classpath"/>
<path id="test.base.classpath">
<pathelement location="${common.dir}/build/classes/test-framework"/>
<pathelement location="${common.dir}/build/test-framework/classes/java"/>
<path refid="classpath"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/java"/>
@ -62,28 +62,6 @@
</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="jar-core, jar-src, javadocs">
<taskdef resource="org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath"/>
<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" depends="compile-core">
<sequential>
<mkdir dir="${javadoc.dir}/contrib-${name}"/>

98
lucene/core/build.xml Normal file
View File

@ -0,0 +1,98 @@
<?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="core" default="default">
<description>Lucene Core</description>
<property name="build.dir" location="../build/core"/>
<import file="../common-build.xml"/>
<path id="classpath"/>
<path id="test.classpath">
<pathelement location="${common.dir}/build/test-framework/classes/java"/>
<path refid="junit-path"/>
<pathelement location="${build.dir}/classes/java"/>
<pathelement location="${build.dir}/classes/test"/>
</path>
<path id="junit.classpath">
<path refid="test.classpath"/>
<pathelement path="${java.class.path}"/>
</path>
<target name="compile-core" depends="jflex-notice, javacc-notice, common.compile-core"/>
<target name="test-core" depends="common.test"/>
<target name="javadocs-core" depends="javadocs"/>
<target name="javadocs" description="Generate javadoc for core classes">
<sequential>
<mkdir dir="${javadoc.dir}/core"/>
<invoke-javadoc destdir="${javadoc.dir}/core" title="${Name} ${version} core API">
<sources>
<packageset dir="${src.dir}"/>
<link href=""/>
</sources>
</invoke-javadoc>
<mkdir dir="${build.dir}"/>
<jarify basedir="${javadoc.dir}/core" destfile="${build.dir}/${final.name}-javadoc.jar"/>
</sequential>
</target>
<macrodef name="createLevAutomaton">
<attribute name="n"/>
<sequential>
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${python.exe}" failonerror="true">
<arg line="createLevAutomata.py @{n} True"/>
</exec>
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${python.exe}" failonerror="true">
<arg line="createLevAutomata.py @{n} False"/>
</exec>
</sequential>
</macrodef>
<target name="createLevAutomata" depends="check-moman,clone-moman,pull-moman">
<createLevAutomaton n="1"/>
<createLevAutomaton n="2"/>
</target>
<target name="check-moman">
<condition property="moman.cloned">
<available file="src/java/org/apache/lucene/util/automaton/moman"/>
</condition>
</target>
<target name="clone-moman" unless="moman.cloned">
<exec dir="src/java/org/apache/lucene/util/automaton"
executable="${hg.exe}" failonerror="true">
<arg line="clone -r ${moman.rev} ${moman.url} moman"/>
</exec>
</target>
<target name="pull-moman" if="moman.cloned">
<exec dir="src/java/org/apache/lucene/util/automaton/moman"
executable="${hg.exe}" failonerror="true">
<arg line="pull -f -r ${moman.rev}"/>
</exec>
</target>
</project>

Some files were not shown because too many files have changed in this diff Show More