Skip to content

Commit

Permalink
chore: deprecations handled
Browse files Browse the repository at this point in the history
  • Loading branch information
augi committed Dec 22, 2023
1 parent 64bef9f commit d87a20a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
4 changes: 3 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ test {
}
}

sourceCompatibility = JavaVersion.VERSION_1_8
java {
sourceCompatibility = JavaVersion.VERSION_1_8
}

project.ext.set('gradle.publish.key', System.getenv('GRADLE_PORTAL_KEY'))
project.ext.set('gradle.publish.secret', System.getenv('GRADLE_PORTAL_SECRET'))
Expand Down
7 changes: 3 additions & 4 deletions src/main/groovy/cz/augi/gradle/scalafmt/ScalafmtPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.plugins.JavaBasePlugin
import org.gradle.api.plugins.JavaPluginConvention
import org.gradle.api.plugins.JavaPluginExtension

class ScalafmtPlugin implements Plugin<Project> {
@Override
Expand All @@ -14,9 +14,8 @@ class ScalafmtPlugin implements Plugin<Project> {
Task checkScalafmtAll = project.tasks.create('checkScalafmtAll')
checkScalafmtAll.description = "Checks formatting of all source sets using scalafmt."
PluginExtension extension = project.extensions.create('scalafmt', PluginExtension)
project.plugins.withType(JavaBasePlugin) {
def jpc = project.convention.getPlugin(JavaPluginConvention)
jpc.sourceSets.all { sourceSet ->
project.plugins.withType(JavaBasePlugin).configureEach {
project.extensions.getByType(JavaPluginExtension).sourceSets.configureEach { sourceSet ->
def task = project.tasks.register(sourceSet.getTaskName("", "scalafmt"), ScalafmtTask, {
it.sourceSet = sourceSet
it.pluginExtension = extension
Expand Down

0 comments on commit d87a20a

Please sign in to comment.