Skip to content

Commit

Permalink
Update to Java 22 & Kotlin 2.0.0-RC1
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Apr 29, 2024
1 parent 911b5cf commit bc9d378
Show file tree
Hide file tree
Showing 14 changed files with 48 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ permissions: write-all

jobs:
mikbot:
uses: mikbot/mikbot-workflow/.github/workflows/mikbot-workflow.yml@v1.4.2
uses: mikbot/mikbot-workflow/.github/workflows/mikbot-workflow.yml@v1.5.0
with:
run-maven-publish: true
update-binary-repository: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/gradle_plugin_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
needs: gradleValidation
steps:
- uses: actions/checkout@v3
- name: Set up JDK 21
- name: Set up JDK 22
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 21
java-version: 22
- name: Test with Gradle
run: ./gradlew gradle-plugin:classes
- name: Login to Gradle Plugin Portal
Expand Down
2 changes: 1 addition & 1 deletion .idea/compiler.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/kotlinc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM eclipse-temurin:21-jre-alpine
FROM eclipse-temurin:22-jre-alpine

WORKDIR /usr/app
COPY runtime/build/install/mikmusic ./
Expand Down
13 changes: 5 additions & 8 deletions buildSrc/src/main/kotlin/mikbot-module.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile

plugins {
kotlin("jvm")
}
Expand All @@ -8,16 +6,15 @@ val experimentalAnnotations =
listOf("kotlin.RequiresOptIn", "kotlin.time.ExperimentalTime", "kotlin.contracts.ExperimentalContracts")

tasks {
withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = experimentalAnnotations.map { "-opt-in=$it" }
}
}
withType<Test> {
useJUnitPlatform()
}
}

kotlin {
jvmToolchain(21)
jvmToolchain(22)

compilerOptions {
freeCompilerArgs.addAll(experimentalAnnotations.map { "-opt-in=$it" })
}
}
8 changes: 3 additions & 5 deletions core/ktor/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@ dependencies {
api(libs.ktor.server.websockets)
}

tasks {
withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=dev.schlaubi.mikbot.plugin.api.InternalAPI")
}
kotlin {
compilerOptions {
freeCompilerArgs.add("-opt-in=dev.schlaubi.mikbot.plugin.api.InternalAPI")
}
}
26 changes: 13 additions & 13 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[versions]
kotlin = "2.0.0-Beta2"
kordex = "1.7.1-SNAPSHOT"
kotlin = "2.0.0-RC1"
kordex = "1.8.0-SNAPSHOT"
kmongo = "4.11.0"
coroutines = "1.7.3"
serialization = "1.6.2"
ktor = "2.3.7"
coroutines = "1.8.0"
serialization = "1.6.3"
ktor = "2.3.10"
kord = "0.13.1"
api = "3.29.0"
ksp = "2.0.0-Beta2-1.0.16"
api = "3.30.0"
ksp = "2.0.0-RC1-1.0.20"
lavakord = "6.1.3"

[libraries]
Expand All @@ -24,8 +24,8 @@ kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-
kmongo-coroutine-serialization = { group = "org.litote.kmongo", name = "kmongo-coroutine-serialization", version.ref = "kmongo" }
kmongo-id-serialization = { group = "org.litote.kmongo", name = "kmongo-id-serialization", version.ref = "kmongo" }
stdx-full = { group = "dev.schlaubi", name = "stdx-full", version = "1.2.1" }
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version = "1.4.14" }
google-apis-youtube = { group = "com.google.apis", name = "google-api-services-youtube", version = "v3-rev20221108-2.0.0" }
logback-classic = { group = "ch.qos.logback", name = "logback-classic", version = "1.5.6" }
google-apis-youtube = { group = "com.google.apis", name = "google-api-services-youtube", version = "v3-rev20240417-2.0.0" }
lavakord-kord = { group = "dev.schlaubi.lavakord", name = "kord", version.ref = "lavakord" }
lavakord-sponsorblock = { group = "dev.schlaubi.lavakord", name = "sponsorblock", version.ref = "lavakord" }
lavakord-lavsrc = { group = "dev.schlaubi.lavakord", name = "lavasrc-jvm", version.ref = "lavakord" }
Expand All @@ -50,19 +50,19 @@ ktor-server-cors = { group = "io.ktor", name = "ktor-server-cors", version.ref =
ktor-server-websockets = { group = "io.ktor", name = "ktor-server-websockets", version.ref = "ktor" }
ktor-server-html-builder = { group = "io.ktor", name = "ktor-server-html-builder", version.ref = "ktor" }

pf4j = { group = "org.pf4j", name = "pf4j", version = "3.10.0" }
pf4j = { group = "org.pf4j", name = "pf4j", version = "3.11.0" }
pf4j-update = { group = "org.pf4j", name = "pf4j-update", version = "2.3.0" }

gson = { group = "com.google.code.gson", name = "gson", version = "2.10.1" }

koin = { group = "io.insert-koin", name = "koin-core", version = "3.5.3" }
koin = { group = "io.insert-koin", name = "koin-core", version = "3.5.6" }

asm = { group = "org.ow2.asm", name = "asm", version = "9.6" }
asm = { group = "org.ow2.asm", name = "asm", version = "9.7" }

[plugins]
kotlinx-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlinx-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
gradle-publish = { id = "com.gradle.plugin-publish", version = "1.2.1" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.3.3" }
buildconfig = { id = "com.github.gmazzo.buildconfig", version = "5.3.5" }
mikbot = { id = "dev.schlaubi.mikbot.gradle-plugin", version = "1.0.0" }
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=9d926787066a081739e8200858338b4a69e837c3a821a33aca9db09dd4a41026
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-rc-1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
12 changes: 6 additions & 6 deletions runtime/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -45,17 +45,17 @@ application {
applicationDefaultJvmArgs = listOf("--enable-preview")
}

kotlin {
compilerOptions {
freeCompilerArgs.add("-opt-in=dev.schlaubi.mikbot.plugin.api.InternalAPI")
}
}

tasks {
startScripts {
classpath = DummyFileCollection(listOf("lib/*", "lib/."))
}

withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
kotlinOptions {
freeCompilerArgs = freeCompilerArgs + listOf("-opt-in=dev.schlaubi.mikbot.plugin.api.InternalAPI")
}
}

// This is probably the worst way of doing this,
// but I tried to use JVM resources or compilation file manipulation for 3 hrs now with no luck
task("exportDependencies") {
Expand Down
6 changes: 3 additions & 3 deletions runtime/src/main/kotlin/dev/schlaubi/musicbot/core/Bot.kt
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,18 @@ class Bot(repos: List<UpdateRepository>) : KordExKoinComponent, PluginContext {
dsn = Config.SENTRY_TOKEN
for (extension in sentryExtensions) {
with(extension) {
setup()
it.setup()
}
}
setBeforeSend { event, hint ->
it.setBeforeSend { event, hint ->
event.apply {
user = null
for (extension in sentryExtensions) {
extension.beforeSend(this, hint)
}
}
}
setBeforeBreadcrumb { breadcrumb, hint ->
it.setBeforeBreadcrumb { breadcrumb, hint ->
breadcrumb.apply {
for (extension in sentryExtensions) {
extension.beforeBreadcrumb(breadcrumb, hint)
Expand Down

0 comments on commit bc9d378

Please sign in to comment.