Skip to content

Commit

Permalink
Update Kotlin to 1.9.24, Gradle to 8.8 and toolchain settings
Browse files Browse the repository at this point in the history
  • Loading branch information
azabost committed Jun 16, 2024
1 parent f671ec6 commit add3ba3
Show file tree
Hide file tree
Showing 9 changed files with 38 additions and 9 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ repositories {
Add the following dependency in order to access `CodifiedEnum` class.

```kotlin
implementation("dev.bright.codified:enums:1.8.22.2")
implementation("dev.bright.codified:enums:1.9.24.1")
```

`CodifiedEnum` is a sealed class which represents either "known" or "unknown" enum type depending on the `code`
Expand Down Expand Up @@ -60,7 +60,7 @@ Add the following dependency in order to access `CodifiedEnum` serializer using
[Kotlin serialization](https://github.com/Kotlin/kotlinx.serialization).

```kotlin
implementation("dev.bright.codified:enums-serializer:1.8.22.2")
implementation("dev.bright.codified:enums-serializer:1.9.24.1")
```

Add `CodifiedSerializer` object for your enum class to handle both known and unknown enum types.
Expand Down Expand Up @@ -110,7 +110,7 @@ data class FoodBasket(
Add this dependency:

```kotlin
implementation("dev.bright.codified:enums-gson:1.8.22.2")
implementation("dev.bright.codified:enums-gson:1.9.24.1")
```

and register the `TypeAdapterFactory` for `CodifiedEnum`:
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
kotlin("jvm") version Versions.kotlin
kotlin("jvm")
id("default-config")
id("default-java-publish")
}
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ plugins {
`kotlin-dsl`
`kotlin-dsl-precompiled-script-plugins`
}

dependencies {
implementation("org.jetbrains.kotlin:kotlin-gradle-plugin:1.9.24")
}
14 changes: 12 additions & 2 deletions buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
import org.gradle.api.JavaVersion
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

object Config {
val group = "dev.bright.codified"
val version = "1.8.22.2"
val jvmToolchain = 8
val version = "1.9.24.1"

/**
* Since Gradle 8.8 a toolchain can also be set for the Gradle daemon (with some limitations)
* See [the docs](https://docs.gradle.org/8.8/userguide/gradle_daemon.html#sec:daemon_jvm_criteria) for more info
*/
val jvmToolchain = 21
val javaTargetCompatibility = JavaVersion.VERSION_1_8
val kotlinJvmTarget = JvmTarget.fromTarget(javaTargetCompatibility.toString())
}
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
object Versions {
const val kotlin = "1.8.22"
const val kotlin = "1.9.24" // Keep in sync with buildSrc/build.gradle.kts
const val junit = "5.6.2"
const val shouldko = "0.2.2"
const val serialization = "1.5.1"
const val serialization = "1.6.3"
const val jackson = "2.15.2"
const val gson = "2.10.1"
}
9 changes: 9 additions & 0 deletions buildSrc/src/main/kotlin/default-config.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
plugins {
`java-library`
kotlin("jvm")
}

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(Config.jvmToolchain))
}
sourceCompatibility = Config.javaTargetCompatibility
targetCompatibility = Config.javaTargetCompatibility
}

kotlin {
compilerOptions {
jvmTarget = Config.kotlinJvmTarget
}
}

tasks.withType<Test> {
Expand Down
2 changes: 2 additions & 0 deletions gradle/gradle-daemon-jvm.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#This file is generated by updateDaemonJvm
toolchainVersion=21
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
4 changes: 4 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = "codified"
include("enums")
include("enums-serializer")
Expand Down

0 comments on commit add3ba3

Please sign in to comment.