Skip to content

Commit

Permalink
chore: Gradle 9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Dec 22, 2023
1 parent 05e7894 commit 685f9d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
12 changes: 5 additions & 7 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ test {
}
}

sourceCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
withJavadocJar()
withSourcesJar()
}

project.ext.set('gradle.publish.key', System.getenv('GRADLE_PORTAL_KEY'))
project.ext.set('gradle.publish.secret', System.getenv('GRADLE_PORTAL_SECRET'))
Expand All @@ -51,12 +55,6 @@ gradlePlugin {
}
}


java {
withJavadocJar()
withSourcesJar()
}

afterEvaluate {
publishing.publications.forEach {
it.pom {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package cz.augi.gradle.wartremover

import groovy.transform.CompileStatic
import org.gradle.util.ConfigureUtil

@CompileStatic
class WartremoverExtension extends WartremoverSettings {
Expand All @@ -10,7 +9,14 @@ class WartremoverExtension extends WartremoverSettings {
if (testValue == this) {
testValue = this.deepClone()
}
ConfigureUtil.configure(closure, testValue)
def closureToCall = (Closure)closure.clone()
closureToCall.setResolveStrategy(Closure.DELEGATE_FIRST)
closureToCall.setDelegate(testValue)
if (closureToCall.getMaximumNumberOfParameters() == 0) {
closureToCall.call()
} else {
closureToCall.call(testValue)
}
}
WartremoverSettings getTest() { testValue }
}

0 comments on commit 685f9d1

Please sign in to comment.