Skip to content

Commit

Permalink
Compatability mode for forbidden APIs for Java 12 (#37199)
Browse files Browse the repository at this point in the history
  • Loading branch information
alpar-t committed Jan 9, 2019
1 parent 80ffd0c commit 7370fd7
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,16 @@ 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 {
project.logger.info(
"Forbidden APIs does not support java version past 11. Will use the signatures from 11 for ",
project.runtimeJavaVersion
)
}
targetCompatibility = JavaVersion.VERSION_11.getMajorVersion()
}
bundledSignatures = [
"jdk-unsafe", "jdk-deprecated", "jdk-non-portable", "jdk-system-out"
]
Expand Down

0 comments on commit 7370fd7

Please sign in to comment.