diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 15b61a2..3bd0cc1 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -1,6 +1,9 @@ plugins { `kotlin-dsl` } -repositories { - jcenter() + +tasks.withType { + kotlinOptions { + jvmTarget = "17" + } } \ No newline at end of file diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d913..d2880ba 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt b/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt index d55a1be..d6ee221 100644 --- a/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt +++ b/src/main/kotlin/com/anthonycicchetti/slackbot/Main.kt @@ -14,6 +14,7 @@ import io.swagger.v3.oas.models.OpenAPI import io.swagger.v3.oas.models.info.Info import io.swagger.v3.oas.models.servers.Server import org.slf4j.LoggerFactory +import java.util.* import kotlin.math.roundToInt fun main() { @@ -52,7 +53,7 @@ fun main() { it.summary = "POST for UPPERCASING" }.body().json("200")) { ctx -> logger.info("Uppercase: Received request from ${ctx.req.requestURL}") - ctx.json(TextResponse(200, ctx.body().toUpperCase())) + ctx.json(TextResponse(200, ctx.body().uppercase(Locale.getDefault()))) }) post("/api/v1/claptext", documented(document().operation { @@ -110,7 +111,7 @@ private fun sendResponse(ctx: Context, respObj: RespObj) { put("text", respObj.text.toSpongemock()); put("response_type", "in_channel") } Commands.Uppercase -> { - put("text", respObj.text.toUpperCase()); put("response_type", "in_channel") + put("text", respObj.text.uppercase(Locale.getDefault())); put("response_type", "in_channel") } Commands.Claptext -> { put("text", respObj.text.toClapText()); put("response_type", "in_channel") diff --git a/src/main/kotlin/com/anthonycicchetti/slackbot/Transformations.kt b/src/main/kotlin/com/anthonycicchetti/slackbot/Transformations.kt index feb3518..3f9a09c 100644 --- a/src/main/kotlin/com/anthonycicchetti/slackbot/Transformations.kt +++ b/src/main/kotlin/com/anthonycicchetti/slackbot/Transformations.kt @@ -6,9 +6,9 @@ fun String.toSpongemock(): String { .map { word -> word.mapIndexed { index, char -> if (!index.isOdd()) { - char.toUpperCase() + char.uppercaseChar() } else { - char.toLowerCase() + char.lowercaseChar() } }.joinToString("") }.joinToString(" ") diff --git a/versions.properties b/versions.properties index db7243b..1890d4a 100644 --- a/versions.properties +++ b/versions.properties @@ -9,8 +9,6 @@ plugin.com.github.johnrengelman.shadow=7.1.1 -plugin.org.gradle.kotlin.kotlin-dsl=2.1.7 - version.com.fasterxml.jackson.core..jackson-databind=2.13.0 version.com.fasterxml.jackson.module..jackson-module-kotlin=2.13.0