From cfefff1f6190f1758ea8cf26b1cdf17326e0fa57 Mon Sep 17 00:00:00 2001 From: Anthony Cicchetti Date: Sat, 23 Jul 2022 12:20:18 -0400 Subject: [PATCH] Updates! And commas in /osrsitem prices --- .gitignore | 3 +- build.gradle.kts | 14 ++++----- buildSrc/build.gradle.kts | 10 ++++-- buildSrc/settings.gradle.kts | 5 ++- buildSrc/src/main/kotlin/Libs.kt | 8 ----- gradle/wrapper/gradle-wrapper.properties | 2 +- settings.gradle.kts | 5 ++- .../slackbot/utility/BlockResponse.kt | 5 +-- versions.properties | 31 +++++++++++-------- 9 files changed, 45 insertions(+), 38 deletions(-) diff --git a/.gitignore b/.gitignore index b740e72..645db82 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ # Project exclude paths /.gradle/ -/build/ \ No newline at end of file +/build/ +/.idea/ \ No newline at end of file diff --git a/build.gradle.kts b/build.gradle.kts index 1e15413..20d8dba 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -12,11 +12,9 @@ buildscript { } } -import org.jetbrains.kotlin.gradle.tasks.KotlinCompile - plugins { id("com.github.johnrengelman.shadow") version Libs.com_github_johnrengelman_shadow_gradle_plugin - kotlin("jvm") version Libs.org_jetbrains_kotlin_jvm_gradle_plugin + kotlin("jvm") application } @@ -37,7 +35,7 @@ dependencies { because("CVE-2021-44228, CVE-2021-45046, CVE-2021-45105: Log4j vulnerable to remote code execution and other critical security vulnerabilities") } } - implementation(kotlin("stdlib-jdk8")) + implementation(Kotlin.stdlib.jdk8) implementation(Libs.javalin) implementation(Libs.javalin_openapi) implementation(Libs.slf4j_simple) @@ -53,12 +51,12 @@ dependencies { } application { - mainClassName = "com.anthonycicchetti.slackbot.MainKt" + mainClass.set("com.anthonycicchetti.slackbot.MainKt") } -tasks.withType { - kotlinOptions { - jvmTarget = "17" +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(17)) } } diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts index 079ef76..7e540e1 100644 --- a/buildSrc/build.gradle.kts +++ b/buildSrc/build.gradle.kts @@ -16,8 +16,12 @@ plugins { `kotlin-dsl` } -tasks.withType { - kotlinOptions { - jvmTarget = "17" +repositories { + mavenCentral() +} + +kotlin { + jvmToolchain { + languageVersion.set(JavaLanguageVersion.of(17)) } } \ No newline at end of file diff --git a/buildSrc/settings.gradle.kts b/buildSrc/settings.gradle.kts index b2577a6..909fd09 100644 --- a/buildSrc/settings.gradle.kts +++ b/buildSrc/settings.gradle.kts @@ -1,6 +1,9 @@ pluginManagement { + repositories { + gradlePluginPortal() + } plugins { - id("de.fayard.refreshVersions") version "0.40.0" + id("de.fayard.refreshVersions") version "0.40.2" } } diff --git a/buildSrc/src/main/kotlin/Libs.kt b/buildSrc/src/main/kotlin/Libs.kt index 8a5f854..2ac6563 100644 --- a/buildSrc/src/main/kotlin/Libs.kt +++ b/buildSrc/src/main/kotlin/Libs.kt @@ -36,14 +36,6 @@ public object Libs { public const val swagger_core: String = "io.swagger.core.v3:swagger-core:_" - public const val org_jetbrains_kotlin_jvm_gradle_plugin: String = - "org.jetbrains.kotlin.jvm:org.jetbrains.kotlin.jvm.gradle.plugin:_" - - public const val kotlin_scripting_compiler_embeddable: String = - "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:_" - - public const val kotlin_stdlib_jdk8: String = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" - public const val junit_jupiter: String = "org.junit.jupiter:junit-jupiter:_" public const val slf4j_simple: String = "org.slf4j:slf4j-simple:_" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index d2880ba..8049c68 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-7.3.2-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/settings.gradle.kts b/settings.gradle.kts index 04d06c7..9529ec6 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,8 +1,11 @@ rootProject.name = "slackmemes" pluginManagement { + repositories { + gradlePluginPortal() + } plugins { - id("de.fayard.refreshVersions") version "0.40.0" + id("de.fayard.refreshVersions") version "0.40.2" } } diff --git a/src/main/kotlin/com/anthonycicchetti/slackbot/utility/BlockResponse.kt b/src/main/kotlin/com/anthonycicchetti/slackbot/utility/BlockResponse.kt index 8ea3a51..14a88ee 100644 --- a/src/main/kotlin/com/anthonycicchetti/slackbot/utility/BlockResponse.kt +++ b/src/main/kotlin/com/anthonycicchetti/slackbot/utility/BlockResponse.kt @@ -3,6 +3,7 @@ package com.anthonycicchetti.slackbot.utility import com.fasterxml.jackson.annotation.JsonInclude import com.fasterxml.jackson.databind.ObjectMapper import com.slack.api.model.kotlin_extension.block.withBlocks +import java.text.NumberFormat data class BlockResponse(val status: Int = 200, val itemName: String, val highVal: Int, val lowVal: Int) { val response: String @@ -13,8 +14,8 @@ data class BlockResponse(val status: Int = 200, val itemName: String, val highVa withBlocks { section { markdownText("Item Found: ${itemName}") } divider() - section { markdownText(":chart_with_upwards_trend:: $highVal") } - section { markdownText(":chart_with_downwards_trend:: $lowVal") } + section { markdownText(":chart_with_upwards_trend:: ${NumberFormat.getNumberInstance().format(highVal)}") } + section { markdownText(":chart_with_downwards_trend:: ${NumberFormat.getNumberInstance().format(lowVal)}") } divider() section { markdownText("")} } diff --git a/versions.properties b/versions.properties index 7528b69..93b067c 100644 --- a/versions.properties +++ b/versions.properties @@ -1,5 +1,5 @@ #### Dependencies and Plugin versions with their available updates. -#### Generated by `./gradlew refreshVersions` version 0.40.0 +#### Generated by `./gradlew refreshVersions` version 0.40.2 #### #### Don't manually edit or split the comments that start with four hashtags (####), #### they will be overwritten by refreshVersions. @@ -7,35 +7,38 @@ #### suppress inspection "SpellCheckingInspection" for whole file #### suppress inspection "UnusedProperty" for whole file -plugin.com.github.johnrengelman.shadow=7.1.1 +plugin.com.github.johnrengelman.shadow=7.1.2 -plugin.org.gradle.kotlin.kotlin-dsl=2.1.7 +plugin.de.fayard.buildSrcLibs=0.40.2 -plugin.de.fayard.buildSrcLibs=0.40.0 +plugin.org.gradle.kotlin.kotlin-dsl=2.4.1 -version.com.fasterxml.jackson.core..jackson-databind=2.13.0 +version.com.fasterxml.jackson.core..jackson-databind=2.13.3 -version.com.fasterxml.jackson.module..jackson-module-kotlin=2.13.0 +version.com.fasterxml.jackson.module..jackson-module-kotlin=2.13.3 version.com.github.kittinunf.fuel..fuel-jackson=2.3.1 version.com.github.kittinunf.fuel..fuel=2.3.1 -version.com.slack.api..slack-api-model-kotlin-extension=1.17.0 +version.com.slack.api..slack-api-model-kotlin-extension=1.24.0 -version.io.javalin..javalin=4.1.1 +version.io.javalin..javalin=4.6.4 -version.io.javalin..javalin-openapi=4.1.1 +version.io.javalin..javalin-openapi=4.6.4 -version.io.swagger.core.v3..swagger-core=2.1.11 +version.io.swagger.core.v3..swagger-core=2.2.2 +## unused version.junit=5.8.2 version.junit.jupiter=5.8.2 +## # available=5.9.0-M1 +## # available=5.9.0-RC1 -version.kotlin=1.6.10 +version.kotlin=1.7.10 -version.org.slf4j..slf4j-simple=1.7.32 +version.org.slf4j..slf4j-simple=1.7.36 ## # available=1.8.0-alpha0 ## # available=1.8.0-alpha1 ## # available=1.8.0-alpha2 @@ -49,5 +52,7 @@ version.org.slf4j..slf4j-simple=1.7.32 ## # available=2.0.0-alpha3 ## # available=2.0.0-alpha4 ## # available=2.0.0-alpha5 +## # available=2.0.0-alpha6 +## # available=2.0.0-alpha7 -version.org.webjars..swagger-ui=4.1.3 +version.org.webjars..swagger-ui=4.11.1