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

Address gradle deprecations #245 #246

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
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
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
Loading