Apache Lucene open-source search software
LUCENE-4493: Better workflow for documentation linting
Uwe Schindler85c73511fbbe
diff --git a/build.xml b/build.xmlindex 0abbcaf155d..575f35942a7 100644--- a/build.xml+++ b/build.xml@@ -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>+ <subant target="test" inheritall="false" failonerror="true">+ <fileset dir="lucene" includes="build.xml" />+ <fileset dir="solr" includes="build.xml" />+ </subant></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>+ <subant target="pitest" inheritall="false" failonerror="false">+ <fileset dir="lucene" includes="build.xml" />+ <fileset dir="solr" includes="build.xml" />+ </subant></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>+ <subant target="documentation" inheritall="false" failonerror="true">+ <fileset dir="lucene" includes="build.xml" />+ <fileset dir="solr" includes="build.xml" />+ </subant></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,46 +250,44 @@</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">- <fileset dir="lucene" includes="build.xml" />- <fileset dir="solr" includes="build.xml" />- <property name="version" value="${fakeReleaseVersion}" />- </subant>- <delete dir="${fakeRelease}"/>- <delete dir="${fakeReleaseTmp}"/>- <mkdir dir="${fakeRelease}"/>- <copy todir="${fakeRelease}/lucene">- <fileset dir="lucene/dist"/>- </copy>- <copy todir="${fakeRelease}/lucene/changes">- <fileset dir="lucene/build/docs/changes"/>- </copy>- <get src="http://people.apache.org/keys/group/lucene.asc"- dest="${fakeRelease}/lucene/KEYS"/>- <copy todir="${fakeRelease}/solr">- <fileset dir="solr/package"/>- </copy>- <copy file="${fakeRelease}/lucene/KEYS" todir="${fakeRelease}/solr"/>- <copy todir="${fakeRelease}/solr/changes">- <fileset dir="solr/build/docs/changes"/>- </copy>- <makeurl file="${fakeRelease}" validate="false" property="fakeRelease.uri"/>- <exec executable="${python32.exe}" failonerror="true">- <arg value="-u"/>- <arg file="dev-tools/scripts/smokeTestRelease.py"/>- <arg value="${fakeRelease.uri}"/>- <arg value="${fakeReleaseVersion}"/>- <arg file="${fakeReleaseTmp}"/>- <arg value="false"/>- <env key="JAVA6_HOME" file="${JAVA6_HOME}"/>- <env key="JAVA7_HOME" file="${JAVA7_HOME}"/>- </exec>- <delete dir="${fakeRelease}"/>- <delete dir="${fakeReleaseTmp}"/>- </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">+ <fileset dir="lucene" includes="build.xml" />+ <fileset dir="solr" includes="build.xml" />+ <property name="version" value="${fakeReleaseVersion}" />+ </subant>+ <delete dir="${fakeRelease}"/>+ <delete dir="${fakeReleaseTmp}"/>+ <mkdir dir="${fakeRelease}"/>+ <copy todir="${fakeRelease}/lucene">+ <fileset dir="lucene/dist"/>+ </copy>+ <copy todir="${fakeRelease}/lucene/changes">+ <fileset dir="lucene/build/docs/changes"/>+ </copy>+ <get src="http://people.apache.org/keys/group/lucene.asc"+ dest="${fakeRelease}/lucene/KEYS"/>+ <copy todir="${fakeRelease}/solr">+ <fileset dir="solr/package"/>+ </copy>+ <copy file="${fakeRelease}/lucene/KEYS" todir="${fakeRelease}/solr"/>+ <copy todir="${fakeRelease}/solr/changes">+ <fileset dir="solr/build/docs/changes"/>+ </copy>+ <makeurl file="${fakeRelease}" validate="false" property="fakeRelease.uri"/>+ <exec executable="${python32.exe}" failonerror="true">+ <arg value="-u"/>+ <arg file="dev-tools/scripts/smokeTestRelease.py"/>+ <arg value="${fakeRelease.uri}"/>+ <arg value="${fakeReleaseVersion}"/>+ <arg file="${fakeReleaseTmp}"/>+ <arg value="false"/>+ <env key="JAVA6_HOME" file="${JAVA6_HOME}"/>+ <env key="JAVA7_HOME" file="${JAVA7_HOME}"/>+ </exec>+ <delete dir="${fakeRelease}"/>+ <delete dir="${fakeReleaseTmp}"/></target><target name="check-svn-working-copy" description="Checks the status of the SVN working copy">diff --git a/lucene/build.xml b/lucene/build.xmlindex d8d3f0fb440..a8db45533a8 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -226,59 +226,63 @@<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"/>- <echo message="Checking for broken links..."/>- <check-broken-links dir="build/docs"/>- <echo message="Checking for missing docs..."/>- <!-- TODO: change this level=method -->- <check-missing-javadocs dir="build/docs" level="class"/>- <!-- too many classes to fix overall to just enable- the above to be level="method" right now, but we- can prevent the modules that don't have problems- from getting any worse -->- <!-- analyzers-common: problems -->- <check-missing-javadocs dir="build/docs/analyzers-icu" level="method"/>- <!-- analyzers-kuromoji: problems -->- <check-missing-javadocs dir="build/docs/analyzers-morfologik" level="method"/>- <check-missing-javadocs dir="build/docs/analyzers-phonetic" level="method"/>- <!-- analyzers-smartcn: problems -->- <check-missing-javadocs dir="build/docs/analyzers-stempel" level="method"/>- <!-- analyzers-uima: problems -->- <!-- benchmark: problems -->- <check-missing-javadocs dir="build/docs/classification" level="method"/>- <!-- codecs: problems -->- <!-- core: problems -->- <check-missing-javadocs dir="build/docs/demo" level="method"/>- <!-- facet: problems -->- <!-- grouping: problems -->- <!-- highlighter: problems -->- <check-missing-javadocs dir="build/docs/join" level="method"/>- <check-missing-javadocs dir="build/docs/memory" level="method"/>- <!-- misc: problems -->- <!-- queries: problems -->- <!-- queryparser: problems -->- <!-- sandbox: problems -->- <!-- spatial: problems -->- <check-missing-javadocs dir="build/docs/suggest" level="method"/>- <!-- test-framework: problems -->-- <!-- too much to fix core/ for now, but enforce full javadocs for key packages -->- <check-missing-javadocs dir="build/docs/core/org/apache/lucene/analysis" level="method"/>- <check-missing-javadocs dir="build/docs/core/org/apache/lucene/document" level="method"/>- <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 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..."/>+ <!-- TODO: change this level=method -->+ <check-missing-javadocs dir="build/docs" level="class"/>+ <!-- too many classes to fix overall to just enable+ the above to be level="method" right now, but we+ can prevent the modules that don't have problems+ from getting any worse -->+ <!-- analyzers-common: problems -->+ <check-missing-javadocs dir="build/docs/analyzers-icu" level="method"/>+ <!-- analyzers-kuromoji: problems -->+ <check-missing-javadocs dir="build/docs/analyzers-morfologik" level="method"/>+ <check-missing-javadocs dir="build/docs/analyzers-phonetic" level="method"/>+ <!-- analyzers-smartcn: problems -->+ <check-missing-javadocs dir="build/docs/analyzers-stempel" level="method"/>+ <!-- analyzers-uima: problems -->+ <!-- benchmark: problems -->+ <check-missing-javadocs dir="build/docs/classification" level="method"/>+ <!-- codecs: problems -->+ <!-- core: problems -->+ <check-missing-javadocs dir="build/docs/demo" level="method"/>+ <!-- facet: problems -->+ <!-- grouping: problems -->+ <!-- highlighter: problems -->+ <check-missing-javadocs dir="build/docs/join" level="method"/>+ <check-missing-javadocs dir="build/docs/memory" level="method"/>+ <!-- misc: problems -->+ <!-- queries: problems -->+ <!-- queryparser: problems -->+ <!-- sandbox: problems -->+ <!-- spatial: problems -->+ <check-missing-javadocs dir="build/docs/suggest" level="method"/>+ <!-- test-framework: problems -->++ <!-- too much to fix core/ for now, but enforce full javadocs for key packages -->+ <check-missing-javadocs dir="build/docs/core/org/apache/lucene/analysis" level="method"/>+ <check-missing-javadocs dir="build/docs/core/org/apache/lucene/document" level="method"/>+ <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"/></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"><makeurl property="process-webpages.buildfiles" separator="|"><fileset dir="." includes="**/build.xml" excludes="build.xml,analysis/*,build/**,tools/**,backwards/**,site/**"/>diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 042b089e748..9ba8600d408 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -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" />diff --git a/solr/build.xml b/solr/build.xmlindex b873957d62a..9fe322ce4f5 100644--- a/solr/build.xml+++ b/solr/build.xml@@ -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,13 +541,8 @@<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 --><target name="generate-maven-artifacts" depends="install-maven-tasks"><sequential>