lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From uschind...@apache.org
Subject svn commit: r927765 - in /lucene/dev/trunk/lucene: ./ contrib/ contrib/ant/ contrib/ant/src/java/org/apache/lucene/ant/ contrib/ant/src/resources/ contrib/ant/src/resources/org/ contrib/ant/src/resources/org/apache/ contrib/ant/src/resources/org/apache...
Date Fri, 26 Mar 2010 10:44:25 GMT
Author: uschindler
Date: Fri Mar 26 10:44:25 2010
New Revision: 927765

URL: http://svn.apache.org/viewvc?rev=927765&view=rev
Log:
LUCENE-2333: Fix failures during contrib builds, when classes in core were changed without
ant clean. This fix also optimizes the dependency management between contribs by a new ANT
macro

Added:
    lucene/dev/trunk/lucene/contrib/ant/src/resources/
    lucene/dev/trunk/lucene/contrib/ant/src/resources/org/
    lucene/dev/trunk/lucene/contrib/ant/src/resources/org/apache/
    lucene/dev/trunk/lucene/contrib/ant/src/resources/org/apache/lucene/
    lucene/dev/trunk/lucene/contrib/ant/src/resources/org/apache/lucene/ant/
    lucene/dev/trunk/lucene/contrib/ant/src/resources/org/apache/lucene/ant/antlib.xml
      - copied unchanged from r927178, lucene/dev/trunk/lucene/contrib/ant/src/java/org/apache/lucene/ant/antlib.xml
Removed:
    lucene/dev/trunk/lucene/contrib/ant/src/java/org/apache/lucene/ant/antlib.xml
Modified:
    lucene/dev/trunk/lucene/build.xml
    lucene/dev/trunk/lucene/contrib/CHANGES.txt
    lucene/dev/trunk/lucene/contrib/ant/build.xml
    lucene/dev/trunk/lucene/contrib/benchmark/build.xml
    lucene/dev/trunk/lucene/contrib/contrib-build.xml
    lucene/dev/trunk/lucene/contrib/highlighter/build.xml
    lucene/dev/trunk/lucene/contrib/spatial/build.xml
    lucene/dev/trunk/lucene/contrib/spellchecker/build.xml
    lucene/dev/trunk/lucene/contrib/xml-query-parser/build.xml

Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Fri Mar 26 10:44:25 2010
@@ -670,6 +670,7 @@ The source distribution does not contain
     <attribute name="failonerror" default="true"/>
     <sequential>
       <subant target="@{target}" failonerror="@{failonerror}">
+        <property name="core.compiled" value="true"/>
         <fileset dir="."
                  includes="contrib/*/build.xml"
         />
@@ -677,7 +678,7 @@ The source distribution does not contain
     </sequential>
   </macrodef>
 
-  <target name="build-contrib"
+  <target name="build-contrib" depends="compile-test"
           description="Builds all contrib modules and their tests">
     <contrib-crawl target="build-artifacts-and-tests"/>
   </target>

Modified: lucene/dev/trunk/lucene/contrib/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/CHANGES.txt?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/contrib/CHANGES.txt Fri Mar 26 10:44:25 2010
@@ -117,6 +117,11 @@ Build
    queryparsers under contrib/misc into contrib/queryparser. Moved
    contrib/fast-vector-highlighter into contrib/highlighter.  (Robert Muir)
    
+ * LUCENE-2333: Fix failures during contrib builds, when classes in
+   core were changed without ant clean. This fix also optimizes the
+   dependency management between contribs by a new ANT macro.
+   (Uwe Schindler, Shai Erera)
+   
 Optimizations
 
  * LUCENE-2157: DelimitedPayloadTokenFilter no longer copies the buffer

Modified: lucene/dev/trunk/lucene/contrib/ant/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/ant/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/ant/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/ant/build.xml Fri Mar 26 10:44:25 2010
@@ -33,11 +33,5 @@
                refid="additional.dependencies"
   />
 
-  <target name="compile-core" depends="common.compile-core">
-    <copy todir="${build.dir}/classes/java">
-      <fileset dir="src/java" includes="**/*.xml"/>
-    </copy>
-  </target>
-
   <import file="../contrib-build.xml"/>
 </project>

Modified: lucene/dev/trunk/lucene/contrib/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/benchmark/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/benchmark/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/benchmark/build.xml Fri Mar 26 10:44:25 2010
@@ -8,6 +8,12 @@
     <import file="../contrib-build.xml"/>
     <property name="working.dir" location="work"/>
 
+    <contrib-uptodate name="highlighter" property="highlighter.uptodate" classpath.property="highlighter.jar"/>
+    <contrib-uptodate name="icu" property="icu.uptodate" classpath.property="icu.jar"/>
+    <!-- analyzers common needs a hack for the jar file: -->
+    <contrib-uptodate name="analyzers/common" jarfile="${common.dir}/build/contrib/analyzers/common/lucene-analyzers-${version}.jar"
+      property="analyzers-common.uptodate" classpath.property="analyzers-common.jar"/>
+    <contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
 
     <target name="check-files">
         <available file="temp/news20.tar.gz" property="news20.exists"/>
@@ -126,11 +132,11 @@
     </target>
 
     <path id="classpath">
-        <pathelement path="${common.dir}/build/classes/java"/>
-        <pathelement path="${common.dir}/build/classes/demo"/>
-        <pathelement path="${common.dir}/build/contrib/highlighter/classes/java"/>
-        <pathelement path="${common.dir}/build/contrib/memory/classes/java"/>
-        <pathelement path="${common.dir}/build/contrib/analyzers/common/classes/java"/>
+      <pathelement path="${memory.jar}"/>
+      <pathelement path="${highlighter.jar}"/>
+      <pathelement path="${analyzers-common.jar}"/>
+      <path refid="base.classpath"/>
+      <pathelement path="${common.dir}/build/classes/demo"/>
     	<fileset dir="lib">
     		<include name="**/*.jar"/>
     	</fileset>
@@ -172,8 +178,8 @@
 	
 	<path id="collation.runtime.classpath">
 	  <path refid="run.classpath"/>
-	  <pathelement path="${common.dir}/build/contrib/icu/classes/java"/>
-      <fileset dir="${common.dir}/contrib/icu/lib" includes="icu4j*.jar"/>
+    <pathelement path="${icu.jar}"/>
+    <fileset dir="${common.dir}/contrib/icu/lib" includes="icu4j*.jar"/>
 	</path>
 	
 	<target name="collation" depends="compile,compile-icu,top-100k-wiki-word-files">
@@ -202,7 +208,7 @@
       <path refid="run.classpath"/>
     </path>
 	
-    <target name="shingle" depends="compile,compile-analyzers-common,get-files">
+    <target name="shingle" depends="compile,get-files">
       <echo>Running contrib/benchmark with alg file: ${shingle.alg.file}</echo>
       <java fork="true" classname="org.apache.lucene.benchmark.byTask.Benchmark" 
             maxmemory="${task.mem}" output="${shingle.output.file}">
@@ -223,27 +229,27 @@
          <fileset dir="${common.dir}" includes="build.xml"/>
       </subant>
     </target>
-    <target name="compile-highlighter">
-      <subant target="compile">
+    <target name="compile-highlighter" unless="highlighter.uptodate">
+      <subant target="default">
          <fileset dir="${common.dir}/contrib/highlighter" includes="build.xml"/>
       </subant>
     </target>
-    <target name="compile-icu">
-      <subant target="compile">
+    <target name="compile-icu" unless="icu.uptodate">
+      <subant target="default">
          <fileset dir="${common.dir}/contrib/icu" includes="build.xml"/>
       </subant>
     </target>
-    <target name="compile-analyzers-common">
-      <subant target="compile">
+    <target name="compile-analyzers-common" unless="analyzers-common.uptodate">
+      <subant target="default">
         <fileset dir="${common.dir}/contrib/analyzers/common" includes="build.xml"/>
       </subant>
     </target>
-    <target name="compile-memory">
-      <subant target="compile">
+    <target name="compile-memory" unless="memory.uptodate">
+      <subant target="default">
          <fileset dir="${common.dir}/contrib/memory" includes="build.xml"/>
       </subant>
     </target>
 
-    <target name="init" depends="common.init,compile-demo,compile-memory,compile-highlighter"/>
+    <target name="init" depends="common.init,compile-demo,compile-memory,compile-highlighter,compile-analyzers-common"/>
     
 </project>

Modified: lucene/dev/trunk/lucene/contrib/contrib-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/contrib-build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/contrib-build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/contrib-build.xml Fri Mar 26 10:44:25 2010
@@ -27,20 +27,20 @@
   	
   <import file="../common-build.xml"/>
 
-  <property name="lucene.jar" location="${common.dir}/build/lucene-core-${version}.jar"/>
-  <available property="lucene.jar.present" type="file" file="${lucene.jar}"/>
-  <available property="lucene.tests.present" type="dir"
-             file="${common.dir}/build/classes/test" />
   <available property="contrib.has.tests" type="dir" file="src/test" />
   
-  <path id="classpath">
-   <pathelement path="${lucene.jar}"/>
+  <!-- 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 path="${project.classpath}"/>
   </path>
-
+  
+  <!-- default classpath refid, can be overridden by contrib's build.xml (use the above
base.classpath as basis): -->
+  <path id="classpath" refid="base.classpath"/>
+  
   <path id="test.classpath">
     <path refid="classpath"/>
-    <pathelement location="../../build/classes/test/"/>
+    <pathelement location="${common.dir}/build/classes/test"/>
     <path refid="junit-path"/>
     <pathelement location="${build.dir}/classes/java"/>
   </path>
@@ -52,16 +52,13 @@
     <pathelement path="${java.class.path}"/>
   </path>
 
-  <target name="build-lucene" unless="lucene.jar.present">
-    <ant dir="${common.dir}" target="jar-core" inheritAll="false"/>
-  </target>
-
-  <target name="build-lucene-tests" unless="lucene.tests.present">
+  <target name="build-lucene" unless="core.compiled">
     <ant dir="${common.dir}" target="compile-test" inheritAll="false"/>
+    <!-- set the property for this ant execution to speed up later tasks depending on
this -->
+    <property name="core.compiled" value="true"/>
   </target>
-
   
-  <target name="init" depends="common.init,build-lucene,build-lucene-tests"/>
+  <target name="init" depends="common.init,build-lucene"/>
   <target name="compile-test" depends="init" if="contrib.has.tests">
     <antcall target="common.compile-test" inheritRefs="true" />
   </target>
@@ -111,4 +108,18 @@
 ]]></echo>
   </target>
   
+  <macrodef name="contrib-uptodate">
+    <attribute name="name"/>
+    <attribute name="property" default="@{name}.uptodate"/>
+    <attribute name="classpath.property" default="@{name}.jar"/>
+    <!-- set jarfile only, if the target jar file has no generic name, applies to analyzers
with its common and smartcn subdir -->
+    <attribute name="jarfile" default="${common.dir}/build/contrib/@{name}/lucene-@{name}-${version}.jar"/>
+    <sequential>
+      <!--<echo message="Checking '@{jarfile}' against source folder '${common.dir}/contrib/@{name}/src/java'"/>-->
+      <property name="@{classpath.property}" location="@{jarfile}"/>
+      <uptodate property="@{property}" targetfile="@{jarfile}">
+        <srcfiles dir="${common.dir}/contrib/@{name}/src/java" includes="**/*.java"/>
+      </uptodate>
+    </sequential>
+  </macrodef>
 </project>

Modified: lucene/dev/trunk/lucene/contrib/highlighter/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/highlighter/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/highlighter/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/highlighter/build.xml Fri Mar 26 10:44:25 2010
@@ -25,28 +25,24 @@
 
   <import file="../contrib-build.xml"/>
 
-  <property name="memory.jar" location="${common.dir}/build/contrib/memory/lucene-memory-${version}.jar"/>
-  <available property="memory.jar.present" type="file" file="${memory.jar}"/>
-  
-  <property name="queries.jar" location="${common.dir}/build/contrib/queries/lucene-queries-${version}.jar"/>
-  <available property="queries.jar.present" type="file" file="${queries.jar}"/>
+  <contrib-uptodate name="memory" property="memory.uptodate" classpath.property="memory.jar"/>
+  <contrib-uptodate name="queries" property="queries.uptodate" classpath.property="queries.jar"/>
 
   <path id="classpath">
-    <pathelement path="${lucene.jar}"/>
     <pathelement path="${memory.jar}"/>
     <pathelement path="${queries.jar}"/>
-    <pathelement path="${project.classpath}"/>
+    <path refid="base.classpath"/>
   </path>
 
   <target name="compile-core" depends="build-memory, build-queries, common.compile-core"
/>
 
-  <target name="build-memory" unless="memory.jar.present">
-    <echo>Highlighter building dependency ${memory.jar}</echo>
+  <target name="build-memory" unless="memory.uptodate">
+    <echo>Highlighter building dependency contrib/memory</echo>
     <ant antfile="../memory/build.xml" target="default" inheritall="false" dir="../memory"
/>
   </target>
   
-  <target name="build-queries" unless="queries.jar.present">
-    <echo>Highlighter building dependency ${queries.jar}</echo>
+  <target name="build-queries" unless="queries.uptodate">
+    <echo>Highlighter building dependency contrib/queries</echo>
     <ant antfile="../queries/build.xml" target="default" inheritall="false" dir="../queries"
/>
   </target>
 </project>

Modified: lucene/dev/trunk/lucene/contrib/spatial/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/spatial/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/spatial/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/spatial/build.xml Fri Mar 26 10:44:25 2010
@@ -25,18 +25,16 @@
 
   <import file="../contrib-build.xml"/>
 
-  <property name="misc.jar" location="${common.dir}/build/contrib/misc/lucene-misc-${version}.jar"/>
-  <available property="misc.jar.present" type="file" file="${misc.jar}"/>
+  <contrib-uptodate name="misc" property="misc.uptodate" classpath.property="misc.jar"/>
 
   <path id="classpath">
-    <pathelement path="${lucene.jar}"/>
     <pathelement path="${misc.jar}"/>
-    <pathelement path="${project.classpath}"/>
+    <path refid="base.classpath"/>
   </path>
 
   <target name="compile-core" depends="build-misc, common.compile-core" />
 
-  <target name="build-misc" unless="misc.jar.present">
+  <target name="build-misc" unless="misc.uptodate">
     <echo>Misc building dependency ${misc.jar}</echo>
     <ant antfile="../misc/build.xml" target="default" inheritall="false" dir="../misc"
/>
   </target>

Modified: lucene/dev/trunk/lucene/contrib/spellchecker/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/spellchecker/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/spellchecker/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/spellchecker/build.xml Fri Mar 26 10:44:25 2010
@@ -24,6 +24,4 @@
   </description>
 
   <import file="../contrib-build.xml"/>
-  <target name="compile-test"
-          depends="build-lucene-tests,contrib-build.compile-test" />
 </project>

Modified: lucene/dev/trunk/lucene/contrib/xml-query-parser/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/contrib/xml-query-parser/build.xml?rev=927765&r1=927764&r2=927765&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/contrib/xml-query-parser/build.xml (original)
+++ lucene/dev/trunk/lucene/contrib/xml-query-parser/build.xml Fri Mar 26 10:44:25 2010
@@ -25,28 +25,27 @@
 
   <import file="../contrib-build.xml"/>
 
-  <property name="queries.jar" location="${common.dir}/build/contrib/queries/lucene-queries-${version}.jar"/>
+  <contrib-uptodate name="queries" property="queries.uptodate" classpath.property="queries.jar"/>
+  <property name="lucene.jar" location="${common.dir}/build/lucene-core-${version}.jar"/>
   <property name="servlet.jar" location="${common.dir}/lib/servlet-api-2.4.jar"/>
-  <available property="queries.jar.present" type="file" file="${queries.jar}"/>
   <available property="servlet.jar.present" type="file" file="${servlet.jar}"/>
 
 
   <path id="classpath">
-    <pathelement path="${lucene.jar}"/>
     <pathelement path="${queries.jar}"/>
-    <pathelement path="${project.classpath}"/>
+    <path refid="base.classpath"/>
   </path>
 
   <path id="web-classpath">
-    <pathelement path="${lucene.jar}"/>
     <pathelement path="${queries.jar}"/>
     <pathelement path="${servlet.jar}"/>
     <pathelement path="${build.dir}/${final.name}.jar"/>
+    <path refid="base.classpath"/>
   </path>
 
   <target name="compile-core" depends="build-queries, common.compile-core" />
 
-  <target name="build-queries" unless="queries.jar.present">
+  <target name="build-queries" unless="queries.uptodate">
     <echo>XML Parser building dependency ${queries.jar}</echo>
     <ant antfile="../queries/build.xml" target="default" inheritall="false" dir="../queries"
/>
   </target>
@@ -59,6 +58,9 @@
   <target name="build-web-demo"  description="Compiles demo" if="servlet.jar.present">
 
     <echo>XML Parser compiling web demo</echo>
+
+    <ant dir="${common.dir}" target="jar-core" inheritAll="false"/>
+
     <compile
       srcdir="src/demo/java"
       destdir="${build.dir}/classes/webdemo">



Mime
View raw message