Skip to content

Commit

Permalink
⬆️ Upgrade to Spring Boot 3, Gradle 8.2.1 and Kotlin 1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
devkanro committed Aug 4, 2023
1 parent 384909e commit bf1463d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 43 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
}

group = "com.bybutter.sisyphus.tools"
version = "1.7.3"
version = "2.0.0"
description = "Plugin for easy configuring Gradle and plugins in Sisyphus Framework"

repositories {
Expand Down Expand Up @@ -49,5 +49,5 @@ tasks.test {
}

kotlin {
jvmToolchain(8)
jvmToolchain(17)
}
17 changes: 8 additions & 9 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
[versions]
kotlin = "1.8.10"
spring-boot = "2.7.9"
nebula-contacts = "7.0.0"
nebula-info = "12.0.1"
nebula-publishing = "20.1.0"
gradle-docker = "9.2.1"
plugin-publishing = "1.1.0"
kubernetes = "15.0.1"
ktlint = "11.3.1"
kotlin = "1.9.0"
spring-boot = "3.1.2"
nebula-contacts = "7.0.1"
nebula-info = "12.1.6"
nebula-publishing = "20.3.0"
gradle-docker = "9.3.2"
plugin-publishing = "1.2.0"
ktlint = "11.5.0"

[libraries]
nebula-info = { module = "com.netflix.nebula:gradle-info-plugin", version.ref = "nebula-info" }
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.0.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class JavaDependenciesReplacePlugin : Plugin<Project> {

target.configurations.all {
it.resolutionStrategy.eachDependency { detail ->
extension.managedDependencies.getting("${detail.requested.group}:${detail.requested.name}")?.orNull?.let { moduleStringNotation ->
extension.managedDependencies.getting("${detail.requested.group}:${detail.requested.name}").orNull?.let { moduleStringNotation ->
detail.useVersion(moduleStringNotation.version)
detail.because("The version of current dependency managed by Sisyphus Property")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.bybutter.sisyphus.project.gradle.publishing

import com.bybutter.sisyphus.project.gradle.SisyphusExtension
import com.bybutter.sisyphus.project.gradle.ensurePlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
Expand All @@ -16,7 +15,6 @@ class ProjectSigningPlugin : Plugin<Project> {
if (!it) return
}

val sisyphus = target.extensions.getByType(SisyphusExtension::class.java)
val publishing = target.extensions.getByType(PublishingExtension::class.java)

if (target.hasProperty("signing.gnupg.keyName")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ import com.bybutter.sisyphus.project.gradle.ensurePlugin
import org.gradle.api.Plugin
import org.gradle.api.Project
import org.gradle.api.plugins.antlr.AntlrTask
import org.gradle.api.tasks.bundling.Jar
import org.jetbrains.kotlin.gradle.dsl.KotlinCompile
import org.jlleitschuh.gradle.ktlint.tasks.KtLintCheckTask
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.util.internal.GUtil

class SisyphusAntlrKotlinPlugin : Plugin<Project> {
override fun apply(target: Project) {
Expand All @@ -15,33 +14,20 @@ class SisyphusAntlrKotlinPlugin : Plugin<Project> {
}.let {
if (it) applyBasic(target)
}
target.ensurePlugin("org.gradle.antlr", "kotlin") {
applyWithKotlin(it)
}.let {
if (it) applyWithKotlin(target)
}
target.ensurePlugin("org.gradle.antlr", "org.jlleitschuh.gradle.ktlint") {
applyWithKtlint(it)
}.let {
if (it) applyWithKtlint(target)
}
}

private fun applyBasic(target: Project) {
target.tasks.withType(Jar::class.java).configureEach {
it.mustRunAfter(target.tasks.withType(AntlrTask::class.java))
}
}

private fun applyWithKotlin(target: Project) {
target.tasks.withType(KotlinCompile::class.java).configureEach {
it.mustRunAfter(target.tasks.withType(AntlrTask::class.java))
}
}
val sourceSets = target.extensions.getByType(SourceSetContainer::class.java)

private fun applyWithKtlint(target: Project) {
target.tasks.withType(KtLintCheckTask::class.java).configureEach {
it.mustRunAfter(target.tasks.withType(AntlrTask::class.java))
sourceSets.forEach {
val generateTaskName = when (it.name) {
"main" -> "generateGrammarSource"
else -> "generate${GUtil.toCamelCase(it.name)}GrammarSource"
}
target.tasks.named(generateTaskName, AntlrTask::class.java).configure { task ->
it.java.setSrcDirs(it.java.srcDirs.filter { task.outputDirectory.absolutePath != it.absolutePath })
it.java.srcDir(task)
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class SisyphusDockerPlugin : Plugin<Project> {
it.instructions.add(instruction)
}

bootJar.layered.layerOrder.forEach { layer ->
bootJar.layered.layerOrder.get().forEach { layer ->
it.copyFile("$layer/", "./")
it.runCommand("true")
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,4 +83,4 @@ fun <T : Dependency> Project.layer(dependency: Provider<T>, layer: SisyphusDevel
return dependency.map {
layer(it, layer)
}
}
}

0 comments on commit bf1463d

Please sign in to comment.