diff --git a/build.gradle.kts b/build.gradle.kts index f55c55f0..402c7317 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -113,7 +113,13 @@ detekt { autoCorrect = true } -blossom { - replaceToken("@build_id@", grgit.head().abbreviatedId) - replaceToken("@version@", project.version.toString()) +sourceSets { + main { + blossom { + kotlinSources { + property("build_id", grgit.head().abbreviatedId) + property("version", project.version.toString()) + } + } + } } diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 68e9ef53..0284f908 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -5,15 +5,15 @@ shadow = "8.1.1" detekt = "1.23.1" git-hooks = "0.0.2" grgit = "5.2.0" -blossom = "1.3.1" +blossom = "2.0.1" # Libraries #kord-extensions = "1.5.9-20230820.204324-8" kord-extensions = "1.5.9-SNAPSHOT" logging = "5.1.0" -logback = "1.4.9" -github-api = "1.315" -mongo-driver = "4.10.1" +logback = "1.4.11" +github-api = "1.316" +mongo-driver = "4.10.2" cozy-welcome = "1.0.1-SNAPSHOT" dma = "v0.2.1" docgenerator = "0.1.2-SNAPSHOT" diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index 033e24c4..7f93135c 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 9f4197d5..ac72c34e 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip networkTimeout=10000 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME diff --git a/gradlew b/gradlew index fcb6fca1..0adc8e1a 100755 --- a/gradlew +++ b/gradlew @@ -83,7 +83,8 @@ done # This is normally unused # shellcheck disable=SC2034 APP_BASE_NAME=${0##*/} -APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit +# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036) +APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit # Use the maximum available, or set MAX_FD != -1 to use that value. MAX_FD=maximum diff --git a/src/main/kotlin-templates/org/hyacinthbots/lilybot/internal/BuildInfo.kt b/src/main/kotlin-templates/org/hyacinthbots/lilybot/internal/BuildInfo.kt new file mode 100644 index 00000000..838c9b20 --- /dev/null +++ b/src/main/kotlin-templates/org/hyacinthbots/lilybot/internal/BuildInfo.kt @@ -0,0 +1,12 @@ +package org.hyacinthbots.lilybot.internal + +/** + * This object stores the constants for the Build ID and version of Lily in her current state + */ +object BuildInfo { + /** The short commit hash of this build of Lily. */ + const val BUILD_ID: String = "{{ build_id }}" + + /** The current version of LilyBot. */ + const val LILY_VERSION: String = "{{ version }}" +} diff --git a/src/main/kotlin/org/hyacinthbots/lilybot/extensions/util/InfoCommands.kt b/src/main/kotlin/org/hyacinthbots/lilybot/extensions/util/InfoCommands.kt index 6f47de43..b01d2f2c 100644 --- a/src/main/kotlin/org/hyacinthbots/lilybot/extensions/util/InfoCommands.kt +++ b/src/main/kotlin/org/hyacinthbots/lilybot/extensions/util/InfoCommands.kt @@ -13,9 +13,8 @@ import dev.kord.rest.builder.message.create.embed import kotlinx.datetime.TimeZone import kotlinx.datetime.toLocalDateTime import org.hyacinthbots.lilybot.database.collections.UptimeCollection -import org.hyacinthbots.lilybot.utils.BUILD_ID +import org.hyacinthbots.lilybot.internal.BuildInfo import org.hyacinthbots.lilybot.utils.HYACINTH_GITHUB -import org.hyacinthbots.lilybot.utils.LILY_VERSION /** * This class contains the info commands that allow users to get a better idea of how to use the bot. @@ -127,8 +126,9 @@ class InfoCommands : Extension() { } field { name = "Version" + // To avoid IntelliJ shouting about build errors, use https://plugins.jetbrains.com/plugin/9407-pebble value = - "$LILY_VERSION ($BUILD_ID)" + "${BuildInfo.LILY_VERSION} (${BuildInfo.BUILD_ID})" inline = true } field { diff --git a/src/main/kotlin/org/hyacinthbots/lilybot/utils/_Constants.kt b/src/main/kotlin/org/hyacinthbots/lilybot/utils/_Constants.kt index 4bebc87d..0bcc99a4 100644 --- a/src/main/kotlin/org/hyacinthbots/lilybot/utils/_Constants.kt +++ b/src/main/kotlin/org/hyacinthbots/lilybot/utils/_Constants.kt @@ -24,8 +24,4 @@ val ENVIRONMENT = env("ENVIRONMENT") val ENV = envOrNull("STATUS_URL") -const val BUILD_ID: String = "@build_id@" - -const val LILY_VERSION: String = "@version@" - const val HYACINTH_GITHUB: String = "https://github.com/HyacinthBots"