Apache Lucene open-source search software
LUCENE-5003: Fix linting javadocs with Java 8 and Eclipse JDT's ECJ compiler
Uwe Schindlerd6565f839e4f
diff --git a/lucene/build.xml b/lucene/build.xmlindex 7dcab349a13..fc73ced8cc0 100644--- a/lucene/build.xml+++ b/lucene/build.xml@@ -302,7 +302,7 @@<check-missing-javadocs dir="build/docs/core/org/apache/lucene/codecs" level="method"/></target>- <target name="-ecj-javadoc-lint" depends="compile,compile-test,-ecj-resolve">+ <target name="-ecj-javadoc-lint" depends="compile,compile-test,-ecj-javadoc-lint-unsupported,-ecj-resolve" if="ecj-javadoc-lint.supported"><subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false"><propertyset refid="uptodate.and.compiled.properties"/><fileset dir="core" includes="build.xml"/>diff --git a/lucene/common-build.xml b/lucene/common-build.xmlindex 88731ae5a8e..9a9d5251033 100644--- a/lucene/common-build.xml+++ b/lucene/common-build.xml@@ -1630,21 +1630,43 @@ ${tests-output}/junit4-*.suites - per-JVM executed suites</sequential></macrodef>- <target name="-ecj-javadoc-lint" depends="-ecj-javadoc-lint-src,-ecj-javadoc-lint-tests"/>+ <!-- ECJ Javadoc linting: -->++ <condition property="ecj-javadoc-lint.supported">+ <not><equals arg1="${build.java.runtime}" arg2="1.8"/></not>+ </condition>++ <condition property="ecj-javadoc-lint-tests.supported">+ <and>+ <isset property="ecj-javadoc-lint.supported"/>+ <isset property="module.has.tests"/>+ </and>+ </condition>++ <target name="-ecj-javadoc-lint-unsupported" unless="ecj-javadoc-lint.supported">+ <fail message="Linting documentation with ECJ is not supported on this Java version (${build.java.runtime}).">+ <condition>+ <not><isset property="is.jenkins.build"/></not>+ </condition>+ </fail>+ <echo level="warning" message="WARN: Linting documentation with ECJ is not supported on this Java version (${build.java.runtime}). NOTHING DONE!"/>+ </target>++ <target name="-ecj-javadoc-lint" depends="-ecj-javadoc-lint-unsupported,-ecj-javadoc-lint-src,-ecj-javadoc-lint-tests"/>- <target name="-ecj-javadoc-lint-src" depends="-ecj-resolve">+ <target name="-ecj-javadoc-lint-src" depends="-ecj-resolve" if="ecj-javadoc-lint.supported"><ecj-macro srcdir="${src.dir}" configuration="${common.dir}/tools/javadoc/ecj.javadocs.prefs"><classpath refid="classpath"/></ecj-macro></target>- <target name="-ecj-javadoc-lint-tests" depends="-ecj-resolve" if="module.has.tests">+ <target name="-ecj-javadoc-lint-tests" depends="-ecj-resolve" if="ecj-javadoc-lint-tests.supported"><ecj-macro srcdir="${tests.src.dir}" configuration="${common.dir}/tools/javadoc/ecj.javadocs.prefs"><classpath refid="test.classpath"/></ecj-macro></target>- <target name="-ecj-resolve" unless="ecj.loaded" depends="ivy-availability-check,ivy-configure">+ <target name="-ecj-resolve" unless="ecj.loaded" depends="ivy-availability-check,ivy-configure" if="ecj-javadoc-lint.supported"><ivy:cachepath organisation="org.eclipse.jdt.core.compiler" module="ecj" revision="3.7.2"inline="true" conf="master" type="jar" pathid="ecj.classpath" /><componentdef classname="org.eclipse.jdt.core.JDTCompilerAdapter"diff --git a/solr/build.xml b/solr/build.xmlindex f72e50fbac3..78753155036 100644--- a/solr/build.xml+++ b/solr/build.xml@@ -564,7 +564,7 @@<check-missing-javadocs dir="${javadoc.dir}" level="package"/></target>- <target name="-ecj-javadoc-lint" depends="compile,compile-test,jar-test-framework,-ecj-resolve">+ <target name="-ecj-javadoc-lint" depends="compile,compile-test,jar-test-framework,-ecj-javadoc-lint-unsupported,-ecj-resolve" if="ecj-javadoc-lint.supported"><subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false"><propertyset refid="uptodate.and.compiled.properties"/><fileset dir="core" includes="build.xml"/>