Skip to content

Commit

Permalink
Address gradle deprecations #245
Browse files Browse the repository at this point in the history
  • Loading branch information
dweiss committed Mar 23, 2024
1 parent 6a42045 commit d0c672a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -660,6 +660,7 @@
<arg value="--rerun-tasks"/>
<arg value="--info"/>
<arg value="--stacktrace"/>
<arg line="--warning-mode all" />
<arg value="--no-daemon"/>
<arg value="--gradle-user-home"/>
<arg file="${gradle-test-user-dir}"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ public class ForbiddenApisPlugin extends ForbiddenApisPluginBase {
}

// Gradle is buggy with it's JavaVersion enum: We use majorVersion property before Java 11 (6,7,8,9,10) and for later we use toString() to be future-proof:
Closure targetCompatibilityGetter = { (project.targetCompatibility?.hasProperty('java11Compatible') && project.targetCompatibility?.java11Compatible) ?
project.targetCompatibility.toString() : project.targetCompatibility?.majorVersion };
Closure targetCompatibilityGetter = { (project.java.targetCompatibility?.hasProperty('java11Compatible') && project.java.targetCompatibility?.java11Compatible) ?
project.java.targetCompatibility.toString() : project.java.targetCompatibility?.majorVersion };

// Define our tasks (one for each SourceSet):
project.sourceSets.all{ sourceSet ->
Expand Down
4 changes: 3 additions & 1 deletion src/test/gradle/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ buildscript {
apply plugin: 'java'
apply plugin: 'de.thetaphi.forbiddenapis'

sourceCompatibility = forbiddenSourceCompatibility
java {
sourceCompatibility = forbiddenSourceCompatibility
}

sourceSets {
main {
Expand Down

0 comments on commit d0c672a

Please sign in to comment.