Skip to content

Commit

Permalink
Version bumps
Browse files Browse the repository at this point in the history
- Upgrade Kotlin to 1.9.20
- Upgrade Kord to 0.11.1
- Upgrade Mikbot to 3.25.0
- Upgrade compose to 1.5.10
- Upgrade lyricist to 1.6.0
- Upgrade java to 21
  • Loading branch information
DRSchlaubi committed Nov 1, 2023
1 parent a81a457 commit 5c24fad
Show file tree
Hide file tree
Showing 28 changed files with 164 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ on:
push:

env:
JAVA_VERSION: 20
JAVA_VERSION: 21

permissions:
contents: write
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/maven.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 20
java-version: 21
- name: Build plugin
uses: gradle/gradle-build-action@v2
env:
Expand Down
13 changes: 11 additions & 2 deletions .idea/gradle.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 .idea/misc.xml

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

4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM gradle:jdk20 as builder
FROM gradle:jdk21 as builder
WORKDIR /usr/app
COPY . .
RUN ./gradlew --no-daemon installBotArchive

FROM eclipse-temurin:20-jre-alpine
FROM eclipse-temurin:21-jre-alpine

WORKDIR /usr/app
COPY --from=builder /usr/app/bot/build/installBot .
Expand Down
11 changes: 11 additions & 0 deletions app/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dev.schlaubi.tonbrett.gradle.sdkInt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("android")
Expand Down Expand Up @@ -59,4 +60,14 @@ android {
androidResources {
generateLocaleConfig = true
}

compileOptions {
targetCompatibility = JavaVersion.VERSION_20
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_20
}
}
}
33 changes: 23 additions & 10 deletions app/android/shared/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import com.google.protobuf.gradle.id
import dev.schlaubi.tonbrett.gradle.sdkInt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
id("com.android.library")
Expand All @@ -20,6 +21,17 @@ dependencies {
android {
namespace = "dev.schlaubi.tonbrett.app.android.shared"
compileSdk = sdkInt

// For some reason java 9+ sources do some jlink nonsense which causes major problems for this project

compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

kotlinOptions {
jvmTarget = "1.8"
}
}

protobuf {
Expand All @@ -41,13 +53,14 @@ protobuf {
}
}

tasks {
afterEvaluate {
named("compileDebugJavaWithJavac") {
dependsOn("generateReleaseProto")
}
named("compileDebugKotlin") {
dependsOn("generateReleaseProto")
}
}
}

//tasks {
// afterEvaluate {
// named("compileDebugJavaWithJavac") {
// dependsOn("generateReleaseProto")
// }
// named("compileDebugKotlin") {
// dependsOn("generateReleaseProto")
// }
// }
//}
11 changes: 11 additions & 0 deletions app/android/wear/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dev.schlaubi.tonbrett.gradle.sdkInt
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

plugins {
kotlin("android")
Expand Down Expand Up @@ -47,4 +48,14 @@ android {
pickFirsts.add("META-INF/versions/9/previous-compilation-data.bin")
}
}

compileOptions {
targetCompatibility = JavaVersion.VERSION_20
}

kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_20
}
}
}
1 change: 0 additions & 1 deletion app/desktop/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import org.jetbrains.compose.desktop.application.dsl.TargetFormat
import org.jetbrains.compose.internal.utils.localPropertiesFile
import org.jetbrains.kotlin.org.jline.utils.OSUtils

plugins {
Expand Down
6 changes: 3 additions & 3 deletions app/desktop/src/windowsMain/kotlin/Platform.kt
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ actual fun start(args: Array<String>) {
}
}

actual fun launchUri(uri: URI): Unit = Arena.openConfined().use { arena ->
actual fun launchUri(uri: URI): Unit = Arena.ofConfined().use { arena ->
val url = arena.allocateUtf8String(uri.toString())
launch_uri(url)
}

actual fun setToken(token: String) = Arena.openConfined().use { arena ->
actual fun setToken(token: String) = Arena.ofConfined().use { arena ->
val tokenStr = arena.allocateUtf8String(token)
store_token(tokenStr)
}
Expand All @@ -50,7 +50,7 @@ actual fun getToken(): String = invokeStringResultFunction(::get_token)
private fun invokeStringResultFunction(
function: (SegmentAllocator) -> MemorySegment
) =
Arena.openConfined().use { arena ->
Arena.ofConfined().use { arena ->
val result = function(arena)
val isError = StringResult.`is_error$get`(result)
val length = StringResult.`length$get`(result).coerceAtLeast(0)
Expand Down
24 changes: 5 additions & 19 deletions app/shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import org.gradle.configurationcache.extensions.capitalized
import org.jetbrains.kotlin.gradle.ExperimentalKotlinGradlePluginApi

plugins {
kotlin("multiplatform")
id("com.android.library")
`multiplatform-module`
id("org.jetbrains.compose")
alias(libs.plugins.buildconfig)
alias(libs.plugins.ksp)
Expand All @@ -27,11 +26,6 @@ kotlin {
withJs()
}

group("jvm") {
withAndroidTarget()
withJvm()
}

group("mobile") {
group("apple") {
withApple()
Expand All @@ -46,14 +40,6 @@ kotlin {
}
}
}
androidTarget()
jvm("desktop")
js(IR) {
browser()
}
iosSimulatorArm64()
iosX64()
iosArm64()

sourceSets {
all {
Expand All @@ -77,13 +63,13 @@ kotlin {
}
}

named("jsMain") {
jsMain {
dependencies {
api("org.jetbrains.kotlin:kotlinx-atomicfu-runtime:1.9.0")
api("org.jetbrains.kotlin:kotlinx-atomicfu-runtime:1.9.10")
}
}

named("jvmMain") {
jvmMain {
dependencies {
implementation(libs.kmongo.id.serialization)
}
Expand All @@ -95,7 +81,7 @@ kotlin {
}
}

named("androidMain") {
androidMain {
dependencies {
implementation(libs.androidx.browser)
}
Expand Down
3 changes: 1 addition & 2 deletions app/shared/src/commonMain/kotlin/api/Api.kt
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,10 @@ expect abstract class AppContextBase : ApiStateHolder {
* Context used for piping platform contexts into a multiplatform app.
*/
expect open class AppContext : AppContextBase {

/**
* Initiates authorization flow for the current platform.
*/
fun reAuthorize()
fun reAuthorize()
}

/**
Expand Down
2 changes: 2 additions & 0 deletions bot/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import dev.schlaubi.mikbot.gradle.mikbot
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion
import kotlin.io.path.div

plugins {
Expand All @@ -21,6 +22,7 @@ dependencies {

kotlin {
compilerOptions {
languageVersion = KotlinVersion.KOTLIN_2_0
freeCompilerArgs.add("-Xcontext-receivers")
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package dev.schlaubi.tonbrett.bot.commands

import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.converters.impl.*
import com.kotlindiscord.kord.extensions.types.respond
import dev.arbjerg.lavalink.protocol.v4.LoadResult
import dev.schlaubi.lavakord.rest.loadItem
import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.schlaubi.tonbrett.bot.commands

import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand
import com.kotlindiscord.kord.extensions.types.respond
import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule
import dev.schlaubi.mikmusic.checks.joinSameChannelCheck

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.schlaubi.tonbrett.bot.commands

import com.kotlindiscord.kord.extensions.types.respond
import dev.kord.rest.builder.message.create.actionRow
import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule
import dev.schlaubi.mikbot.util_plugins.ktor.api.buildBotUrl
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package dev.schlaubi.tonbrett.bot.commands

import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.types.respond
import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule
import dev.schlaubi.tonbrett.bot.command.sound
import dev.schlaubi.tonbrett.bot.io.SoundBoardDatabase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalBoolean
import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalInt
import com.kotlindiscord.kord.extensions.commands.converters.impl.optionalString
import com.kotlindiscord.kord.extensions.types.respond
import dev.schlaubi.mikbot.plugin.api.module.SubCommandModule
import dev.schlaubi.mikbot.plugin.api.util.discordError
import dev.schlaubi.tonbrett.bot.command.emoji
Expand Down
8 changes: 3 additions & 5 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
import org.jetbrains.kotlin.gradle.dsl.KotlinTopLevelExtension

plugins {
alias(libs.plugins.kotlin.jvm) apply false
alias(libs.plugins.kotlin.serialization) apply false
alias(libs.plugins.android.library) apply false
alias(libs.plugins.kotlin.android) apply false
alias(libs.plugins.compose) apply false
}

allprojects {
group = "dev.schlaubi.tonbrett"
version = "1.15.7"
version = "1.16.0"

repositories {
mavenCentral()
google()
}
}

subprojects {
afterEvaluate {
extensions.findByType<KotlinTopLevelExtension>()?.apply {
jvmToolchain(20)
jvmToolchain(21)
}
}
}
7 changes: 5 additions & 2 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,24 @@ plugins {
repositories {
gradlePluginPortal()
mavenCentral()
google()
}

dependencies {
implementation(libs.google.artifactregistry)
implementation(libs.kotlinx.serialization)
implementation(libs.kotlin.gradle.plugin)
implementation(libs.android.gradle.plugin)
}

java {
sourceCompatibility = JavaVersion.VERSION_1_8
sourceCompatibility = JavaVersion.VERSION_20
}

tasks {
withType<KotlinCompile> {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
jvmTarget = JvmTarget.JVM_20
}
}
}
Loading

0 comments on commit 5c24fad

Please sign in to comment.