Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatability mode for forbidden APIs for Java 12 #37199

Merged
merged 2 commits into from
Jan 9, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,14 @@ class PrecommitTasks {
project.tasks.withType(CheckForbiddenApis) {
dependsOn(buildResources)
targetCompatibility = project.runtimeJavaVersion >= JavaVersion.VERSION_1_9 ?
project.runtimeJavaVersion.getMajorVersion() :
project.runtimeJavaVersion
project.runtimeJavaVersion.getMajorVersion() : project.runtimeJavaVersion
if (project.runtimeJavaVersion > JavaVersion.VERSION_11) {
doLast {
println "Forbidden APIs does not support java version past 11. Will use the signatures from 11 for " +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why a bare print statement? Seems this should at least be a warning log. But what can a dev do about it? Maybe nothing should be printed and an issue created and linked here to remove once forbidden apis supports Java 12.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, i converted it to info so it leaves a trace in CI.
An issue isn't actionable either unless we implement the support in forbidden APIs ourselves.

project.runtimeJavaVersion
}
targetCompatibility = JavaVersion.VERSION_11.getMajorVersion()
}
bundledSignatures = [
"jdk-unsafe", "jdk-deprecated", "jdk-non-portable", "jdk-system-out"
]
Expand Down