You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by us...@apache.org on 2013/11/10 23:50:51 UTC

svn commit: r1540573 - in /lucene/dev/trunk: lucene/ lucene/analysis/ lucene/analysis/stempel/ lucene/benchmark/ lucene/core/ lucene/demo/ lucene/facet/ lucene/misc/ lucene/queryparser/ lucene/test-framework/ lucene/tools/ solr/ solr/core/ solr/solrj/ ...

Author: uschindler
Date: Sun Nov 10 22:50:51 2013
New Revision: 1540573

URL: http://svn.apache.org/r1540573
Log:
LUCENE-4753: Run forbidden-apis Ant task per module. This allows more improvements and prevents OOMs after the number of class files raised recently

Modified:
    lucene/dev/trunk/lucene/CHANGES.txt
    lucene/dev/trunk/lucene/analysis/build.xml
    lucene/dev/trunk/lucene/analysis/stempel/build.xml
    lucene/dev/trunk/lucene/benchmark/build.xml
    lucene/dev/trunk/lucene/build.xml
    lucene/dev/trunk/lucene/common-build.xml
    lucene/dev/trunk/lucene/core/build.xml
    lucene/dev/trunk/lucene/demo/build.xml
    lucene/dev/trunk/lucene/facet/build.xml
    lucene/dev/trunk/lucene/misc/build.xml
    lucene/dev/trunk/lucene/queryparser/build.xml
    lucene/dev/trunk/lucene/test-framework/build.xml
    lucene/dev/trunk/lucene/tools/build.xml
    lucene/dev/trunk/solr/build.xml
    lucene/dev/trunk/solr/common-build.xml
    lucene/dev/trunk/solr/core/build.xml
    lucene/dev/trunk/solr/solrj/build.xml
    lucene/dev/trunk/solr/test-framework/build.xml

Modified: lucene/dev/trunk/lucene/CHANGES.txt
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/CHANGES.txt?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/CHANGES.txt (original)
+++ lucene/dev/trunk/lucene/CHANGES.txt Sun Nov 10 22:50:51 2013
@@ -286,6 +286,10 @@ Build
 * LUCENE-5322: Clean up / simplify Maven-related Ant targets.
   (Steve Rowe)
 
+* LUCENE-4753: Run forbidden-apis Ant task per module. This allows more
+  improvements and prevents OOMs after the number of class files
+  raised recently.  (Uwe Schindler)
+
 Tests
 
 * LUCENE-5278: Fix MockTokenizer to work better with more regular expression

Modified: lucene/dev/trunk/lucene/analysis/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/build.xml (original)
+++ lucene/dev/trunk/lucene/analysis/build.xml Sun Nov 10 22:50:51 2013
@@ -147,4 +147,8 @@
     <forall-analyzers target="-append-module-dependencies-properties"/>
   </target>
 	
+  <target name="check-forbidden-apis">
+    <forall-analyzers target="check-forbidden-apis"/>
+  </target>
+
 </project>

Modified: lucene/dev/trunk/lucene/analysis/stempel/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/analysis/stempel/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/analysis/stempel/build.xml (original)
+++ lucene/dev/trunk/lucene/analysis/stempel/build.xml Sun Nov 10 22:50:51 2013
@@ -23,6 +23,11 @@
     Analyzer for indexing Polish
   </description>
 	
+  <property name="forbidden-sysout-excludes" value="
+    org/egothor/stemmer/Compile.class
+    org/egothor/stemmer/DiffIt.class
+  "/>
+
   <import file="../analysis-module-build.xml"/>
 
   <path id="classpath">

Modified: lucene/dev/trunk/lucene/benchmark/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/benchmark/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/benchmark/build.xml (original)
+++ lucene/dev/trunk/lucene/benchmark/build.xml Sun Nov 10 22:50:51 2013
@@ -26,6 +26,9 @@
     <import file="../module-build.xml"/>
     <property name="working.dir" location="work"/>
 
+    <!-- benchmark creates lots of sysout stuff, so dont run forbidden! -->
+    <target name="-check-forbidden-sysout"/>
+
     <target name="check-files">
         <available file="temp/news20.tar.gz" property="news20.exists"/>
 

Modified: lucene/dev/trunk/lucene/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/build.xml (original)
+++ lucene/dev/trunk/lucene/build.xml Sun Nov 10 22:50:51 2013
@@ -174,64 +174,15 @@
     <lib-versions-check-macro dir="${common.dir}/.." centralized.versions.file="${common.dir}/ivy-versions.properties"/>
   </target>
 
-  <target name="check-forbidden-apis" depends="compile-tools,compile-test,install-forbidden-apis,-forbidden-apis-classpath,-check-forbidden-jdk-apis,-check-forbidden-test-apis,-check-system-out" description="Check forbidden API calls in compiled class files"/>
-
-  <!-- TODO: Make the forbidden API checks per module! -->
-  <target name="-forbidden-apis-classpath">
-    <path id="forbidden-apis.classpath">
-      <fileset dir="${basedir}" includes="**/lib/*.jar"/>
-      <dirset dir="${basedir}/build" includes="**/classes/*"/>
-    </path>
-  </target>
-
-  <target name="-check-forbidden-jdk-apis">
-    <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.classpath">
-      <bundledSignatures name="jdk-unsafe-${javac.target}"/>
-      <bundledSignatures name="jdk-deprecated-${javac.target}"/>
-      <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
-        <include name="base.txt" />
-      </signaturesFileSet>
-      <fileset dir="${basedir}/build" includes="**/*.class" />
-    </forbidden-apis>
-  </target>
-
-  <target name="-check-forbidden-test-apis">
-    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.classpath"> 
-      <classpath refid="junit-path"/>
-      <fileset dir="${basedir}/build" includes="**/classes/test/**/*.class,test-framework/**/*.class" />
-    </forbidden-apis>
-  </target>
-
-  <target name="-check-system-out">
-    <forbidden-apis bundledSignatures="jdk-system-out" classpathref="forbidden-apis.classpath">
-      <fileset dir="${basedir}/build">
-        <include name="**/classes/java/**/*.class"/>
-        <!-- this is basically tests -->
-        <exclude name="test-framework/**"/>
-        <!-- exclude command line tools -->
-        <exclude name="core/classes/java/org/apache/lucene/index/CheckIndex.class"/>
-        <exclude name="core/classes/java/org/apache/lucene/index/IndexUpgrader.class"/>
-        <exclude name="core/classes/java/org/apache/lucene/store/LockVerifyServer.class"/>
-        <exclude name="core/classes/java/org/apache/lucene/store/LockStressTest.class"/>
-        <exclude name="analysis/stempel/classes/java/org/egothor/stemmer/Compile.class"/>
-        <exclude name="analysis/stempel/classes/java/org/egothor/stemmer/DiffIt.class"/>
-        <exclude name="benchmark/**"/>
-        <exclude name="demo/classes/java/org/apache/lucene/**"/>
-        <exclude name="misc/classes/java/org/apache/lucene/index/CompoundFileExtractor.class"/>
-        <exclude name="misc/classes/java/org/apache/lucene/index/IndexSplitter.class"/>
-        <exclude name="misc/classes/java/org/apache/lucene/index/MultiPassIndexSplitter.class"/>
-        <exclude name="misc/classes/java/org/apache/lucene/misc/GetTermInfo.class"/>
-        <exclude name="misc/classes/java/org/apache/lucene/misc/HighFreqTerms.class"/>
-        <exclude name="misc/classes/java/org/apache/lucene/misc/IndexMergeTool.class"/>
-        <!-- not printing, just checking if its a system stream -->
-        <exclude name="core/classes/java/org/apache/lucene/util/PrintStreamInfoStream.class"/>
-        <!-- not printing, just generated code from javacc -->
-        <exclude name="queryparser/classes/java/org/apache/lucene/queryparser/classic/QueryParserTokenManager.class"/>
-        <exclude name="queryparser/classes/java/org/apache/lucene/queryparser/flexible/standard/parser/StandardSyntaxParserTokenManager.class"/>
-        <exclude name="queryparser/classes/java/org/apache/lucene/queryparser/surround/parser/QueryParserTokenManager.class"/>
-        <exclude name="facet/classes/java/org/apache/lucene/facet/util/PrintTaxonomyStats.class"/>
-      </fileset>
-    </forbidden-apis>
+  <!-- -install-forbidden-apis is *not* a useless dependency. do not remove -->
+  <target name="check-forbidden-apis" depends="-install-forbidden-apis" description="Check forbidden API calls in compiled class files">
+    <subant target="check-forbidden-apis" failonerror="true" inheritall="false">
+      <propertyset refid="uptodate.and.compiled.properties"/>
+      <fileset dir="core" includes="build.xml"/>
+      <fileset dir="test-framework" includes="build.xml"/>
+      <fileset dir="tools" includes="build.xml"/>
+    </subant>
+    <modules-crawl target="check-forbidden-apis"/>
   </target>
 
   <target name="resolve">

Modified: lucene/dev/trunk/lucene/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/common-build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/common-build.xml (original)
+++ lucene/dev/trunk/lucene/common-build.xml Sun Nov 10 22:50:51 2013
@@ -2176,13 +2176,52 @@ ${ant.project.name}.test.dependencies=${
   </target>
   
   <!-- Forbidden API Task -->
-  <target name="install-forbidden-apis" unless="forbidden-apis.loaded" depends="ivy-availability-check,ivy-configure">
+  <property name="forbidden-base-excludes" value=""/>
+  <property name="forbidden-tests-excludes" value=""/>
+  <property name="forbidden-sysout-excludes" value=""/>
+  
+  <target name="-install-forbidden-apis" unless="forbidden-apis.loaded" depends="ivy-availability-check,ivy-configure">
     <ivy:cachepath organisation="de.thetaphi" module="forbiddenapis" revision="1.3"
       inline="true" conf="default" transitive="true" pathid="forbidden-apis.classpath"/>
     <taskdef name="forbidden-apis" classname="de.thetaphi.forbiddenapis.AntTask" classpathref="forbidden-apis.classpath"/>
     <property name="forbidden-apis.loaded" value="true"/>
+  </target>  
+
+  <target name="-init-forbidden-apis" depends="-install-forbidden-apis">
+    <path id="forbidden-apis.allclasses.classpath">
+      <path refid="classpath"/>
+      <path refid="test.classpath"/>
+      <path refid="junit-path"/>
+      <!-- include the output directories, too (so we can still resolve excluded classes: -->
+      <pathelement path="${build.dir}/classes/java"/>
+      <pathelement path="${build.dir}/classes/test"/>
+    </path>
+  </target>  
+
+  <target name="check-forbidden-apis" depends="-check-forbidden-base,-check-forbidden-tests,-check-forbidden-sysout" description="Check forbidden API calls in compiled class files"/>
+  
+  <target name="-check-forbidden-base" depends="-init-forbidden-apis,compile-core,compile-test">
+    <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.allclasses.classpath">
+      <bundledSignatures name="jdk-unsafe-${javac.target}"/>
+      <bundledSignatures name="jdk-deprecated-${javac.target}"/>
+      <signaturesFileSet file="${common.dir}/tools/forbiddenApis/base.txt"/>
+      <fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/>
+      <fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
+    </forbidden-apis>
   </target>
   
+  <target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-test">
+    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.allclasses.classpath"> 
+      <fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}"/>
+    </forbidden-apis>
+  </target>
+    
+  <target name="-check-forbidden-sysout" depends="-init-forbidden-apis,compile-core">
+    <forbidden-apis bundledSignatures="jdk-system-out" classpathref="forbidden-apis.allclasses.classpath">
+      <fileset dir="${build.dir}/classes/java" excludes="${forbidden-sysout-excludes}"/>
+    </forbidden-apis>
+  </target>
+
   <!-- PEGDOWN macro: Before using depend on the target "resolve-pegdown,resolve-groovy" -->
   
   <target name="resolve-pegdown" unless="pegdown.loaded" depends="ivy-availability-check,ivy-configure">

Modified: lucene/dev/trunk/lucene/core/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/core/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/core/build.xml (original)
+++ lucene/dev/trunk/lucene/core/build.xml Sun Nov 10 22:50:51 2013
@@ -22,6 +22,14 @@
 
   <property name="build.dir" location="../build/core"/>
 
+  <property name="forbidden-sysout-excludes" value="
+    org/apache/lucene/index/CheckIndex.class
+    org/apache/lucene/index/IndexUpgrader.class
+    org/apache/lucene/store/LockVerifyServer.class
+    org/apache/lucene/store/LockStressTest.class
+    org/apache/lucene/util/PrintStreamInfoStream.class
+  "/>
+
   <import file="../common-build.xml"/>
 
   <property name="moman.commit-hash" value="5c5c2a1e4dea" />

Modified: lucene/dev/trunk/lucene/demo/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/demo/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/demo/build.xml (original)
+++ lucene/dev/trunk/lucene/demo/build.xml Sun Nov 10 22:50:51 2013
@@ -53,6 +53,9 @@
     </invoke-module-javadoc>
   </target>
 
+  <!-- we don't check for sysout in demo, because the demo is there to use sysout :-) -->
+  <target name="-check-forbidden-sysout"/>
+
   <target name="compile-core" depends="jar-analyzers-common,jar-queryparser,jar-queries,jar-facet,jar-expressions,common.compile-core" />
 
   <target name="default" depends="jar-core,build-web-demo"/>

Modified: lucene/dev/trunk/lucene/facet/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/facet/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/facet/build.xml (original)
+++ lucene/dev/trunk/lucene/facet/build.xml Sun Nov 10 22:50:51 2013
@@ -23,6 +23,10 @@
     Faceted indexing and search capabilities
   </description>
 
+  <property name="forbidden-sysout-excludes" value="
+    org/apache/lucene/facet/util/PrintTaxonomyStats.class
+  "/>
+
   <import file="../module-build.xml"/>
 
   <path id="classpath">

Modified: lucene/dev/trunk/lucene/misc/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/misc/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/misc/build.xml (original)
+++ lucene/dev/trunk/lucene/misc/build.xml Sun Nov 10 22:50:51 2013
@@ -23,6 +23,15 @@
     Index tools and other miscellaneous code
   </description>
 
+  <property name="forbidden-sysout-excludes" value="
+    org/apache/lucene/index/CompoundFileExtractor.class
+    org/apache/lucene/index/IndexSplitter.class
+    org/apache/lucene/index/MultiPassIndexSplitter.class
+    org/apache/lucene/misc/GetTermInfo.class
+    org/apache/lucene/misc/HighFreqTerms.class
+    org/apache/lucene/misc/IndexMergeTool.class
+  "/>
+
   <import file="../module-build.xml"/>
 
   <target name="install-cpptasks" unless="cpptasks.uptodate" depends="ivy-availability-check,ivy-fail,ivy-configure">

Modified: lucene/dev/trunk/lucene/queryparser/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/queryparser/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/queryparser/build.xml (original)
+++ lucene/dev/trunk/lucene/queryparser/build.xml Sun Nov 10 22:50:51 2013
@@ -20,6 +20,11 @@
     Query parsers and parsing framework
   </description>
 
+  <!-- TODO: remove the stupid debugStream in the JavaCC TokenManager classes with an additional regex below! -->
+  <property name="forbidden-sysout-excludes" value="
+    org/apache/lucene/queryparser/**/*TokenManager.class
+  "/>
+
   <import file="../module-build.xml"/>
 
   <path id="classpath">

Modified: lucene/dev/trunk/lucene/test-framework/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/test-framework/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/test-framework/build.xml (original)
+++ lucene/dev/trunk/lucene/test-framework/build.xml Sun Nov 10 22:50:51 2013
@@ -42,6 +42,17 @@
   <!-- redefine the clover setup, because we dont want to run clover for the test-framework -->
   <target name="-clover.setup" if="run.clover"/>
 
+  <!-- redefine the test compilation, so its just a no-op -->
+  <target name="compile-test"/>
+  
+  <!-- redefine the forbidden apis for tests, as we check ourselves - no sysout testing -->
+  <target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-core">
+    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.allclasses.classpath"> 
+      <fileset dir="${build.dir}/classes/java"/>
+    </forbidden-apis>
+  </target>
+  <target name="-check-forbidden-sysout"/>
+
   <target name="javadocs-core" depends="javadocs"/>
   <target name="javadocs" depends="init,javadocs-lucene-core,javadocs-lucene-codecs">
     <sequential>

Modified: lucene/dev/trunk/lucene/tools/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/lucene/tools/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/lucene/tools/build.xml (original)
+++ lucene/dev/trunk/lucene/tools/build.xml Sun Nov 10 22:50:51 2013
@@ -27,8 +27,19 @@
   <import file="../common-build.xml"/>
 
   <path id="classpath">
+    <!-- TODO: we need this for forbidden-apis to be happy, because it does not support "includeantruntime": -->
+    <path refid="ant-path"/>
   </path>
 
+  <path id="test.classpath"/>
+
+  <!-- redefine the test compilation, so its just a no-op -->
+  <target name="compile-test"/>
+  
+  <!-- redefine the forbidden apis to be no-ops -->
+  <target name="-check-forbidden-tests"/>
+  <target name="-check-forbidden-sysout"/>
+
   <!--  
       Specialize compile-core to not depend on clover, to exclude a 
       classpath reference when compiling, and to not attempt to copy

Modified: lucene/dev/trunk/solr/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/solr/build.xml (original)
+++ lucene/dev/trunk/solr/build.xml Sun Nov 10 22:50:51 2013
@@ -267,49 +267,14 @@
     </license-check-macro>
   </target>
   
-  <target name="check-forbidden-apis" depends="compile-tools,compile-test,install-forbidden-apis,-forbidden-apis-classpath,-check-forbidden-java-apis,-check-forbidden-test-apis" 
-          description="Check forbidden API calls in compiled class files."/>
-
-  <!-- TODO: Make the forbidden API checks per module! Also remove failOnMissingClasses="false" below!!! -->
-  <target name="-forbidden-apis-classpath">
-    <path id="forbidden-apis.classpath">
-      <fileset dir="${basedir}" includes="**/lib/*.jar,**/test-lib/*.jar"/>
-      <dirset dir="${basedir}/build" includes="**/classes/*"/>
-      <path refid="solr.lucene.libs"/>
-      <path refid="classpath"/>
-      <path refid="test.classpath"/>
-    </path>
-  </target>
-
-  <target name="-check-forbidden-java-apis">
-    <property file="${common.dir}/ivy-versions.properties"/> <!-- for commons-io version -->
-    <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.classpath" failOnMissingClasses="false">
-      <bundledSignatures name="jdk-unsafe-${javac.target}"/>
-      <bundledSignatures name="jdk-deprecated-${javac.target}"/>
-      <bundledSignatures name="commons-io-unsafe-${/commons-io/commons-io}"/>
-      <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
-        <include name="base.txt" />
-        <include name="servlet-api.txt" />
-      </signaturesFileSet>
-      <fileset dir="${basedir}/build">
-        <include name="**/*.class" />        
-        <!-- violates the servlet-api restrictions, but it is safe to do so in this test: -->
-        <exclude name="solr-solrj/classes/test/org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest$DebugServlet.class"/>
-      </fileset>
-    </forbidden-apis>
-  </target>
-
-  <target name="-check-forbidden-test-apis">
-    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.classpath" failOnMissingClasses="false">
-      <fileset dir="${basedir}/build">
-        <include name="**/classes/test/**/*.class"/>
-        <include name="solr-test-framework/**/*.class"/>
-        <!-- not actually a test -->
-        <exclude name="solr-core/classes/test/org/apache/solr/search/DocSetPerf.class"/>
-        <!-- imported code -->
-        <exclude name="solr-core/classes/test/org/apache/solr/internal/**/*.class"/>
-      </fileset>
-    </forbidden-apis>
+  <target name="check-forbidden-apis" depends="-install-forbidden-apis" description="Check forbidden API calls in compiled class files.">
+    <subant target="check-forbidden-apis" inheritall="false" >
+      <propertyset refid="uptodate.and.compiled.properties"/>
+      <fileset dir="core" includes="build.xml"/>
+      <fileset dir="solrj" includes="build.xml"/>
+      <fileset dir="test-framework" includes="build.xml"/>
+    </subant>
+    <contrib-crawl target="check-forbidden-apis" failonerror="true"/>
   </target>
 
   <!-- rat sources -->

Modified: lucene/dev/trunk/solr/common-build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/common-build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/solr/common-build.xml (original)
+++ lucene/dev/trunk/solr/common-build.xml Sun Nov 10 22:50:51 2013
@@ -466,6 +466,24 @@
     <contrib-crawl target="add-to-war"/>
   </target>
   
+  <!-- Forbidden API Task, customizations for Solr -->
+  <target name="-check-forbidden-base" depends="-init-forbidden-apis,compile-core,compile-test">
+    <property file="${common.dir}/ivy-versions.properties"/> <!-- for commons-io version -->
+    <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.allclasses.classpath">
+      <bundledSignatures name="jdk-unsafe-${javac.target}"/>
+      <bundledSignatures name="jdk-deprecated-${javac.target}"/>
+      <bundledSignatures name="commons-io-unsafe-${/commons-io/commons-io}"/>
+      <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
+        <include name="base.txt" />
+        <include name="servlet-api.txt" />
+      </signaturesFileSet>
+      <fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/>
+      <fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
+    </forbidden-apis>
+  </target>
+  
+  <target name="-check-forbidden-sysout"/>
+
   <!-- hack for now to disable *all* Solr tests on Jenkins when "tests.disable-solr" property is set -->
   <target name="test" unless="tests.disable-solr">
     <antcall target="common.test" inheritrefs="true" inheritall="true"/>

Modified: lucene/dev/trunk/solr/core/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/core/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/solr/core/build.xml (original)
+++ lucene/dev/trunk/solr/core/build.xml Sun Nov 10 22:50:51 2013
@@ -23,6 +23,11 @@
   
   <property name="test.lib.dir" location="test-lib"/>
 
+  <property name="forbidden-tests-excludes" value="
+    org/apache/solr/internal/**
+    org/apache/solr/search/DocSetPerf.class
+  "/>
+
   <import file="../common-build.xml"/>
 
   <target name="compile-core" depends="compile-solrj,common-solr.compile-core"/>

Modified: lucene/dev/trunk/solr/solrj/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/solrj/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/solr/solrj/build.xml (original)
+++ lucene/dev/trunk/solr/solrj/build.xml Sun Nov 10 22:50:51 2013
@@ -18,6 +18,11 @@
 <project name="solr-solrj" default="default">
   <description>Solrj - Solr Java Client</description>
 
+  <!-- violates the servlet-api restrictions, but it is safe to do so in this test: -->
+  <property name="forbidden-tests-excludes" value="
+    org/apache/solr/client/solrj/impl/BasicHttpSolrServerTest$DebugServlet.class
+  "/>
+
   <import file="../common-build.xml"/>
 
   <!-- Specialized compile classpath: to only depend on what solrj should depend on (e.g. not lucene) -->

Modified: lucene/dev/trunk/solr/test-framework/build.xml
URL: http://svn.apache.org/viewvc/lucene/dev/trunk/solr/test-framework/build.xml?rev=1540573&r1=1540572&r2=1540573&view=diff
==============================================================================
--- lucene/dev/trunk/solr/test-framework/build.xml (original)
+++ lucene/dev/trunk/solr/test-framework/build.xml Sun Nov 10 22:50:51 2013
@@ -46,6 +46,16 @@
   <!-- redefine the clover setup, because we dont want to run clover for the test-framework -->
   <target name="-clover.setup" if="run.clover"/>
 
+  <!-- redefine the test compilation, so its just a no-op -->
+  <target name="compile-test"/>
+  
+  <!-- redefine the forbidden apis for tests, as we check ourselves -->
+  <target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-core">
+    <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.allclasses.classpath"> 
+      <fileset dir="${build.dir}/classes/java"/>
+    </forbidden-apis>
+  </target>
+
   <!-- Override common-solr.javadocs to include JUnit links -->
   <!-- and to copy the built javadocs to ${dest}/docs/api/test-framework -->
   <target name="javadocs"