|
26 | 26 | </condition>
|
27 | 27 | </fail>
|
28 | 28 |
|
29 |
| - <fail message="Minimum supported Java version is 1.6."> |
| 29 | + <fail message="Minimum supported Java version is 1.7."> |
30 | 30 | <condition>
|
31 |
| - <not><hasmethod classname="java.lang.String" method="isEmpty"/></not> |
| 31 | + <not><available classname="java.lang.invoke.MethodHandle"/></not> |
32 | 32 | </condition>
|
33 | 33 | </fail>
|
34 | 34 |
|
|
54 | 54 | -->
|
55 | 55 | <condition property="build.java.runtime" value="${-cleaned.specification.version}" else="unknown">
|
56 | 56 | <or>
|
57 |
| - <equals arg1="${-cleaned.specification.version}" arg2="1.6"/> |
58 | 57 | <equals arg1="${-cleaned.specification.version}" arg2="1.7"/>
|
59 | 58 | <equals arg1="${-cleaned.specification.version}" arg2="1.8"/>
|
60 | 59 | <equals arg1="${-cleaned.specification.version}" arg2="9"/>
|
|
68 | 67 |
|
69 | 68 | <property name="build.java.info" value="${java.version} / JVM: ${java.vm.name} / Vendor: ${java.vendor} / OS: ${os.name} (${os.version})"/>
|
70 | 69 |
|
71 |
| - <condition property="is.java-6-7"> |
| 70 | + <condition property="is.java7"> |
72 | 71 | <or>
|
73 |
| - <equals arg1="${build.java.runtime}" arg2="1.6"/> |
74 | 72 | <equals arg1="${build.java.runtime}" arg2="1.7"/>
|
75 | 73 | </or>
|
76 | 74 | </condition>
|
|
79 | 77 | <condition property="build.compiler" value="javac1.7">
|
80 | 78 | <and>
|
81 | 79 | <not>
|
82 |
| - <isset property="is.java-6-7"/> |
| 80 | + <isset property="is.java7"/> |
83 | 81 | </not>
|
84 | 82 | <or>
|
85 | 83 | <antversion exactly="1.8.3" />
|
|
88 | 86 | </and>
|
89 | 87 | </condition>
|
90 | 88 |
|
91 |
| - <!-- With Java 6 and Java 7, the HTTPS access to Maven central is broken, workaround (no TLS 1.2 support): --> |
| 89 | + <!-- With Java 7, the HTTPS access to Maven central is broken, workaround (no TLS 1.2 support): --> |
92 | 90 | <condition property="ivy.maven-central.backup" value="http://insecure.repo1.maven.org/maven2" else="https://repo1.maven.org/maven2">
|
93 |
| - <isset property="is.java-6-7"/> |
| 91 | + <isset property="is.java7"/> |
94 | 92 | </condition>
|
95 | 93 |
|
96 | 94 | <condition property="javadoc.doclint.args" value="" else="-Xdoclint:none">
|
97 |
| - <isset property="is.java-6-7"/> |
| 95 | + <isset property="is.java7"/> |
98 | 96 | </condition>
|
99 | 97 |
|
100 | 98 | <property file="${user.home}/build.properties" />
|
101 | 99 | <property file="build.properties" />
|
102 | 100 |
|
103 |
| - <property name="jdk.version" value="1.6"/> |
| 101 | + <property name="jdk.version" value="1.7"/> |
104 | 102 | <property name="maven.version" value="2.2.1"/>
|
105 | 103 | <property name="maven-plugin-plugin.version" value="3.4"/>
|
106 | 104 |
|
|
126 | 124 | <!-- define Maven coordinates -->
|
127 | 125 | <property name="groupId" value="de.thetaphi" />
|
128 | 126 | <property name="artifactId" value="forbiddenapis" />
|
129 |
| - <property name="version" value="2.8-SNAPSHOT"/> |
| 127 | + <property name="version" value="3.0-SNAPSHOT"/> |
130 | 128 |
|
131 | 129 | <property name="description" value="Allows to parse Java byte code to find invocations of method/class/field signatures and fail build (Apache Ant, Apache Maven, Gradle, or CLI)"/>
|
132 | 130 |
|
|
148 | 146 |
|
149 | 147 | <condition property="tests.supported">
|
150 | 148 | <or>
|
151 |
| - <equals arg1="${build.java.runtime}" arg2="1.6"/> |
152 | 149 | <equals arg1="${build.java.runtime}" arg2="1.7"/>
|
153 | 150 | <equals arg1="${build.java.runtime}" arg2="1.8"/>
|
154 | 151 | <equals arg1="${build.java.runtime}" arg2="9"/>
|
155 | 152 | <equals arg1="${build.java.runtime}" arg2="10"/>
|
156 | 153 | <equals arg1="${build.java.runtime}" arg2="11"/>
|
157 | 154 | <equals arg1="${build.java.runtime}" arg2="12"/>
|
158 | 155 | <equals arg1="${build.java.runtime}" arg2="13"/>
|
| 156 | + <equals arg1="${build.java.runtime}" arg2="14"/> |
159 | 157 | </or>
|
160 | 158 | </condition>
|
161 | 159 |
|
|
195 | 193 | <echo level="info" taskname="check-java" message="Java runtime: ${build.java.info}"/>
|
196 | 194 | <local name="java.version-message"/>
|
197 | 195 | <condition property="java.version-message"
|
198 |
| - value="Java 6 and Java 7 do not support TLS 1.2, so we have to use the insecure Maven Central mirror. If you are building a release, please run the build at least once with Java 8+ to download all Artifacts using HTTPS. If you don't yet have the Gradle Artifacts downloaded, you have to do this anyways." |
| 196 | + value="Java 7 does not support TLS 1.2, so we have to use the insecure Maven Central mirror. If you are building a release, please run the build at least once with Java 8+ to download all Artifacts using HTTPS. If you don't yet have the Gradle Artifacts downloaded, you have to do this anyways." |
199 | 197 | else="You are using Java 8+, so wecan use the HTTPS Maven Repository for downloading artifacts."
|
200 | 198 | >
|
201 |
| - <isset property="is.java-6-7"/> |
| 199 | + <isset property="is.java7"/> |
202 | 200 | </condition>
|
203 | 201 | <echo level="warn" taskname="check-java" message="${java.version-message}"/>
|
204 | 202 | <ivy:configure file="ivy-settings.xml"/>
|
|
687 | 685 | <condition property="-gen.sunmisc">
|
688 | 686 | <available classname="sun.misc.BASE64Encoder"/>
|
689 | 687 | </condition>
|
690 |
| - <condition property="-gen.jdk7"> |
691 |
| - <available classname="java.lang.invoke.MethodHandle"/> |
692 |
| - </condition> |
693 | 688 | <condition property="-gen.jdk8">
|
694 | 689 | <hasmethod classname="java.util.Collections" method="emptySortedSet"/>
|
695 | 690 | </condition>
|
|
699 | 694 | <echo level="info" message="Generating test classes using sun.misc internal APIs (needs Oracle Java):"/>
|
700 | 695 | <delete dir="src/test/antunit" includes="Oracle*.class"/>
|
701 | 696 | <javac includeantruntime="false" srcdir="src/test/antunit" destdir="src/test/antunit" includes="Oracle*.java"
|
702 |
| - nowarn="true" source="1.6" target="1.6" debug="true" deprecation="false" encoding="${build.encoding}"> |
| 697 | + nowarn="true" source="1.7" target="1.7" debug="true" deprecation="false" encoding="${build.encoding}"> |
703 | 698 | <!-- This disables the symbol file used to detect internal APIs while compiling: -->
|
704 | 699 | <compilerarg value="-XDignore.symbol.file=true"/>
|
705 | 700 | </javac>
|
706 | 701 | </target>
|
707 | 702 |
|
708 |
| - <target name="-generate-test-classes-jdk6"> |
709 |
| - <echo level="info" message="Generating test classes for Java 6:"/> |
710 |
| - <delete dir="src/test/antunit" includes="Java6*.class"/> |
711 |
| - <javac includeantruntime="false" srcdir="src/test/antunit" destdir="src/test/antunit" includes="Java6*.java" |
712 |
| - nowarn="true" source="1.6" target="1.6" debug="true" deprecation="false" encoding="${build.encoding}"/> |
713 |
| - </target> |
714 |
| - |
715 |
| - <target name="-generate-test-classes-jdk7" if="-gen.jdk7"> |
| 703 | + <target name="-generate-test-classes-jdk7"> |
716 | 704 | <echo level="info" message="Generating test classes for Java 7:"/>
|
717 | 705 | <delete dir="src/test/antunit" includes="Java7*.class"/>
|
718 | 706 | <javac includeantruntime="false" srcdir="src/test/antunit" destdir="src/test/antunit" includes="Java7*.java"
|
|
726 | 714 | nowarn="true" source="1.8" target="1.8" debug="true" deprecation="false" encoding="${build.encoding}"/>
|
727 | 715 | </target>
|
728 | 716 |
|
729 |
| - <target name="generate-test-classes" depends="-generate-test-classes-init,-generate-test-classes-sunmisc,-generate-test-classes-jdk6,-generate-test-classes-jdk7,-generate-test-classes-jdk8" |
| 717 | + <target name="generate-test-classes" depends="-generate-test-classes-init,-generate-test-classes-sunmisc,-generate-test-classes-jdk7,-generate-test-classes-jdk8" |
730 | 718 | description="Regenerates .class files used by tests if the current JDK version supports it"/>
|
731 | 719 |
|
732 | 720 | <target name="show-help-mojo" depends="install-maven-artifacts" description="Shows help about mojo usage">
|
|
0 commit comments