LUCENE-3753: 'ant package' in solr/ triggered a build failure as a result of a build dependency on target 'javadocs-all' in lucene/, because the basedir wasn't being reset by the <subant> calls to the modules to be built to satisfy javadoc links (queryparser, queries, and analyzers-common) - as a result, the first module's compile invocation thought it should put its output in lucene/build/classes/java/, which no longer exists. The fix: switch javadocs-all to depend on the jar-* targets for the modules in question; these use <ant> instead of <subant>, which doesn't seem to have the same issue.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1241710 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Steven Rowe 2012-02-08 00:09:44 +00:00
parent fa3acebf89
commit 03ca9be6c4
3 changed files with 53 additions and 57 deletions

View File

@ -192,17 +192,11 @@
failonerror="false"/>
</target>
<target name="javadocs-all" description="Generate javadoc for core and contrib classes">
<target name="javadocs-all" depends="jar-analyzers-common,jar-queryparser,jar-queries"
description="Generate javadoc for core and contrib classes">
<sequential>
<mkdir dir="${javadoc.dir}/all"/>
<!-- TODO: remove these dependencies: -->
<subant target="default">
<fileset dir="${common.dir}/../modules/queryparser" includes="build.xml"/>
<fileset dir="${common.dir}/../modules/analysis/common" includes="build.xml"/>
<fileset dir="${common.dir}/../modules/queries" includes="build.xml"/>
</subant>
<path id="javadoc.classpath">
<path refid="classpath"/>
<pathelement location="${ant.home}/lib/ant.jar"/>
@ -210,9 +204,9 @@
<exclude name="build/**/*.jar"/>
<include name="**/lib/*.jar"/>
</fileset>
<pathelement location="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>
<pathelement location="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"/>
<pathelement location="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"/>
<pathelement location="${analyzers-common.jar}"/>
<pathelement location="${queryparser.jar}"/>
<pathelement location="${queries.jar}"/>
</path>
<invoke-javadoc overview="${common.dir}/core/src/java/overview.html"

View File

@ -456,6 +456,18 @@
</sequential>
</macrodef>
<macrodef name="module-uptodate">
<attribute name="name"/>
<attribute name="property"/>
<attribute name="jarfile"/>
<attribute name="module-src-name" default="@{name}"/>
<sequential>
<uptodate property="@{property}" targetfile="@{jarfile}">
<srcfiles dir="${common.dir}/../modules/@{module-src-name}/src/java" includes="**/*.java"/>
</uptodate>
</sequential>
</macrodef>
<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}">
@ -468,13 +480,48 @@
</ant>
<property name="lucene-core.uptodate" value="true"/>
</target>
<property name="queryparser.jar" value="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"/>
<target name="check-queryparser-uptodate" unless="queryparser.uptodate">
<module-uptodate name="queryparser" jarfile="${queryparser.jar}" property="queryparser.uptodate"/>
</target>
<target name="jar-queryparser" unless="queryparser.uptodate" depends="check-queryparser-uptodate">
<ant dir="${common.dir}/../modules/queryparser" target="jar-core" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="queryparser.uptodate" value="true"/>
</target>
<property name="analyzers-common.jar" value="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>
<target name="check-analyzers-common-uptodate" unless="analyzers-common.uptodate">
<module-uptodate name="analysis/common" jarfile="${analyzers-common.jar}" property="analyzers-common.uptodate"/>
</target>
<target name="jar-analyzers-common" unless="analyzers-common.uptodate" depends="check-analyzers-common-uptodate">
<ant dir="${common.dir}/../modules/analysis/common" target="jar-core" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="analyzers-common.uptodate" value="true"/>
</target>
<property name="queries.jar" value="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"/>
<target name="check-queries-uptodate" unless="queries.uptodate">
<module-uptodate name="queries" jarfile="${queries.jar}" property="queries.uptodate"/>
</target>
<target name="jar-queries" unless="queries.uptodate" depends="check-queries-uptodate">
<ant dir="${common.dir}/../modules/queries" target="jar-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="queries.uptodate" value="true"/>
</target>
<target name="compile-lucene-core" unless="core.compiled">
<ant dir="${common.dir}/core" target="compile-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="core.compiled" value="true"/>
</target>
<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"/>

View File

@ -96,29 +96,6 @@
</sequential>
</macrodef>
<macrodef name="module-uptodate">
<attribute name="name"/>
<attribute name="property"/>
<attribute name="jarfile"/>
<attribute name="module-src-name" default="@{name}"/>
<sequential>
<uptodate property="@{property}" targetfile="@{jarfile}">
<srcfiles dir="${common.dir}/../modules/@{module-src-name}/src/java" includes="**/*.java"/>
</uptodate>
</sequential>
</macrodef>
<property name="analyzers-common.jar" value="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>
<target name="check-analyzers-common-uptodate" unless="analyzers-common.uptodate">
<module-uptodate name="analysis/common" jarfile="${analyzers-common.jar}" property="analyzers-common.uptodate"/>
</target>
<target name="jar-analyzers-common" unless="analyzers-common.uptodate" depends="check-analyzers-common-uptodate">
<ant dir="${common.dir}/../modules/analysis/common" target="jar-core" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="analyzers-common.uptodate" value="true"/>
</target>
<property name="facet.jar" value="${common.dir}/../modules/facet/build/lucene-facet-${version}.jar"/>
<target name="check-facet-uptodate" unless="facet.uptodate">
<module-uptodate name="facet" jarfile="${facet.jar}" property="facet.uptodate"/>
@ -229,28 +206,6 @@
<property name="misc.uptodate" value="true"/>
</target>
<property name="queries.jar" value="${common.dir}/../modules/queries/build/lucene-queries-${version}.jar"/>
<target name="check-queries-uptodate" unless="queries.uptodate">
<module-uptodate name="queries" jarfile="${queries.jar}" property="queries.uptodate"/>
</target>
<target name="jar-queries" unless="queries.uptodate" depends="check-queries-uptodate">
<ant dir="${common.dir}/../modules/queries" target="jar-core" inheritAll="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="queries.uptodate" value="true"/>
</target>
<property name="queryparser.jar" value="${common.dir}/../modules/queryparser/build/lucene-queryparser-${version}.jar"/>
<target name="check-queryparser-uptodate" unless="queryparser.uptodate">
<module-uptodate name="queryparser" jarfile="${queryparser.jar}" property="queryparser.uptodate"/>
</target>
<target name="jar-queryparser" unless="queryparser.uptodate" depends="check-queryparser-uptodate">
<ant dir="${common.dir}/../modules/queryparser" target="jar-core" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
</ant>
<property name="queryparser.uptodate" value="true"/>
</target>
<property name="sandbox.jar" value="${common.dir}/build/contrib/sandbox/lucene-sandbox-${version}.jar"/>
<target name="check-sandbox-uptodate" unless="sandbox.uptodate">
<contrib-uptodate name="sandbox" jarfile="${sandbox.jar}" property="sandbox.uptodate"/>