Skip to content

Commit

Permalink
Bump versions
Browse files Browse the repository at this point in the history
Kotlin to 2.1.0 and some dependencies.

Remove opt-in annotations and custom serialization of kotlin uuid.
  • Loading branch information
Erikvv committed Jan 9, 2025
1 parent 1b02d98 commit 89ebcc5
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 44 deletions.
4 changes: 2 additions & 2 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
plugins {
// need to specify version here because this plugin in used in multiple subprojects
kotlin("jvm") version "2.0.20" apply false
kotlin("plugin.serialization") version "2.0.20" apply false
kotlin("jvm") version "2.1.0" apply false
kotlin("plugin.serialization") version "2.1.0" apply false

// some tooling seems to prefer this format
// id("org.jetbrains.kotlin.plugin.serialization") version "2.0.0" apply false
Expand Down
2 changes: 1 addition & 1 deletion excel-read-named-v5/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {

dependencies {
implementation("org.apache.poi:poi-ooxml:5.3.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${libs.versions.kotlinx.datetime.get()}")
implementation(project(":zummon"))

testImplementation(kotlin("test"))
Expand Down
2 changes: 1 addition & 1 deletion fudura-client/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ repositories {
dependencies {
testImplementation(kotlin("test"))

implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${libs.versions.kotlinx.datetime.get()}")

implementation(platform("org.http4k:http4k-bom:5.31.1.0"))
implementation("org.http4k:http4k-core")
Expand Down
5 changes: 3 additions & 2 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ include(
dependencyResolutionManagement {
versionCatalogs {
create("libs") {
version("exposed", "0.54.0")
version("kotlinx-serialization-json", "1.7.2")
version("exposed", "0.57.0")
version("kotlinx-serialization-json", "1.8.0")
version("kotlinx-datetime", "0.6.1")
}
}
}
8 changes: 8 additions & 0 deletions zorm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,14 @@ tasks {
}
}

kotlin {
sourceSets {
all {
languageSettings.optIn("kotlin.uuid.ExperimentalUuidApi")
}
}
}

publishing {
publications {
create<MavenPublication>("maven") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,10 @@ class ProjectRepository(
}
}

@OptIn(ExperimentalUuidApi::class)
fun save(project: Project): Project {
return saveProject(project)
}

@OptIn(ExperimentalUuidApi::class)
fun saveToUser(project: Project, userId: UUID) {
transaction(db) {
val savedProject = saveProject(project)
Expand Down Expand Up @@ -108,7 +106,6 @@ class ProjectRepository(
.single()[ProjectTable.buurtCodes]
}

@OptIn(ExperimentalUuidApi::class)
fun hydrateProject(row: ResultRow): Project {
return Project(
id = row[ProjectTable.id],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,6 @@ class SurveyRepository(
)
}

@OptIn(ExperimentalUuidApi::class)
protected fun hydrateUser(row: ResultRow): com.zenmo.zummon.User? {
val userId = row[CompanySurveyTable.createdById] ?: return null

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,6 @@ class SurveyRepositoryTest {
}

@Test
@OptIn(ExperimentalUuidApi::class)
fun testCreatorIsSetOnCreateButNotOnEdit() {
val db = connectToPostgres()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class UserRepositoryTest {
assertEquals(userId, users.first().id)
}

@OptIn(ExperimentalUuidApi::class)
@Test
fun `test getUsersAndProjects loads projects`() {
val userId = UUID.randomUUID()
Expand Down
14 changes: 11 additions & 3 deletions ztor/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

val ktor_version = "3.0.1"
val ktor_version = "3.0.3"

plugins {
kotlin("jvm")

id("io.ktor.plugin") version "2.3.12"
id("io.ktor.plugin") version "3.0.3"
kotlin("plugin.serialization")
}

Expand Down Expand Up @@ -77,7 +77,7 @@ dependencies {
implementation("com.nimbusds:nimbus-jose-jwt:9.39.2")
implementation("com.google.crypto.tink:tink:1.13.0")

implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.0")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${libs.versions.kotlinx.datetime.get()}")
implementation("com.benasher44:uuid:0.8.4")

testImplementation("io.ktor:ktor-server-test-host:$ktor_version")
Expand All @@ -90,3 +90,11 @@ tasks.withType<Test> {
this.showStandardStreams = true
}
}

kotlin {
sourceSets {
all {
languageSettings.optIn("kotlin.uuid.ExperimentalUuidApi")
}
}
}
2 changes: 1 addition & 1 deletion zummon/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ kotlin {
dependencies {
implementation("org.jetbrains.kotlinx:kotlinx-serialization-core:${libs.versions.kotlinx.serialization.json.get()}")
implementation("org.jetbrains.kotlinx:kotlinx-serialization-json:${libs.versions.kotlinx.serialization.json.get()}")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")
implementation("org.jetbrains.kotlinx:kotlinx-datetime:${libs.versions.kotlinx.datetime.get()}")
implementation("com.benasher44:uuid:0.8.4")
}
}
Expand Down
27 changes: 0 additions & 27 deletions zummon/src/commonMain/kotlin/KotlinUuidSerializer.kt

This file was deleted.

1 change: 0 additions & 1 deletion zummon/src/commonMain/kotlin/User.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import kotlin.uuid.Uuid
@Serializable
@JsExport
data class User(
@Serializable(with = KotlinUuidSerializer::class)
val id: Uuid = Uuid.random(),
val note: String,
val projects: List<Project> = emptyList()
Expand Down

0 comments on commit 89ebcc5

Please sign in to comment.