Skip to content

Apache Lucene open-source search software

Move to 2.9 branch for backwards tests and enable compilation with source/target=1.4

Uwe Schindler5b71d96818a3
diff --git a/build.xml b/build.xml
index a7abfc85cd8..b23feae8826 100644
--- a/build.xml
+++ b/build.xml
@@ -112,7 +112,7 @@
</target>
<target name="test-tag" depends="download-tag, compile-core, compile-demo, jar-core"
- description="Runs tests of a previous Lucene version. Specify tag version like this: -Dtag=branches/lucene_2_4_back_compat_tests">
+ description="Runs tests of a previous Lucene version. Specify tag version like this: -Dtag=branches/lucene_2_9_back_compat_tests">
<sequential>
<available property="tag.available" file="${tags.dir}/${tag}/src/test" />
@@ -120,11 +120,12 @@
Specified tag '${tag}' could not be found in directory '${tags.dir}/${tag}'.
</fail>
<mkdir dir="${build.dir}/${tag}"/>
-
+
<!-- first compile tag classes -->
<compile
srcdir="${tags.dir}/${tag}/src/java"
- destdir="${build.dir}/${tag}/classes/java">
+ destdir="${build.dir}/${tag}/classes/java"
+ javac.source="${javac.source.tag}" javac.target="${javac.target.tag}">
<classpath refid="tag.classpath"/>
</compile>
@@ -134,7 +135,7 @@
<!-- compile tag tests against tag jar -->
<compile-test-macro srcdir="${tags.dir}/${tag}/src/test" destdir="${build.dir}/${tag}/classes/test"
- test.classpath="tag.test.classpath"/>
+ test.classpath="tag.test.classpath" javac.source="${javac.source.tag}" javac.target="${javac.target.tag}"/>
<!-- run tag tests against trunk jar -->
<test-macro dataDir="${tags.dir}/${tag}/src/test"
diff --git a/common-build.xml b/common-build.xml
index 24cb104bf83..5087c503860 100644
--- a/common-build.xml
+++ b/common-build.xml
@@ -40,9 +40,9 @@
<property name="name" value="${ant.project.name}"/>
<property name="Name" value="Lucene"/>
- <property name="dev.version" value="2.9"/>
+ <property name="dev.version" value="3.0-dev"/>
<property name="version" value="${dev.version}"/>
- <property name="compatibility.tag" value="lucene_2_4_back_compat_tests_20090911"/>
+ <property name="compatibility.tag" value="lucene_2_9_back_compat_tests_20090930a"/>
<property name="spec.version" value="${version}"/>
<property name="year" value="2000-${current.year}"/>
<property name="final.name" value="lucene-${name}-${version}"/>
@@ -60,6 +60,8 @@
<property name="javac.debug" value="on"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
+ <property name="javac.source.tag" value="1.4"/>
+ <property name="javac.target.tag" value="1.4"/>
<property name="javadoc.link" value="http://java.sun.com/j2se/1.5/docs/api/"/>
<property name="javadoc.access" value="protected"/>
@@ -358,10 +360,14 @@
<attribute name="srcdir"/>
<attribute name="destdir"/>
<attribute name="test.classpath"/>
+ <attribute name="javac.source" default="${javac.source}"/>
+ <attribute name="javac.target" default="${javac.target}"/>
<sequential>
<compile
srcdir="@{srcdir}"
- destdir="@{destdir}">
+ destdir="@{destdir}"
+ javac.source="@{javac.source}"
+ javac.target="@{javac.source}">
<classpath refid="@{test.classpath}"/>
</compile>
@@ -534,6 +540,8 @@
<macrodef name="compile">
<attribute name="srcdir"/>
<attribute name="destdir"/>
+ <attribute name="javac.source" default="${javac.source}"/>
+ <attribute name="javac.target" default="${javac.target}"/>
<element name="nested" implicit="yes" optional="yes"/>
<sequential>
@@ -544,11 +552,13 @@
destdir="@{destdir}"
deprecation="${javac.deprecation}"
debug="${javac.debug}"
- source="${javac.source}"
- target="${javac.target}">
+ source="@{javac.source}"
+ target="@{javac.target}">
<nested/>
<compilerarg line="-Xmaxwarns 10000000"/>
<compilerarg line="-Xmaxerrs 10000000"/>
+ <!-- for generics in Java 1.5: -->
+ <!--<compilerarg line="-Xlint:unchecked"/>-->
</javac>
</sequential>
</macrodef>