]> source.dussan.org Git - poi.git/commitdiff
Enable the Forbidden APIs checks on Main, Scratchpad and OOXML. Run with "ant forbidd...
authorNick Burch <nick@apache.org>
Thu, 27 Aug 2015 13:23:44 +0000 (13:23 +0000)
committerNick Burch <nick@apache.org>
Thu, 27 Aug 2015 13:23:44 +0000 (13:23 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1698148 13f79535-47bb-0310-9956-ffa450edef68

build.xml

index 89718f9a9bb0edf75bd37fb2e2ccf2187f5db4d2..add72bbbd9f33220f2eec596b721f089e33bad06 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1730,7 +1730,27 @@ under the License.
     <!-- See https://github.com/policeman-tools/forbidden-apis for details -->
     <!--  of the checks that this can do -->
     <target name="forbidden-apis-check" depends="init">
-       <fail message="TODO" />
+        <taskdef name="forbiddenapis" 
+                 classname="de.thetaphi.forbiddenapis.AntTask" 
+                 classpath="${forbidden.jar}"/>
+        <antcall target="-do-forbidden-apis-check">
+            <param name="dir" value="${main.output.dir}"/>
+        </antcall>
+        <antcall target="-do-forbidden-apis-check">
+            <param name="dir" value="${scratchpad.output.dir}"/>
+        </antcall>
+        <antcall target="-do-forbidden-apis-check">
+            <param name="dir" value="${ooxml.output.dir}"/>
+        </antcall>
+    </target>
+    <target name="-do-forbidden-apis-check">
+        <forbiddenapis 
+                 internalRuntimeForbidden="true" 
+                 classpathref="javadoc.classpath" 
+                 dir="${dir}">
+            <bundledsignatures name="jdk-unsafe-${jdk.version.source}"/>
+            <bundledsignatures name="jdk-deprecated-${jdk.version.source}"/>
+        </forbiddenapis>
     </target>
 
     <target name="findbugs"><!-- depends="assemble" -->