LUCENE-5945: Changes to forbidden, as discussed on issue.

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1624785 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Uwe Schindler 2014-09-13 21:59:31 +00:00
parent 3eb66fb19c
commit 6a4bce5e17
1 changed files with 6 additions and 11 deletions

View File

@ -2356,7 +2356,7 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
</path> </path>
</target> </target>
<condition property="islucene" value="true" else="false"> <condition property="forbidden-isLucene">
<not> <not>
<or> <or>
<matches pattern="^(solr)\b" string="${name}"/> <matches pattern="^(solr)\b" string="${name}"/>
@ -2365,27 +2365,22 @@ ${ant.project.name}.test.dependencies=${test.classpath.list}
</not> </not>
</condition> </condition>
<target name="check-forbidden-apis" depends="-check-forbidden-all,-check-forbidden-core,-check-forbidden-tests,-check-forbidden-lucene" description="Check forbidden API calls in compiled class files"/> <target name="check-forbidden-apis" depends="-check-forbidden-all,-check-forbidden-core,-check-forbidden-tests" description="Check forbidden API calls in compiled class files"/>
<!-- applies to both source and test code --> <!-- applies to both source and test code -->
<target name="-check-forbidden-all" depends="-init-forbidden-apis,compile-core,compile-test"> <target name="-check-forbidden-all" depends="-init-forbidden-apis,compile-core,compile-test">
<forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.allclasses.classpath"> <forbidden-apis internalRuntimeForbidden="true" classpathref="forbidden-apis.allclasses.classpath">
<bundledSignatures name="jdk-unsafe-${javac.target}"/> <bundledSignatures name="jdk-unsafe-${javac.target}"/>
<bundledSignatures name="jdk-deprecated-${javac.target}"/> <bundledSignatures name="jdk-deprecated-${javac.target}"/>
<signaturesFileSet file="${common.dir}/tools/forbiddenApis/base.txt"/> <signaturesFileSet dir="${common.dir}/tools/forbiddenApis">
<include name="base.txt"/>
<include name="lucene.txt" if="forbidden-isLucene"/>
</signaturesFileSet>
<fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/> <fileset dir="${build.dir}/classes/java" excludes="${forbidden-base-excludes}"/>
<fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/> <fileset dir="${build.dir}/classes/test" excludes="${forbidden-tests-excludes}" erroronmissingdir="false"/>
</forbidden-apis> </forbidden-apis>
</target> </target>
<!-- applies to only lucene API -->
<target name="-check-forbidden-lucene" depends="-init-forbidden-apis,compile-core,compile-test" if="${islucene}">
<forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/lucene.txt" classpathref="forbidden-apis.allclasses.classpath">
<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>
<!-- applies to only test code --> <!-- applies to only test code -->
<target name="-check-forbidden-tests" depends="-init-forbidden-apis,compile-test"> <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"> <forbidden-apis signaturesFile="${common.dir}/tools/forbiddenApis/tests.txt" classpathref="forbidden-apis.allclasses.classpath">