Skip to content

Update dependencies to support Kotlin 1.9 #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ ij_json_wrap_long_lines = false
[{*.kt,*.kts}]
# noinspection EditorConfigKeyCorrectness
ktlint_standard_package-name = disabled
ktlint_standard_property-naming = disabled
ij_kotlin_align_in_columns_case_branch = false
ij_kotlin_align_multiline_binary_operation = false
ij_kotlin_align_multiline_extends_list = false
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -284,6 +284,11 @@ as a part of the CI to make sure the validation meet the expected behavior.
Not everything is supported right now but the missing functionality might be added in the future.
The test are located [here](test-suites).

## Developer notes

The update to Kotlin 1.9.22 came with an issue for JS incremental compilation.
In case you see an error about main function that already bind please execute `clean` task.

## Future plans

- [x] Add `$schema` property validation (if not set the latest supported will be used)
Expand Down
1 change: 1 addition & 0 deletions api/json-schema-validator.api
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public final class io/github/optimumcode/json/schema/SchemaType : java/lang/Enum
public static final field DRAFT_2020_12 Lio/github/optimumcode/json/schema/SchemaType;
public static final field DRAFT_7 Lio/github/optimumcode/json/schema/SchemaType;
public static final fun find (Ljava/lang/String;)Lio/github/optimumcode/json/schema/SchemaType;
public static fun getEntries ()Lkotlin/enums/EnumEntries;
public static fun valueOf (Ljava/lang/String;)Lio/github/optimumcode/json/schema/SchemaType;
public static fun values ()[Lio/github/optimumcode/json/schema/SchemaType;
}
Expand Down
53 changes: 24 additions & 29 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
import io.gitlab.arturbosch.detekt.Detekt
import org.jetbrains.kotlin.gradle.plugin.KotlinTarget
import org.jetbrains.kotlin.gradle.plugin.KotlinTargetWithTests
import org.jetbrains.kotlin.gradle.targets.js.nodejs.NodeJsRootExtension
import org.jlleitschuh.gradle.ktlint.reporter.ReporterType

@Suppress("DSL_SCOPE_VIOLATION") // TODO: remove when migrate to Gradle 8
plugins {
alias(libs.plugins.kotlin.mutliplatform)
alias(libs.plugins.kotlin.serialization)
Expand All @@ -22,8 +20,6 @@ repositories {
mavenCentral()
}

val mainHost: String by project

kotlin {
explicitApi()
jvm {
Expand All @@ -44,41 +40,44 @@ kotlin {
generateTypeScriptDefinitions()
nodejs()
}
ios()

val macOsTargets = listOf<KotlinTarget>(
macosX64(),
macosArm64(),
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)

val linuxTargets = listOf<KotlinTarget>(
linuxX64(),
linuxArm64(),
)

val windowsTargets = listOf<KotlinTarget>(
mingwX64(),
)
applyDefaultHierarchyTemplate()

val macOsTargets =
listOf<KotlinTarget>(
macosX64(),
macosArm64(),
iosX64(),
iosArm64(),
iosSimulatorArm64(),
)

val linuxTargets =
listOf<KotlinTarget>(
linuxX64(),
linuxArm64(),
)

val windowsTargets =
listOf<KotlinTarget>(
mingwX64(),
)

sourceSets {
val commonMain by getting {
commonMain {
dependencies {
api(libs.kotlin.serialization.json)
implementation(libs.uri)
}
}
val commonTest by getting {
commonTest {
dependencies {
implementation(libs.kotest.assertions.core)
implementation(libs.kotest.framework.engine)
implementation(kotlin("test-common"))
implementation(kotlin("test-annotations-common"))
}
}
val jvmTest by getting {
jvmTest {
dependencies {
implementation(libs.kotest.runner.junit5)
}
Expand Down Expand Up @@ -113,10 +112,6 @@ kotlin {
}
}

extensions.configure<NodeJsRootExtension> {
versions.webpack.version = "5.76.0"
}

ktlint {
version.set(libs.versions.ktlint)
reporters {
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/convention.publication.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,18 @@ afterEvaluate {
tasks.withType<AbstractPublishToMaven> {
mustRunAfter(signTasks)
}

// Call toList to prevent concurrent modification exception
signTasks.toList().forEach {
val platform = it.name.substring(
"sign".length,
it.name.length - "Publication".length
)
tasks.findByName("linkDebugTest$platform")
?.mustRunAfter(it)
tasks.findByName("compileTestKotlin$platform")
?.mustRunAfter(it)
}
}

signing {
Expand Down
2 changes: 0 additions & 2 deletions config/detekt/detekt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,6 @@ style:
active: true
OptionalUnit:
active: false
OptionalWhenBraces:
active: false
PreferToOverPairSyntax:
active: false
ProtectedMemberInFinalClass:
Expand Down
20 changes: 10 additions & 10 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
[versions]
kotlin = "1.8.22"
kotest = "5.5.4"
detekt = "1.23.0"
ktlint = "0.50.0"
okio = "3.4.0"
serialization = "1.5.1"
kotlin = "1.9.22"
kotest = "5.8.0"
detekt = "1.23.4"
ktlint = "1.1.0"
okio = "3.7.0"
serialization = "1.6.2"

[plugins]
kotlin-mutliplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
kotlin-dokka = { id = "org.jetbrains.dokka", version = "1.8.20" }
kotlin-dokka = { id = "org.jetbrains.dokka", version = "1.9.10" }
kotest-multiplatform = { id = "io.kotest.multiplatform", version.ref = "kotest" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.1" }
kover = { id = "org.jetbrains.kotlinx.kover", version = "0.7.5" }
detekt = { id = "io.gitlab.arturbosch.detekt", version.ref = "detekt" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "11.5.0" }
ktlint = { id = "org.jlleitschuh.gradle.ktlint", version = "12.0.3" }
kotlin-binaryCompatibility = { id = "org.jetbrains.kotlinx.binary-compatibility-validator", version = "0.13.2" }
nexus-publish = { id = "io.github.gradle-nexus.publish-plugin", version = "1.3.0" }

Expand All @@ -23,6 +23,6 @@ kotlin-serialization-json-okio = { group = "org.jetbrains.kotlinx", name = "kotl
kotest-assertions-core = { module = "io.kotest:kotest-assertions-core", version.ref = "kotest" }
kotest-framework-engine = { module = "io.kotest:kotest-framework-engine", version.ref = "kotest" }
kotest-runner-junit5 = { module = "io.kotest:kotest-runner-junit5", version.ref = "kotest" }
uri = { group = "com.eygraber", name = "uri-kmp", version = "0.0.12" }
uri = { group = "com.eygraber", name = "uri-kmp", version = "0.0.15" }
okio-common = { group = "com.squareup.okio", name = "okio", version.ref = "okio" }
okio-nodefilesystem = { group = "com.squareup.okio", name = "okio-nodefilesystem", version.ref = "okio" }
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-7.6.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.1.1-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading