Skip to content

Commit

Permalink
Merge pull request #50 from policeman-tools/features/deprecated-gen-j…
Browse files Browse the repository at this point in the history
…ava9

PR #50: Rewrite tool to generate deprecated signatures for Java 9
  • Loading branch information
uschindler committed Mar 30, 2015
2 parents 708957d + dc573dc commit edf70bf
Show file tree
Hide file tree
Showing 12 changed files with 669 additions and 100 deletions.
28 changes: 7 additions & 21 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
<equals arg1="${-cleaned.specification.version}" arg2="1.6"/>
<equals arg1="${-cleaned.specification.version}" arg2="1.7"/>
<equals arg1="${-cleaned.specification.version}" arg2="1.8"/>
<equals arg1="${-cleaned.specification.version}" arg2="1.9"/>
</or>
</condition>

Expand All @@ -66,6 +67,7 @@
<condition property="build.compiler" value="javac1.7">
<and>
<or>
<equals arg1="${build.java.runtime}" arg2="1.9"/>
<equals arg1="${build.java.runtime}" arg2="1.8"/>
<equals arg1="${build.java.runtime}" arg2="unknown"/>
</or>
Expand All @@ -90,6 +92,7 @@
<property name="ivy.logging" value="download-only"/>

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

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

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

<target name="generate-deprecated" depends="compile-tools" description="Generates deprecated API signature lists for current JDK">
<fail message="Regenerating the deprecated signatures files need stock Oracle/Sun JDK, but your Java version or operating system is unsupported: ${build.java.info}">
<condition>
<not>
<and>
<available file="${java.home}/lib/rt.jar"/>
<matches string="${java.version}" pattern="^\Q${build.java.runtime}\E" casesensitive="true"/>
<or>
<contains string="${java.vendor}" substring="Oracle" casesensitive="false"/>
<contains string="${java.vendor}" substring="Sun Microsystems" casesensitive="false"/>
</or>
</and>
</not>
</condition>
</fail>
<target name="generate-deprecated" depends="compile-tools,-install-tasks" description="Generates deprecated API signature lists for current JDK">
<mkdir dir="${signatures.dir}"/>
<echo level="info" message="Building deprecated signatures for JDK ${build.java.runtime}:"/>
<java fork="false" classpathref="path.tools-run" classname="de.thetaphi.forbiddenapis.DeprecatedGen">
<arg value="${build.java.runtime}"/>
<arg file="${java.home}/lib/rt.jar"/>
<arg file="${signatures.dir}/jdk-deprecated-${build.java.runtime}.txt"/>
</java>
<property name="deprecated.output.file" location="${signatures.dir}/jdk-deprecated-${build.java.runtime}.txt"/>
<groovy classpathref="path.tools-run" src="${groovy-tools.dir}/generate-deprecated.groovy"/>
</target>

<target name="-generate-test-classes-init">
Expand Down
1 change: 1 addition & 0 deletions ivy.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
<dependency org="commons-cli" name="commons-cli" rev="1.2" conf="build,bundle"/>
<dependency org="com.googlecode.jarjar" name="jarjar" rev="1.3" conf="buildtools"/>
<dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.1.3" conf="buildtools"/>
<dependency org="org.codehaus.groovy" name="groovy-all" rev="2.2.2" conf="buildtools"/>
<dependency org="org.apache.ant" name="ant-antunit" rev="1.3" conf="test"/>
<dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="test"/>
<exclude org="*" ext="*" matcher="regexp" type="source|javadoc"/>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# This file contains API signatures extracted from the rt.jar file
# shipped with the class library of Oracle's Java Runtime Environment.
# It is provided here for reference, but can easily regenerated by executing:
# $ java de.thetaphi.forbiddenapis.DeprecatedGen 1.5 /path/to/rt.jar /path/to/this/file.txt
# This file contains API signatures extracted from the rt.jar file shipped with the class library of Oracle's Java Runtime Environment.
# It is provided here for reference, but can easily regenerated by executing from the source folder of forbidden-apis:
# $ ant generate-deprecated

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

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

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

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

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

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

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

Expand Down
Loading

0 comments on commit edf70bf

Please sign in to comment.