LUCENE-4493: Better workflow for documentation linting

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1400081 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2012-10-19 13:14:00 +00:00
parent fd1200c1c7
commit 85c73511fb
4 changed files with 144 additions and 145 deletions

View File

@ -36,61 +36,33 @@
depends="check-svn-working-copy,validate,documentation-lint"/>
<target name="test" description="Test both Lucene and Solr">
<sequential>
<subant target="test" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
</sequential>
</target>
<target name="pitest" description="Run PITest on both Lucene and Solr">
<sequential>
<subant target="pitest" inheritall="false" failonerror="false">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
</sequential>
</target>
<target name="documentation" description="Generate Lucene and Solr Documentation">
<sequential>
<subant target="documentation" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
</sequential>
</target>
<target name="documentation-lint" depends="-documentation-lint,-documentation-lint-unsupported"
description="Validates the generated documentation (HTML errors, broken links,...)"/>
<condition property="documentation-lint.supported">
<and>
<or>
<contains string="${java.vm.name}" substring="hotspot" casesensitive="false"/>
<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
<contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
</or>
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
</and>
</condition>
<target name="-documentation-lint" if="documentation-lint.supported">
<target name="documentation-lint" description="Validates the generated documentation (HTML errors, broken links,...)">
<subant target="documentation-lint" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
<fileset dir="solr" includes="build.xml" />
</subant>
</target>
<target name="-documentation-lint-unsupported" unless="documentation-lint.supported">
<echo level="warning" message="WARN: Linting documentation is not supported on this Java version (${ant.java.version}) / JVM (${java.vm.name}). Nothing done!"/>
</target>
<target name="validate" description="Validate dependencies, licenses, etc." depends="-validate-source-patterns">
<subant target="validate" inheritall="false" failonerror="true">
<fileset dir="lucene" includes="build.xml" />
@ -278,7 +250,6 @@
</target>
<target name="nightly-smoke" description="Builds an unsigned release and smoke tests it" depends="clean,-env-JAVA6_HOME,-env-JAVA7_HOME">
<sequential>
<fail unless="JAVA6_HOME">JAVA6_HOME property or environment variable is not defined.</fail>
<fail unless="JAVA7_HOME">JAVA7_HOME property or environment variable is not defined.</fail>
<subant target="prepare-release-no-sign" inheritall="false" failonerror="true">
@ -317,7 +288,6 @@
</exec>
<delete dir="${fakeRelease}"/>
<delete dir="${fakeReleaseTmp}"/>
</sequential>
</target>
<target name="check-svn-working-copy" description="Checks the status of the SVN working copy">

View File

@ -226,15 +226,11 @@
<target name="javadoc" depends="javadocs"/>
<target name="javadocs" description="Generate javadoc" depends="javadocs-lucene-core, javadocs-modules, javadocs-test-framework"/>
<target name="documentation-lint" depends="-ecj-javadoc-lint,-documentation-lint,-documentation-lint-unsupported"
description="Validates the generated documentation (HTML errors, broken links,...)"/>
<!-- we check for broken links across all documentation -->
<target name="documentation-lint" depends="compile-test-framework,documentation,-ecj-resolve">
<sequential>
<subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="core" includes="build.xml"/>
<fileset dir="test-framework" includes="build.xml"/>
</subant>
<modules-crawl target="-ecj-javadoc-lint"/>
<target name="-documentation-lint" if="documentation-lint.supported" depends="documentation">
<echo message="Checking for broken links..."/>
<check-broken-links dir="build/docs"/>
<echo message="Checking for missing docs..."/>
@ -276,7 +272,15 @@
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/search/similarities" level="method"/>
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/index" level="method"/>
<check-missing-javadocs dir="build/docs/core/org/apache/lucene/codecs" level="method"/>
</sequential>
</target>
<target name="-ecj-javadoc-lint" depends="documentation,compile-test-framework,-ecj-resolve">
<subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="core" includes="build.xml"/>
<fileset dir="test-framework" includes="build.xml"/>
</subant>
<modules-crawl target="-ecj-javadoc-lint"/>
</target>
<target name="process-webpages" depends="resolve-groovy,resolve-pegdown">

View File

@ -265,6 +265,25 @@
</condition>
</fail>
<condition property="documentation-lint.supported">
<and>
<or>
<contains string="${java.vm.name}" substring="hotspot" casesensitive="false"/>
<contains string="${java.vm.name}" substring="openjdk" casesensitive="false"/>
<contains string="${java.vm.name}" substring="jrockit" casesensitive="false"/>
</or>
<or>
<equals arg1="${ant.java.version}" arg2="1.6"/>
<equals arg1="${ant.java.version}" arg2="1.7"/>
<equals arg1="${ant.java.version}" arg2="1.8"/>
</or>
</and>
</condition>
<target name="-documentation-lint-unsupported" unless="documentation-lint.supported">
<echo level="warning" message="WARN: Linting documentation HTML is not supported on this Java version (${ant.java.version}) / JVM (${java.vm.name}). NOTHING DONE!"/>
</target>
<!-- Import custom ANT tasks. -->
<import file="${common.dir}/tools/custom-tasks.xml" />

View File

@ -520,9 +520,20 @@
</sequential>
</target>
<target name="documentation-lint" depends="-ecj-javadoc-lint,-documentation-lint,-documentation-lint-unsupported"
description="Validates the generated documentation (HTML errors, broken links,...)"/>
<!-- TODO: does solr have any other docs we should check? -->
<!-- TODO: also integrate checkJavaDocs.py, which does more checks -->
<target name="documentation-lint" depends="compile-solr-test-framework,documentation,-ecj-resolve">
<target name="-documentation-lint" if="documentation-lint.supported" depends="documentation">
<echo message="Checking for broken links..."/>
<check-broken-links dir="${javadoc.dir}"/>
<echo message="Checking for malformed docs..."/>
<!-- TODO: add missing package.htmls and bump this to level=package -->
<check-missing-javadocs dir="${javadoc.dir}" level="none"/>
</target>
<target name="-ecj-javadoc-lint" depends="documentation,compile-solr-test-framework,-ecj-resolve">
<subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
<propertyset refid="uptodate.and.compiled.properties"/>
<fileset dir="core" includes="build.xml"/>
@ -530,11 +541,6 @@
<fileset dir="test-framework" includes="build.xml"/>
</subant>
<contrib-crawl target="-ecj-javadoc-lint"/>
<echo message="Checking for broken links..."/>
<check-broken-links dir="${javadoc.dir}"/>
<echo message="Checking for malformed docs..."/>
<!-- TODO: add missing package.htmls and bump this to level=package -->
<check-missing-javadocs dir="${javadoc.dir}" level="none"/>
</target>
<!-- install-maven-tasks is *not* a useless dependency. do not remove -->