Skip to content

Commit edf70bf

Browse files
committed
Merge pull request #50 from policeman-tools/features/deprecated-gen-java9
PR #50: Rewrite tool to generate deprecated signatures for Java 9
2 parents 708957d + dc573dc commit edf70bf

12 files changed

+669
-100
lines changed

build.xml

+7-21
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
<equals arg1="${-cleaned.specification.version}" arg2="1.6"/>
5858
<equals arg1="${-cleaned.specification.version}" arg2="1.7"/>
5959
<equals arg1="${-cleaned.specification.version}" arg2="1.8"/>
60+
<equals arg1="${-cleaned.specification.version}" arg2="1.9"/>
6061
</or>
6162
</condition>
6263

@@ -66,6 +67,7 @@
6667
<condition property="build.compiler" value="javac1.7">
6768
<and>
6869
<or>
70+
<equals arg1="${build.java.runtime}" arg2="1.9"/>
6971
<equals arg1="${build.java.runtime}" arg2="1.8"/>
7072
<equals arg1="${build.java.runtime}" arg2="unknown"/>
7173
</or>
@@ -90,6 +92,7 @@
9092
<property name="ivy.logging" value="download-only"/>
9193

9294
<property name="signatures.dir" location="src/main/resources/de/thetaphi/forbiddenapis/signatures"/>
95+
<property name="groovy-tools.dir" location="src/tools/groovy"/>
9396
<property name="maven-build-dir" location="build/maven"/>
9497
<property name="documentation-dir" location="build/docs"/>
9598

@@ -173,6 +176,7 @@
173176
<ivy:cachepath pathid="path.tasks" conf="buildtools" log="${ivy.logging}"/>
174177
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="path.tasks"/>
175178
<taskdef uri="antlib:org.apache.maven.artifact.ant" classpathref="path.tasks"/>
179+
<taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy" classpathref="path.tasks"/>
176180
<property name="installed.tasks" value="true"/>
177181
</target>
178182

@@ -469,28 +473,10 @@
469473
<echo level="warn" message="Test suite / bundled signatures checker was not executed, because the used JVM version is unsupported: ${build.java.info}"/>
470474
</target>
471475

472-
<target name="generate-deprecated" depends="compile-tools" description="Generates deprecated API signature lists for current JDK">
473-
<fail message="Regenerating the deprecated signatures files need stock Oracle/Sun JDK, but your Java version or operating system is unsupported: ${build.java.info}">
474-
<condition>
475-
<not>
476-
<and>
477-
<available file="${java.home}/lib/rt.jar"/>
478-
<matches string="${java.version}" pattern="^\Q${build.java.runtime}\E" casesensitive="true"/>
479-
<or>
480-
<contains string="${java.vendor}" substring="Oracle" casesensitive="false"/>
481-
<contains string="${java.vendor}" substring="Sun Microsystems" casesensitive="false"/>
482-
</or>
483-
</and>
484-
</not>
485-
</condition>
486-
</fail>
476+
<target name="generate-deprecated" depends="compile-tools,-install-tasks" description="Generates deprecated API signature lists for current JDK">
487477
<mkdir dir="${signatures.dir}"/>
488-
<echo level="info" message="Building deprecated signatures for JDK ${build.java.runtime}:"/>
489-
<java fork="false" classpathref="path.tools-run" classname="de.thetaphi.forbiddenapis.DeprecatedGen">
490-
<arg value="${build.java.runtime}"/>
491-
<arg file="${java.home}/lib/rt.jar"/>
492-
<arg file="${signatures.dir}/jdk-deprecated-${build.java.runtime}.txt"/>
493-
</java>
478+
<property name="deprecated.output.file" location="${signatures.dir}/jdk-deprecated-${build.java.runtime}.txt"/>
479+
<groovy classpathref="path.tools-run" src="${groovy-tools.dir}/generate-deprecated.groovy"/>
494480
</target>
495481

496482
<target name="-generate-test-classes-init">

ivy.xml

+1
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
<dependency org="commons-cli" name="commons-cli" rev="1.2" conf="build,bundle"/>
4040
<dependency org="com.googlecode.jarjar" name="jarjar" rev="1.3" conf="buildtools"/>
4141
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.1.3" conf="buildtools"/>
42+
<dependency org="org.codehaus.groovy" name="groovy-all" rev="2.2.2" conf="buildtools"/>
4243
<dependency org="org.apache.ant" name="ant-antunit" rev="1.3" conf="test"/>
4344
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="test"/>
4445
<exclude org="*" ext="*" matcher="regexp" type="source|javadoc"/>

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-1.5.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# This file contains API signatures extracted from the rt.jar file
2-
# shipped with the class library of Oracle's Java Runtime Environment.
3-
# It is provided here for reference, but can easily regenerated by executing:
4-
# $ java de.thetaphi.forbiddenapis.DeprecatedGen 1.5 /path/to/rt.jar /path/to/this/file.txt
1+
# This file contains API signatures extracted from the rt.jar file shipped with the class library of Oracle's Java Runtime Environment.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-deprecated
54

65
# This file contains all public, deprecated API signatures in Java version 1.5 (extracted from build 1.5.0_22).
76

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-1.6.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# This file contains API signatures extracted from the rt.jar file
2-
# shipped with the class library of Oracle's Java Runtime Environment.
3-
# It is provided here for reference, but can easily regenerated by executing:
4-
# $ java de.thetaphi.forbiddenapis.DeprecatedGen 1.6 /path/to/rt.jar /path/to/this/file.txt
1+
# This file contains API signatures extracted from the rt.jar file shipped with the class library of Oracle's Java Runtime Environment.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-deprecated
54

65
# This file contains all public, deprecated API signatures in Java version 1.6 (extracted from build 1.6.0_32).
76

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-1.7.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# This file contains API signatures extracted from the rt.jar file
2-
# shipped with the class library of Oracle's Java Runtime Environment.
3-
# It is provided here for reference, but can easily regenerated by executing:
4-
# $ java de.thetaphi.forbiddenapis.DeprecatedGen 1.7 /path/to/rt.jar /path/to/this/file.txt
1+
# This file contains API signatures extracted from the rt.jar file shipped with the class library of Oracle's Java Runtime Environment.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-deprecated
54

65
# This file contains all public, deprecated API signatures in Java version 1.7 (extracted from build 1.7.0_65).
76

src/main/resources/de/thetaphi/forbiddenapis/signatures/jdk-deprecated-1.8.txt

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
# This file contains API signatures extracted from the rt.jar file
2-
# shipped with the class library of Oracle's Java Runtime Environment.
3-
# It is provided here for reference, but can easily regenerated by executing:
4-
# $ java de.thetaphi.forbiddenapis.DeprecatedGen 1.8 /path/to/rt.jar /path/to/this/file.txt
1+
# This file contains API signatures extracted from the rt.jar file shipped with the class library of Oracle's Java Runtime Environment.
2+
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
3+
# $ ant generate-deprecated
54

65
# This file contains all public, deprecated API signatures in Java version 1.8 (extracted from build 1.8.0_25).
76

0 commit comments

Comments
 (0)