You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by rm...@apache.org on 2012/09/24 05:05:29 UTC

svn commit: r1389192 - in /lucene/dev/branches/branch_4x: ./ lucene/ lucene/analysis/ lucene/spatial/ lucene/spatial/src/java/org/apache/lucene/spatial/ lucene/spatial/src/java/org/apache/lucene/spatial/prefix/ lucene/spatial/src/java/org/apache/lucene...

Author: rmuir
Date: Mon Sep 24 03:05:28 2012
New Revision: 1389192

URL: http://svn.apache.org/viewvc?rev=1389192&view=rev
Log:
LUCENE-4409: implement javadocs linting with eclipse ecj compiler

Added:
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/package.html
      - copied unchanged from r1389188, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/package.html
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/package.html
      - copied unchanged from r1389188, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/package.html
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/package.html
      - copied unchanged from r1389188, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/package.html
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/query/package.html
      - copied unchanged from r1389188, lucene/dev/trunk/lucene/spatial/src/java/org/apache/lucene/spatial/query/package.html
    lucene/dev/branches/branch_4x/lucene/tools/javadoc/ecj.javadocs.prefs
      - copied unchanged from r1389188, lucene/dev/trunk/lucene/tools/javadoc/ecj.javadocs.prefs
Removed:
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/package-info.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/package-info.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/prefix/tree/package-info.java
    lucene/dev/branches/branch_4x/lucene/spatial/src/java/org/apache/lucene/spatial/query/package-info.java
Modified:
    lucene/dev/branches/branch_4x/   (props changed)
    lucene/dev/branches/branch_4x/lucene/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/   (props changed)
    lucene/dev/branches/branch_4x/lucene/analysis/build.xml
    lucene/dev/branches/branch_4x/lucene/build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/lucene/common-build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/lucene/module-build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/lucene/spatial/   (props changed)
    lucene/dev/branches/branch_4x/lucene/tools/   (props changed)
    lucene/dev/branches/branch_4x/solr/   (props changed)
    lucene/dev/branches/branch_4x/solr/build.xml   (contents, props changed)
    lucene/dev/branches/branch_4x/solr/contrib/   (props changed)
    lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler-extras/build.xml
    lucene/dev/branches/branch_4x/solr/solrj/   (props changed)
    lucene/dev/branches/branch_4x/solr/solrj/build.xml

Modified: lucene/dev/branches/branch_4x/lucene/analysis/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/analysis/build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/analysis/build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/analysis/build.xml Mon Sep 24 03:05:28 2012
@@ -126,5 +126,9 @@
   <target name="rat-sources">
     <forall-analyzers target="rat-sources"/>
   </target>
+
+  <target name="-ecj-javadoc-lint">
+    <forall-analyzers target="-ecj-javadoc-lint"/>
+  </target>
 	
 </project>

Modified: lucene/dev/branches/branch_4x/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/build.xml Mon Sep 24 03:05:28 2012
@@ -225,9 +225,16 @@
   <target name="javadocs" description="Generate javadoc" depends="javadocs-lucene-core, javadocs-modules, javadocs-test-framework"/>
 
   <!-- we check for broken links across all documentation -->
-  <target name="documentation-lint" depends="documentation">
+  <target name="documentation-lint" depends="compile-test-framework,documentation">
     <sequential>
+      <subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
+        <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

Modified: lucene/dev/branches/branch_4x/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/common-build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/common-build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/common-build.xml Mon Sep 24 03:05:28 2012
@@ -169,6 +169,7 @@
 
   <property name="src.dir" location="src/java"/>
   <property name="tests.src.dir" location="src/test"/>
+  <available property="module.has.tests" type="dir" file="${tests.src.dir}"/>
   <property name="build.dir" location="build"/>
   <!-- Needed in case a module needs the original build, also for compile-tools to be called from a module -->
   <property name="common.build.dir" location="${common.dir}/build"/>
@@ -1475,6 +1476,49 @@ ${tests-output}/junit4-*.suites     - pe
     </sequential>
   </macrodef>
 
+  <target name="-ecj-javadoc-lint" depends="-ecj-javadoc-lint-src,-ecj-javadoc-lint-tests"/>
+
+  <target name="-ecj-javadoc-lint-src">
+    <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" if="module.has.tests">
+    <ecj-macro srcdir="${tests.src.dir}" configuration="${common.dir}/tools/javadoc/ecj.javadocs.prefs">
+      <classpath refid="test.classpath"/>
+    </ecj-macro>
+  </target>
+
+  <macrodef name="ecj-macro">
+    <attribute name="srcdir"/>
+    <attribute name="javac.source" default="${javac.source}"/>
+    <attribute name="includeantruntime" default="${javac.includeAntRuntime}" />
+    <attribute name="configuration"/>
+
+    <element name="nested" implicit="yes" optional="yes"/>
+
+    <sequential>
+      <ivy:cachepath
+        organisation="org.eclipse.jdt.core.compiler" module="ecj"
+        revision="3.7.2" inline="true" conf="master" type="jar"
+        pathid="ecj.classpath" log="download-only" />
+      <javac
+        compiler="org.eclipse.jdt.core.JDTCompilerAdapter"
+        includeAntRuntime="@{includeantruntime}"
+        encoding="${build.encoding}"
+        srcdir="@{srcdir}"
+        source="@{javac.source}"
+        target="@{javac.source}">
+        <nested/>
+        <compilerclasspath>
+          <path refid="ecj.classpath"/>
+        </compilerclasspath>
+        <compilerarg line="-d none -enableJavadoc -properties @{configuration}"/>
+      </javac>
+    </sequential>
+  </macrodef>
+
   <property name="failonjavadocwarning" value="true"/>
   <macrodef name="invoke-javadoc">
     <element name="sources" optional="yes"/>

Modified: lucene/dev/branches/branch_4x/lucene/module-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/module-build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/module-build.xml (original)
+++ lucene/dev/branches/branch_4x/lucene/module-build.xml Mon Sep 24 03:05:28 2012
@@ -28,8 +28,6 @@
 
   <import file="common-build.xml"/>
 
-  <available property="module.has.tests" type="dir" file="src/test" />
-  
   <!-- if you extend the classpath refid in one contrib's build.xml (add JARs), use this as basis: -->
   <path id="base.classpath">
    <pathelement location="${common.dir}/build/core/classes/java"/>

Modified: lucene/dev/branches/branch_4x/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/build.xml Mon Sep 24 03:05:28 2012
@@ -522,8 +522,16 @@
 
   <!-- TODO: does solr have any other docs we should check? -->
   <!-- TODO: also integrate checkJavaDocs.py, which does more checks -->
-  <target name="documentation-lint" depends="documentation">
+  <target name="documentation-lint" depends="compile-solr-test-framework,documentation">
+    <subant target="-ecj-javadoc-lint" failonerror="true" inheritall="false">
+      <fileset dir="core" includes="build.xml"/>
+      <fileset dir="solrj" includes="build.xml"/>
+      <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>

Modified: lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler-extras/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler-extras/build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler-extras/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/contrib/dataimporthandler-extras/build.xml Mon Sep 24 03:05:28 2012
@@ -89,6 +89,8 @@
     </ant>
   </target>
 
+  <target name="-ecj-javadoc-lint-tests" depends="compile-solr-dataimporthandler-tests,common.-ecj-javadoc-lint-tests"/>
+
   <target name="compile-core" depends="compile-solr-dataimporthandler,resolve-extraction-libs,solr-contrib-build.compile-core"/>
   <target name="compile-test" depends="compile-solr-dataimporthandler-tests, common-solr.compile-test"/>
 </project>

Modified: lucene/dev/branches/branch_4x/solr/solrj/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/solr/solrj/build.xml?rev=1389192&r1=1389191&r2=1389192&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/solr/solrj/build.xml (original)
+++ lucene/dev/branches/branch_4x/solr/solrj/build.xml Mon Sep 24 03:05:28 2012
@@ -46,6 +46,20 @@
      </sequential>
   </target>
 
+  <!-- Specialized to use lucene's classpath too, because it refs e.g. qp syntax 
+       (even though it doesnt compile with it) 
+       TODO: would be nice to fix this up better, but its hard because of
+       the different ways solr links to lucene javadocs -->
+  <target name="-ecj-javadoc-lint-src">
+    <ecj-macro srcdir="${src.dir}" configuration="${common.dir}/tools/javadoc/ecj.javadocs.prefs">
+      <classpath>
+        <path refid="classpath"/>
+        <path refid="solr.lucene.libs"/>
+      </classpath>
+    </ecj-macro>
+  </target>
+
+
   <target name="dist" depends="common-solr.dist">
     <mkdir  dir="${dist}/solrj-lib" />
     <copy todir="${dist}/solrj-lib">