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.
(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) =======================
Changes in backwards compatibility policy

View File

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

View File

@ -103,6 +103,7 @@
<path refid="classpath"/>
<pathelement location="${ant.home}/lib/ant.jar"/>
<fileset dir=".">
<exclude name="build/**/*.jar"/>
<include name="**/lib/*.jar"/>
</fileset>
</path>
@ -763,6 +764,7 @@
</sequential>
</macrodef>
<property name="failonjavadocwarning" value="true"/>
<macrodef name="invoke-javadoc">
<element name="sources" optional="yes"/>
<attribute name="destdir"/>
@ -772,6 +774,7 @@
<copy todir="@{destdir}/../prettify" overwrite="false">
<fileset dir="${prettify.dir}"/>
</copy>
<record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>
<javadoc
overview="@{overview}"
packagenames="org.apache.lucene.*"
@ -783,6 +786,7 @@
author="true"
version="true"
use="true"
failonerror="true"
source="${ant.java.version}"
link="${javadoc.link}"
windowtitle="${Name} ${version} API"
@ -804,6 +808,26 @@
<classpath refid="javadoc.classpath"/>
</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>
</macrodef>

View File

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

View File

@ -330,6 +330,7 @@
</sequential>
</macrodef>
<property name="failonjavadocwarning" value="true"/>
<macrodef name="invoke-javadoc">
<element name="sources" optional="yes"/>
<attribute name="destdir"/>
@ -339,6 +340,7 @@
<copy todir="@{destdir}/prettify" overwrite="false">
<fileset dir="${prettify.dir}"/>
</copy>
<record name="@{destdir}/log_javadoc.txt" action="start" append="no"/>
<javadoc
packagenames="org.apache.solr.*"
failonerror="true"
@ -373,6 +375,24 @@
<classpath refid="javadoc.classpath"/>
</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>
</macrodef>