LUCENE-3006: fail on javadoc warnings

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1087426 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Grant Ingersoll 2011-03-31 19:56:47 +00:00
parent fdf66a15b1
commit 937ee38c7f
5 changed files with 53 additions and 1 deletions

View File

@ -379,6 +379,11 @@ Test Cases
stop iterating if at least 'tests.iter.min' ran and a failure occured. stop iterating if at least 'tests.iter.min' ran and a failure occured.
(Shai Erera, Chris Hostetter) (Shai Erera, Chris Hostetter)
Build
* LUCENE-3006: Building javadocs will fail on warnings by default. Override with -Dfailonjavadocwarning=false (sarowe, gsingers)
======================= Lucene 3.x (not yet released) ======================= ======================= Lucene 3.x (not yet released) =======================
Changes in backwards compatibility policy Changes in backwards compatibility policy

View File

@ -200,6 +200,7 @@
<path refid="classpath"/> <path refid="classpath"/>
<pathelement location="${ant.home}/lib/ant.jar"/> <pathelement location="${ant.home}/lib/ant.jar"/>
<fileset dir="."> <fileset dir=".">
<exclude name="build/**/*.jar"/>
<include name="**/lib/*.jar"/> <include name="**/lib/*.jar"/>
</fileset> </fileset>
<pathelement location="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/> <pathelement location="${common.dir}/../modules/analysis/build/common/lucene-analyzers-common-${version}.jar"/>

View File

@ -103,6 +103,7 @@
<path refid="classpath"/> <path refid="classpath"/>
<pathelement location="${ant.home}/lib/ant.jar"/> <pathelement location="${ant.home}/lib/ant.jar"/>
<fileset dir="."> <fileset dir=".">
<exclude name="build/**/*.jar"/>
<include name="**/lib/*.jar"/> <include name="**/lib/*.jar"/>
</fileset> </fileset>
</path> </path>
@ -762,7 +763,8 @@
</fixcrlf> </fixcrlf>
</sequential> </sequential>
</macrodef> </macrodef>
<property name="failonjavadocwarning" value="true"/>
<macrodef name="invoke-javadoc"> <macrodef name="invoke-javadoc">
<element name="sources" optional="yes"/> <element name="sources" optional="yes"/>
<attribute name="destdir"/> <attribute name="destdir"/>
@ -772,6 +774,7 @@
<copy todir="@{destdir}/../prettify" overwrite="false"> <copy todir="@{destdir}/../prettify" overwrite="false">
<fileset dir="${prettify.dir}"/> <fileset dir="${prettify.dir}"/>
</copy> </copy>
<record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>
<javadoc <javadoc
overview="@{overview}" overview="@{overview}"
packagenames="org.apache.lucene.*" packagenames="org.apache.lucene.*"
@ -783,6 +786,7 @@
author="true" author="true"
version="true" version="true"
use="true" use="true"
failonerror="true"
source="${ant.java.version}" source="${ant.java.version}"
link="${javadoc.link}" link="${javadoc.link}"
windowtitle="${Name} ${version} API" windowtitle="${Name} ${version} API"
@ -804,6 +808,26 @@
<classpath refid="javadoc.classpath"/> <classpath refid="javadoc.classpath"/>
</javadoc> </javadoc>
<record name="@{destdir}/log_javadoc.txt" action="stop"/>
<delete>
<fileset file="@{destdir}/log_javadoc.txt">
<not>
<containsregexp expression="\[javadoc\]\s*[1-9][0-9]*[\s]*warning"/>
</not>
</fileset>
</delete>
<fail message="Javadocs warnings were found!">
<condition>
<and>
<available file="@{destdir}/log_javadoc.txt"/>
<istrue value="${failonjavadocwarning}"/>
</and>
</condition>
</fail>
</sequential> </sequential>
</macrodef> </macrodef>

View File

@ -211,6 +211,8 @@ Documentation
* SOLR-2232: Improved README info on solr.solr.home in examples * SOLR-2232: Improved README info on solr.solr.home in examples
(Eric Pugh and hossman) (Eric Pugh and hossman)
* LUCENE-3006: Building javadocs will fail on warnings by default. Override with -Dfailonjavadocwarning=false (sarowe, gsingers)
================== 3.2.0-dev ================== ================== 3.2.0-dev ==================
Versions of Major Components Versions of Major Components
--------------------- ---------------------

View File

@ -330,6 +330,7 @@
</sequential> </sequential>
</macrodef> </macrodef>
<property name="failonjavadocwarning" value="true"/>
<macrodef name="invoke-javadoc"> <macrodef name="invoke-javadoc">
<element name="sources" optional="yes"/> <element name="sources" optional="yes"/>
<attribute name="destdir"/> <attribute name="destdir"/>
@ -339,6 +340,7 @@
<copy todir="@{destdir}/prettify" overwrite="false"> <copy todir="@{destdir}/prettify" overwrite="false">
<fileset dir="${prettify.dir}"/> <fileset dir="${prettify.dir}"/>
</copy> </copy>
<record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>
<javadoc <javadoc
packagenames="org.apache.solr.*" packagenames="org.apache.solr.*"
failonerror="true" failonerror="true"
@ -373,6 +375,24 @@
<classpath refid="javadoc.classpath"/> <classpath refid="javadoc.classpath"/>
</javadoc> </javadoc>
<record name="@{destdir}/log_javadoc.txt" action="stop"/>
<delete>
<fileset file="@{destdir}/log_javadoc.txt">
<not>
<containsregexp expression="\[javadoc\]\s*[1-9][0-9]*[\s]*warning"/>
</not>
</fileset>
</delete>
<fail message="Javadocs warnings were found!" >
<condition>
<and>
<available file="@{destdir}/log_javadoc.txt"/>
<istrue value="${failonjavadocwarning}"/>
</and>
</condition>
</fail>
</sequential> </sequential>
</macrodef> </macrodef>