From 4a8f23edf2e4513034c3514fbeac0d02718b24c1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 15:58:48 +0000 Subject: [PATCH 01/96] Bump version -> `2.0.0-SNAPSHOT.263` --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index 8b98cb6df..163e62e26 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -31,5 +31,5 @@ * * For versions of Spine-based dependencies please see [io.spine.internal.dependency.spine]. */ -val mcJavaVersion by extra("2.0.0-SNAPSHOT.262") +val mcJavaVersion by extra("2.0.0-SNAPSHOT.263") val versionToPublish by extra(mcJavaVersion) From 1abe2f37c2f911702f52136b2bf07994c52b42c0 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 17:45:49 +0000 Subject: [PATCH 02/96] Update config and local dependencies --- .idea/inspectionProfiles/Project_Default.xml | 2 +- .../kotlin/io/spine/dependency/local/Base.kt | 2 +- .../io/spine/dependency/local/CoreJava.kt | 2 +- .../io/spine/dependency/local/McJava.kt | 4 ++-- .../io/spine/dependency/local/ProtoData.kt | 4 ++-- .../kotlin/io/spine/dependency/local/Time.kt | 7 +++--- .../io/spine/dependency/local/Validation.kt | 4 ++-- .../gradle/publish/CheckVersionIncrement.kt | 24 +++++++++++++++---- .../spine/gradle/publish/SpinePublishing.kt | 14 +++++++---- config | 2 +- 10 files changed, 43 insertions(+), 22 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 0bd1d9dc2..b09173471 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -900,4 +900,4 @@ - \ No newline at end of file + diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt index b758fb9ee..51ec08033 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt @@ -33,7 +33,7 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object Base { - const val version = "2.0.0-SNAPSHOT.234" + const val version = "2.0.0-SNAPSHOT.236" const val versionForBuildScript = "2.0.0-SNAPSHOT.232" const val group = Spine.group const val artifact = "spine-base" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt index 737fe2036..b7b23e2e4 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object CoreJava { const val group = Spine.group - const val version = "2.0.0-SNAPSHOT.191" + const val version = "2.0.0-SNAPSHOT.192" const val coreArtifact = "spine-core" const val clientArtifact = "spine-client" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt index 35414f6c5..ea96ec724 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt @@ -42,12 +42,12 @@ object McJava { /** * The version used to in the build classpath. */ - const val dogfoodingVersion = "2.0.0-SNAPSHOT.261" + const val dogfoodingVersion = "2.0.0-SNAPSHOT.262" /** * The version to be used for integration tests. */ - const val version = "2.0.0-SNAPSHOT.261" + const val version = "2.0.0-SNAPSHOT.262" /** * The ID of the Gradle plugin. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index 5d4d3d02a..0a71267e3 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.90.1" + private const val fallbackVersion = "0.91.1" /** * The distinct version of ProtoData used by other build tools. @@ -82,7 +82,7 @@ object ProtoData { * transitional dependencies, this is the version used to build the project itself. */ val dogfoodingVersion: String - private const val fallbackDfVersion = "0.90.0" + private const val fallbackDfVersion = "0.91.1" /** * The artifact for the ProtoData Gradle plugin. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt index 489e58e85..56518ecd9 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,11 +33,10 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object Time { - const val version = "2.0.0-SNAPSHOT.135" + const val version = "2.0.0-SNAPSHOT.136" const val group = Spine.group const val artifact = "spine-time" const val lib = "$group:$artifact:$version" - //TODO:2024-11-29:alexander.yevsyukov: Change the artifact name to `spine-time-testlib`. - const val testLib = "${Spine.toolsGroup}:spine-testutil-time:$version" + const val testLib = "${Spine.toolsGroup}:spine-time-testlib:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt index a51454610..4eced5732 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -36,7 +36,7 @@ object Validation { /** * The version of the Validation library artifacts. */ - const val version = "2.0.0-SNAPSHOT.182" + const val version = "2.0.0-SNAPSHOT.187" const val group = "io.spine.validation" private const val prefix = "spine-validation" diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt index 13dc7722f..9e3806818 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,8 +70,9 @@ open class CheckVersionIncrement : DefaultTask() { val versions = metadata?.versioning?.versions val versionExists = versions?.contains(version) ?: false if (versionExists) { - throw GradleException(""" - Version `$version` is already published to maven repository `$repoUrl`. + throw GradleException( + """ + The version `$version` is already published to the Maven repository `$repoUrl`. Try incrementing the library version. All available versions are: ${versions?.joinToString(separator = ", ")}. @@ -88,13 +89,28 @@ open class CheckVersionIncrement : DefaultTask() { private fun Project.artifactPath(): String { val group = this.group as String - val name = "spine-${this.name}" + val name = "${artifactPrefix()}${this.name}" val pathElements = ArrayList(group.split('.')) pathElements.add(name) val path = pathElements.joinToString(separator = "/") return path } + + /** + * Returns the artifact prefix used for the publishing of this project. + * + * All current Spine modules should be using `SpinePublishing`. + * Therefore, the corresponding extension should be present in the root project. + * However, just in case, we define the "standard" prefix here as well. + * + * This value MUST be the same as defined by the defaults in `SpinePublishing`. + */ + private fun Project.artifactPrefix(): String { + val ext = rootProject.extensions.findByType(SpinePublishing::class.java) + val result = ext?.artifactPrefix ?: SpinePublishing.DEFAULT_PREFIX + return result + } } private data class MavenMetadata(var versioning: Versioning = Versioning()) { diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt index f3218ef0b..2f7453634 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -137,6 +137,14 @@ fun Project.spinePublishing(block: SpinePublishing.() -> Unit) { */ open class SpinePublishing(private val project: Project) { + companion object { + + /** + * The default prefix added before a module name when publishing artifacts. + */ + const val DEFAULT_PREFIX = "spine-" + } + private val protoJar = ProtoJar() private val testJar = TestJar() private val dokkaJar = DokkaJar() @@ -197,10 +205,8 @@ open class SpinePublishing(private val project: Project) { /** * A prefix to be added before the name of each artifact. - * - * The default value is "spine-". */ - var artifactPrefix: String = "spine-" + var artifactPrefix: String = DEFAULT_PREFIX /** * Allows disabling publishing of [protoJar] artifact, containing all Proto sources diff --git a/config b/config index f9951f914..f6954386c 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit f9951f9140f737c5dd139499da64866a96c29572 +Subproject commit f6954386c224e9444129108f9bcf796812dd9b0c From 240083e31d43f7a719e0204263c4cb30e42b1f22 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 17:45:57 +0000 Subject: [PATCH 03/96] Update dependency reports --- dependencies.md | 68 ++++++++++++++++++++++++------------------------- pom.xml | 28 ++++++++++---------- 2 files changed, 48 insertions(+), 48 deletions(-) diff --git a/dependencies.md b/dependencies.md index 5710a3fde..aa705a363 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-mc-java:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -1030,12 +1030,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:05 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-annotation:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-annotation:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -1937,12 +1937,12 @@ This report was generated on **Sat Jan 04 16:31:05 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:05 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-base:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-base:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -2844,12 +2844,12 @@ This report was generated on **Sat Jan 04 16:31:05 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-checks:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-checks:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -3660,12 +3660,12 @@ This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-comparable:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-comparable:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -4567,12 +4567,12 @@ This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-comparable-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-comparable-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -5340,12 +5340,12 @@ This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-entity:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-entity:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -6247,12 +6247,12 @@ This report was generated on **Sat Jan 04 16:31:06 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-entity-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-entity-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7020,12 +7020,12 @@ This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-marker:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-marker:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -7927,12 +7927,12 @@ This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-marker-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-marker-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8700,12 +8700,12 @@ This report was generated on **Sat Jan 04 16:31:07 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-message-group:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-message-group:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -9607,12 +9607,12 @@ This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-message-group-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-message-group-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -10380,12 +10380,12 @@ This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-plugin-bundle:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-plugin-bundle:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -11366,12 +11366,12 @@ This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-signal:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-signal:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -12273,12 +12273,12 @@ This report was generated on **Sat Jan 04 16:31:08 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-signal-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-signal-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -13046,12 +13046,12 @@ This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-uuid:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-uuid:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -13953,12 +13953,12 @@ This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). -# Dependencies of `io.spine.tools:spine-mc-java-uuid-tests:2.0.0-SNAPSHOT.262` +# Dependencies of `io.spine.tools:spine-mc-java-uuid-tests:2.0.0-SNAPSHOT.263` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -14726,4 +14726,4 @@ This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sat Jan 04 16:31:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index cf8e940f7..c0d46b928 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools mc-java -2.0.0-SNAPSHOT.262 +2.0.0-SNAPSHOT.263 2015 @@ -38,13 +38,13 @@ all modules and does not describe the project structure per-subproject. io.spine protodata - 0.90.1 + 0.91.1 compile io.spine spine-base - 2.0.0-SNAPSHOT.234 + 2.0.0-SNAPSHOT.236 compile @@ -62,19 +62,19 @@ all modules and does not describe the project structure per-subproject. io.spine spine-server - 2.0.0-SNAPSHOT.191 + 2.0.0-SNAPSHOT.192 compile io.spine.protodata protodata-java - 0.90.1 + 0.91.1 compile io.spine.protodata protodata-params - 0.90.1 + 0.91.1 compile @@ -98,13 +98,13 @@ all modules and does not describe the project structure per-subproject. io.spine.validation spine-validation-configuration - 2.0.0-SNAPSHOT.182 + 2.0.0-SNAPSHOT.187 compile io.spine.validation spine-validation-java-runtime - 2.0.0-SNAPSHOT.182 + 2.0.0-SNAPSHOT.187 compile @@ -152,7 +152,7 @@ all modules and does not describe the project structure per-subproject. io.spine.protodata protodata-testlib - 0.90.1 + 0.91.1 test @@ -272,12 +272,12 @@ all modules and does not describe the project structure per-subproject. io.spine.protodata protodata-fat-cli - 0.90.0 + 0.91.1 io.spine.protodata protodata-protoc - 0.90.0 + 0.91.1 io.spine.tools @@ -287,18 +287,18 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-mc-java-checks - 2.0.0-SNAPSHOT.261 + 2.0.0-SNAPSHOT.262 provided io.spine.tools spine-mc-java-plugins - 2.0.0-SNAPSHOT.261 + 2.0.0-SNAPSHOT.262 io.spine.validation spine-validation-java-bundle - 2.0.0-SNAPSHOT.182 + 2.0.0-SNAPSHOT.187 net.sourceforge.pmd From 61f05a3b3af0f9f4c69660e1ef08ddad7ff282ad Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 18:53:40 +0000 Subject: [PATCH 04/96] Remove redundant module filtering ... because the module no longer belongs to the project. --- build.gradle.kts | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 45f79f865..8ce96b443 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -95,12 +95,7 @@ private object BuildSettings { } spinePublishing { - modules = productionModules.map { it.name } - // Do not publish the validation codegen module as it is deprecated in favor of - // ProtoData-based code generation of the Validation library. - // The module is still kept for the sake of historical reference. - .filter { !it.contains("mc-java-validation") } - .toSet() + modules = productionModules.map { it.name }.toSet() destinations = PublishingRepos.run { setOf( cloudArtifactRegistry, From 2943d2531359256d8fbf393b6500f6df00abf0c6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 18:53:53 +0000 Subject: [PATCH 05/96] Bump Kotlin and KSP --- buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt | 5 +++-- buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt index 9b884f277..7754f7c28 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -33,8 +33,9 @@ package io.spine.dependency.build */ object Ksp { /** - * The latest version compatible with Kotlin v1.8.22, which is bundled with Gradle 7.6.4. + * https://github.com/google/ksp/releases/tag/1.9.23-1.0.20 */ - const val version = "1.8.22-1.0.11" + const val version = "1.9.24-1.0.20" const val id = "com.google.devtools.ksp" + const val symbolProcessingApi = "com.google.devtools.ksp:symbol-processing-api:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt index 5ef694a36..0235d65b3 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt @@ -35,7 +35,7 @@ object Kotlin { * When changing the version, also change the version used in the `buildSrc/build.gradle.kts`. */ @Suppress("MemberVisibilityCanBePrivate") // used directly from the outside. - const val version = "1.9.23" + const val version = "1.9.24" /** * The version of the JetBrains annotations library, which is a transitive From 137f75970bf045cf47034b772636562dce473eb8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 18:59:42 +0000 Subject: [PATCH 06/96] Update KSP version docs --- buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt index 7754f7c28..5dbc1646c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -33,7 +33,9 @@ package io.spine.dependency.build */ object Ksp { /** - * https://github.com/google/ksp/releases/tag/1.9.23-1.0.20 + * This is the latest version for the Kotlin compiler of the 1.x family. + * + * @see The release info. */ const val version = "1.9.24-1.0.20" const val id = "com.google.devtools.ksp" From 5bfcce341be16dd411cc9bea62787cd1eaa24cef Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 19:00:43 +0000 Subject: [PATCH 07/96] Update dependency reports --- dependencies.md | 1634 ++++++++++++++++++++++++++++++++++++++++++----- pom.xml | 14 +- 2 files changed, 1477 insertions(+), 171 deletions(-) diff --git a/dependencies.md b/dependencies.md index aa705a363..4ab838858 100644 --- a/dependencies.md +++ b/dependencies.md @@ -234,19 +234,19 @@ * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -869,7 +869,7 @@ * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -897,19 +897,19 @@ * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1030,7 +1030,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1185,19 +1185,19 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1788,7 +1788,7 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1816,19 +1816,19 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1937,7 +1937,7 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2092,19 +2092,19 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -2695,7 +2695,7 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -2723,19 +2723,19 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -2844,7 +2844,7 @@ This report was generated on **Mon Jan 13 17:43:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2970,19 +2970,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -3515,7 +3515,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -3543,19 +3543,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -3660,7 +3660,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3815,19 +3815,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -4418,7 +4418,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -4446,19 +4446,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -4567,7 +4567,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4621,19 +4621,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -5191,7 +5191,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -5219,19 +5219,19 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -5340,7 +5340,7 @@ This report was generated on **Mon Jan 13 17:43:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5495,19 +5495,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6098,7 +6098,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6126,19 +6126,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6247,7 +6247,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -6301,19 +6301,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6871,7 +6871,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6899,19 +6899,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7020,7 +7020,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7175,19 +7175,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7778,7 +7778,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7806,19 +7806,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7927,7 +7927,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7981,19 +7981,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -8551,7 +8551,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -8579,19 +8579,19 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -8700,7 +8700,7 @@ This report was generated on **Mon Jan 13 17:43:18 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -8855,19 +8855,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -9458,7 +9458,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -9486,19 +9486,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -9607,7 +9607,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -9661,19 +9661,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -10231,7 +10231,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -10259,19 +10259,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -10380,7 +10380,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -10619,19 +10619,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11209,7 +11209,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11237,19 +11237,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11366,7 +11366,1301 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). + + + + +# Dependencies of `io.spine.tools:spine-mc-java-routing:2.0.0-SNAPSHOT.263` + +## Runtime +1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. + * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. + * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. + * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. + * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. + * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. + * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) + * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +## Compile, tests, and tooling +1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. + * **Project URL:** [http://aopalliance.sourceforge.net](http://aopalliance.sourceforge.net) + * **License:** Public Domain + +1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.48. + * **Project URL:** [http://beust.com/jcommander](http://beust.com/jcommander) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.82. + * **Project URL:** [https://jcommander.org](https://jcommander.org) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-bom](https://github.com/FasterXML/jackson-bom) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-annotations. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-core. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-core](https://github.com/FasterXML/jackson-core) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-databind. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-xml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformat-xml](https://github.com/FasterXML/jackson-dataformat-xml) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.woodstox. **Name** : woodstox-core. **Version** : 6.5.1. + * **Project URL:** [https://github.com/FasterXML/woodstox](https://github.com/FasterXML/woodstox) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. + * **Project URL:** [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.github.kevinstern. **Name** : software-and-algorithms. **Version** : 1.0. + * **Project URL:** [https://www.github.com/KevinStern/software-and-algorithms](https://www.github.com/KevinStern/software-and-algorithms) + * **License:** [MIT License](http://www.opensource.org/licenses/mit-license.php) + +1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.2. + * **Project URL:** [https://github.com/google/auto/tree/main/common](https://github.com/google/auto/tree/main/common) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. + * **Project URL:** [https://github.com/google/auto/tree/main/service](https://github.com/google/auto/tree/main/service) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.10.2. + * **Project URL:** [https://github.com/google/auto/tree/main/value](https://github.com/google/auto/tree/main/value) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. + * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. + * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotation](https://errorprone.info/error_prone_annotation) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_check_api](https://errorprone.info/error_prone_check_api) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_core](https://errorprone.info/error_prone_core) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_type_annotations](https://errorprone.info/error_prone_type_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : javac. **Version** : 9+181-r4173-1. + * **Project URL:** [https://github.com/google/error-prone-javac](https://github.com/google/error-prone-javac) + * **License:** [GNU General Public License, version 2, with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html) + +1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. + * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. + * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava-testlib. **Version** : 32.1.3-jre. + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.inject. **Name** : guice. **Version** : 5.1.0. + * **Project URL:** [https://github.com/google/guice](https://github.com/google/guice) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. + * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-java8-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-liteproto-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-proto-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.puppycrawl.tools. **Name** : checkstyle. **Version** : 10.12.1. + * **Project URL:** [https://checkstyle.org/](https://checkstyle.org/) + * **License:** [LGPL-2.1+](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) + +1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 4.0.10. + * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) + * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) + +1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. + * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : commons-codec. **Name** : commons-codec. **Version** : 1.16.0. + * **Project URL:** [https://commons.apache.org/proper/commons-codec/](https://commons.apache.org/proper/commons-codec/) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : commons-collections. **Name** : commons-collections. **Version** : 3.2.2. + * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.7.4. + * **Project URL:** [https://picocli.info](https://picocli.info) + * **License:** [The Apache Software License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.davidburstrom.contester. **Name** : contester-breakpoint. **Version** : 0.2.0. + * **Project URL:** [https://github.com/davidburstrom/contester](https://github.com/davidburstrom/contester) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k. **Version** : 0.4.0. + * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k-jvm. **Version** : 0.4.0. + * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.eisop. **Name** : dataflow-errorprone. **Version** : 3.34.0-eisop1. + * **Project URL:** [https://eisop.github.io/](https://eisop.github.io/) + * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) + +1. **Group** : io.github.java-diff-utils. **Name** : java-diff-utils. **Version** : 4.12. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-api. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-cli. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-core. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-metrics. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-parser. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-psi-utils. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-html. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-md. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-sarif. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-txt. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-xml. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-complexity. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-coroutines. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-documentation. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-empty. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-errorprone. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-exceptions. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-naming. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-performance. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-style. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-tooling. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-utils. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : it.unimi.dsi. **Name** : fastutil-core. **Version** : 8.5.12. + * **Project URL:** [http://fastutil.di.unimi.it/](http://fastutil.di.unimi.it/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +1. **Group** : javax.inject. **Name** : javax.inject. **Version** : 1. + * **Project URL:** [http://code.google.com/p/atinject/](http://code.google.com/p/atinject/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : junit. **Name** : junit. **Version** : 4.13.1. + * **Project URL:** [http://junit.org](http://junit.org) + * **License:** [Eclipse Public License 1.0](http://www.eclipse.org/legal/epl-v10.html) + +1. **Group** : net.java.dev.jna. **Name** : jna. **Version** : 5.6.0. + * **Project URL:** [https://github.com/java-native-access/jna](https://github.com/java-native-access/jna) + * **License:** [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [LGPL, version 2.1](http://www.gnu.org/licenses/licenses.html) + +1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 12.2. + * **Project URL:** [http://www.saxonica.com/](http://www.saxonica.com/) + * **License:** [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/2.0/) + +1. **Group** : net.sourceforge.pmd. **Name** : pmd-core. **Version** : 6.55.0. + * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) + +1. **Group** : net.sourceforge.pmd. **Name** : pmd-java. **Version** : 6.55.0. + * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) + +1. **Group** : net.sourceforge.saxon. **Name** : saxon. **Version** : 9.1.0.8. + * **Project URL:** [http://saxon.sourceforge.net/](http://saxon.sourceforge.net/) + * **License:** [Mozilla Public License Version 1.0](http://www.mozilla.org/MPL/MPL-1.0.txt) + +1. **Group** : org.antlr. **Name** : antlr4-runtime. **Version** : 4.11.1. + * **Project URL:** [https://www.antlr.org/](https://www.antlr.org/) + * **License:** [BSD-3-Clause](https://www.antlr.org/license.html) + +1. **Group** : org.antlr. **Name** : antlr4-runtime. **Version** : 4.7.2. + * **Project URL:** [http://www.antlr.org](http://www.antlr.org) + * **License:** [The BSD License](http://www.antlr.org/license.html) + +1. **Group** : org.apache.commons. **Name** : commons-lang3. **Version** : 3.8.1. + * **Project URL:** [http://commons.apache.org/proper/commons-lang/](http://commons.apache.org/proper/commons-lang/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.client5. **Name** : httpclient5. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.core5. **Name** : httpcore5. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.core5. **Name** : httpcore5-h2. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apiguardian. **Name** : apiguardian-api. **Version** : 1.1.2. + * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + +1. **Group** : org.codehaus.woodstox. **Name** : stax2-api. **Version** : 4.2.1. + * **Project URL:** [http://github.com/FasterXML/stax2-api](http://github.com/FasterXML/stax2-api) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The BSD License](http://www.opensource.org/licenses/bsd-license.php) + +1. **Group** : org.freemarker. **Name** : freemarker. **Version** : 2.3.32. + * **Project URL:** [https://freemarker.apache.org/](https://freemarker.apache.org/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.hamcrest. **Name** : hamcrest. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.hamcrest. **Name** : hamcrest-core. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.javassist. **Name** : javassist. **Version** : 3.28.0-GA. + * **Project URL:** [http://www.javassist.org/](http://www.javassist.org/) + * **License:** [Apache License 2.0](http://www.apache.org/licenses/) + * **License:** [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) + * **License:** [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html) + +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : markdown. **Version** : 0.5.2. + * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : markdown-jvm. **Version** : 0.5.2. + * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : analysis-kotlin-descriptors. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : analysis-markdown. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : dokka-base. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : dokka-core. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.intellij.deps. **Name** : trove4j. **Version** : 1.0.20200330. + * **Project URL:** [https://github.com/JetBrains/intellij-deps-trove4j](https://github.com/JetBrains/intellij-deps-trove4j) + * **License:** [GNU LESSER GENERAL PUBLIC LICENSE 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core-jvm. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.8.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.9.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core-jvm. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json-jvm. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jsoup. **Name** : jsoup. **Version** : 1.16.1. + * **Project URL:** [https://jsoup.org/](https://jsoup.org/) + * **License:** [The MIT License](https://jsoup.org/license) + +1. **Group** : org.junit. **Name** : junit-bom. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-api. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-engine. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-params. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.platform. **Name** : junit-platform-commons. **Version** : 1.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.platform. **Name** : junit-platform-engine. **Version** : 1.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.opentest4j. **Name** : opentest4j. **Version** : 1.3.0. + * **Project URL:** [https://github.com/ota4j-team/opentest4j](https://github.com/ota4j-team/opentest4j) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. + * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) + * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. + * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) + * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) + +1. **Group** : org.reflections. **Name** : reflections. **Version** : 0.10.2. + * **Project URL:** [http://github.com/ronmamo/reflections](http://github.com/ronmamo/reflections) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [WTFPL](http://www.wtfpl.net/) + +1. **Group** : org.snakeyaml. **Name** : snakeyaml-engine. **Version** : 2.6. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml-engine](https://bitbucket.org/snakeyaml/snakeyaml-engine) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.xmlresolver. **Name** : xmlresolver. **Version** : 5.1.2. + * **Project URL:** [https://github.com/xmlresolver/xmlresolver](https://github.com/xmlresolver/xmlresolver) + * **License:** [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0) + + +The dependencies distributed under several licenses, are used according their commercial-use-friendly license. + +This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). + + + + +# Dependencies of `io.spine.tools:spine-mc-java-routing-tests:2.0.0-SNAPSHOT.263` + +## Runtime +1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. + * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. + * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. + * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. + * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. + * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. + * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) + * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +## Compile, tests, and tooling +1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. + * **Project URL:** [http://aopalliance.sourceforge.net](http://aopalliance.sourceforge.net) + * **License:** Public Domain + +1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.48. + * **Project URL:** [http://beust.com/jcommander](http://beust.com/jcommander) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.beust. **Name** : jcommander. **Version** : 1.82. + * **Project URL:** [https://jcommander.org](https://jcommander.org) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-bom](https://github.com/FasterXML/jackson-bom) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-annotations. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-core. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-core](https://github.com/FasterXML/jackson-core) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-databind. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-xml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformat-xml](https://github.com/FasterXML/jackson-dataformat-xml) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.woodstox. **Name** : woodstox-core. **Version** : 6.5.1. + * **Project URL:** [https://github.com/FasterXML/woodstox](https://github.com/FasterXML/woodstox) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. + * **Project URL:** [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.github.kevinstern. **Name** : software-and-algorithms. **Version** : 1.0. + * **Project URL:** [https://www.github.com/KevinStern/software-and-algorithms](https://www.github.com/KevinStern/software-and-algorithms) + * **License:** [MIT License](http://www.opensource.org/licenses/mit-license.php) + +1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.2. + * **Project URL:** [https://github.com/google/auto/tree/main/common](https://github.com/google/auto/tree/main/common) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. + * **Project URL:** [https://github.com/google/auto/tree/main/service](https://github.com/google/auto/tree/main/service) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.auto.value. **Name** : auto-value-annotations. **Version** : 1.10.2. + * **Project URL:** [https://github.com/google/auto/tree/main/value](https://github.com/google/auto/tree/main/value) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. + * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.code.gson. **Name** : gson. **Version** : 2.10.1. + * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotation](https://errorprone.info/error_prone_annotation) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_annotations](https://errorprone.info/error_prone_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_check_api. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_check_api](https://errorprone.info/error_prone_check_api) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_core. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_core](https://errorprone.info/error_prone_core) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : error_prone_type_annotations. **Version** : 2.23.0. + * **Project URL:** [https://errorprone.info/error_prone_type_annotations](https://errorprone.info/error_prone_type_annotations) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.errorprone. **Name** : javac. **Version** : 9+181-r4173-1. + * **Project URL:** [https://github.com/google/error-prone-javac](https://github.com/google/error-prone-javac) + * **License:** [GNU General Public License, version 2, with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html) + +1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. + * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava. **Version** : 32.1.3-jre. + * **Project URL:** [https://github.com/google/guava](https://github.com/google/guava) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : guava-testlib. **Version** : 32.1.3-jre. + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.guava. **Name** : listenablefuture. **Version** : 9999.0-empty-to-avoid-conflict-with-guava. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.inject. **Name** : guice. **Version** : 5.1.0. + * **Project URL:** [https://github.com/google/guice](https://github.com/google/guice) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.j2objc. **Name** : j2objc-annotations. **Version** : 2.8. + * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-java-util. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : com.google.protobuf. **Name** : protoc. **Version** : 3.25.1. + * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) + * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth. **Name** : truth. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-java8-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-liteproto-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.truth.extensions. **Name** : truth-proto-extension. **Version** : 1.1.5. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.puppycrawl.tools. **Name** : checkstyle. **Version** : 10.12.1. + * **Project URL:** [https://checkstyle.org/](https://checkstyle.org/) + * **License:** [LGPL-2.1+](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) + +1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 4.0.10. + * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) + * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) + +1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. + * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : commons-codec. **Name** : commons-codec. **Version** : 1.16.0. + * **Project URL:** [https://commons.apache.org/proper/commons-codec/](https://commons.apache.org/proper/commons-codec/) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : commons-collections. **Name** : commons-collections. **Version** : 3.2.2. + * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.7.4. + * **Project URL:** [https://picocli.info](https://picocli.info) + * **License:** [The Apache Software License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.davidburstrom.contester. **Name** : contester-breakpoint. **Version** : 0.2.0. + * **Project URL:** [https://github.com/davidburstrom/contester](https://github.com/davidburstrom/contester) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k. **Version** : 0.4.0. + * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.detekt.sarif4k. **Name** : sarif4k-jvm. **Version** : 0.4.0. + * **Project URL:** [https://detekt.github.io/detekt](https://detekt.github.io/detekt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.github.eisop. **Name** : dataflow-errorprone. **Version** : 3.34.0-eisop1. + * **Project URL:** [https://eisop.github.io/](https://eisop.github.io/) + * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) + +1. **Group** : io.github.java-diff-utils. **Name** : java-diff-utils. **Version** : 4.12. + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-api. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-cli. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-core. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-metrics. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-parser. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-psi-utils. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-html. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-md. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-sarif. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-txt. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-report-xml. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-complexity. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-coroutines. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-documentation. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-empty. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-errorprone. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-exceptions. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-naming. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-performance. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-rules-style. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-tooling. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.gitlab.arturbosch.detekt. **Name** : detekt-utils. **Version** : 1.23.0. + * **Project URL:** [https://detekt.dev](https://detekt.dev) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : it.unimi.dsi. **Name** : fastutil-core. **Version** : 8.5.12. + * **Project URL:** [http://fastutil.di.unimi.it/](http://fastutil.di.unimi.it/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) + +1. **Group** : javax.inject. **Name** : javax.inject. **Version** : 1. + * **Project URL:** [http://code.google.com/p/atinject/](http://code.google.com/p/atinject/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : junit. **Name** : junit. **Version** : 4.13.1. + * **Project URL:** [http://junit.org](http://junit.org) + * **License:** [Eclipse Public License 1.0](http://www.eclipse.org/legal/epl-v10.html) + +1. **Group** : net.java.dev.jna. **Name** : jna. **Version** : 5.6.0. + * **Project URL:** [https://github.com/java-native-access/jna](https://github.com/java-native-access/jna) + * **License:** [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [LGPL, version 2.1](http://www.gnu.org/licenses/licenses.html) + +1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 12.2. + * **Project URL:** [http://www.saxonica.com/](http://www.saxonica.com/) + * **License:** [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/2.0/) + +1. **Group** : net.sourceforge.pmd. **Name** : pmd-core. **Version** : 6.55.0. + * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) + +1. **Group** : net.sourceforge.pmd. **Name** : pmd-java. **Version** : 6.55.0. + * **License:** [BSD-style](http://pmd.sourceforge.net/license.html) + +1. **Group** : net.sourceforge.saxon. **Name** : saxon. **Version** : 9.1.0.8. + * **Project URL:** [http://saxon.sourceforge.net/](http://saxon.sourceforge.net/) + * **License:** [Mozilla Public License Version 1.0](http://www.mozilla.org/MPL/MPL-1.0.txt) + +1. **Group** : org.antlr. **Name** : antlr4-runtime. **Version** : 4.11.1. + * **Project URL:** [https://www.antlr.org/](https://www.antlr.org/) + * **License:** [BSD-3-Clause](https://www.antlr.org/license.html) + +1. **Group** : org.antlr. **Name** : antlr4-runtime. **Version** : 4.7.2. + * **Project URL:** [http://www.antlr.org](http://www.antlr.org) + * **License:** [The BSD License](http://www.antlr.org/license.html) + +1. **Group** : org.apache.commons. **Name** : commons-lang3. **Version** : 3.8.1. + * **Project URL:** [http://commons.apache.org/proper/commons-lang/](http://commons.apache.org/proper/commons-lang/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.client5. **Name** : httpclient5. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.core5. **Name** : httpcore5. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.httpcomponents.core5. **Name** : httpcore5-h2. **Version** : 5.1.3. + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apiguardian. **Name** : apiguardian-api. **Version** : 1.1.2. + * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. + * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + +1. **Group** : org.codehaus.woodstox. **Name** : stax2-api. **Version** : 4.2.1. + * **Project URL:** [http://github.com/FasterXML/stax2-api](http://github.com/FasterXML/stax2-api) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The BSD License](http://www.opensource.org/licenses/bsd-license.php) + +1. **Group** : org.freemarker. **Name** : freemarker. **Version** : 2.3.32. + * **Project URL:** [https://freemarker.apache.org/](https://freemarker.apache.org/) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.hamcrest. **Name** : hamcrest. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.hamcrest. **Name** : hamcrest-core. **Version** : 2.2. + * **Project URL:** [http://hamcrest.org/JavaHamcrest/](http://hamcrest.org/JavaHamcrest/) + * **License:** [BSD License 3](http://opensource.org/licenses/BSD-3-Clause) + +1. **Group** : org.javassist. **Name** : javassist. **Version** : 3.28.0-GA. + * **Project URL:** [http://www.javassist.org/](http://www.javassist.org/) + * **License:** [Apache License 2.0](http://www.apache.org/licenses/) + * **License:** [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) + * **License:** [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html) + +1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. + * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : markdown. **Version** : 0.5.2. + * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains. **Name** : markdown-jvm. **Version** : 0.5.2. + * **Project URL:** [https://github.com/JetBrains/markdown](https://github.com/JetBrains/markdown) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : analysis-kotlin-descriptors. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : analysis-markdown. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : dokka-base. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : dokka-core. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.intellij.deps. **Name** : trove4j. **Version** : 1.0.20200330. + * **Project URL:** [https://github.com/JetBrains/intellij-deps-trove4j](https://github.com/JetBrains/intellij-deps-trove4j) + * **License:** [GNU LESSER GENERAL PUBLIC LICENSE 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-daemon-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-klib-commonizer-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.8.21. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-script-runtime. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-common. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-compiler-impl-embeddable. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-scripting-jvm. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core-jvm. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.8.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.9.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-core-jvm. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-serialization-json-jvm. **Version** : 1.4.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.serialization](https://github.com/Kotlin/kotlinx.serialization) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jsoup. **Name** : jsoup. **Version** : 1.16.1. + * **Project URL:** [https://jsoup.org/](https://jsoup.org/) + * **License:** [The MIT License](https://jsoup.org/license) + +1. **Group** : org.junit. **Name** : junit-bom. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-api. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-engine. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.jupiter. **Name** : junit-jupiter-params. **Version** : 5.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.platform. **Name** : junit-platform-commons. **Version** : 1.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.junit.platform. **Name** : junit-platform-engine. **Version** : 1.10.0. + * **Project URL:** [https://junit.org/junit5/](https://junit.org/junit5/) + * **License:** [Eclipse Public License v2.0](https://www.eclipse.org/legal/epl-v20.html) + +1. **Group** : org.opentest4j. **Name** : opentest4j. **Version** : 1.3.0. + * **Project URL:** [https://github.com/ota4j-team/opentest4j](https://github.com/ota4j-team/opentest4j) + * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. + * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) + * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.pcollections. **Name** : pcollections. **Version** : 3.1.4. + * **Project URL:** [https://github.com/hrldcpr/pcollections](https://github.com/hrldcpr/pcollections) + * **License:** [The MIT License](https://opensource.org/licenses/mit-license.php) + +1. **Group** : org.reflections. **Name** : reflections. **Version** : 0.10.2. + * **Project URL:** [http://github.com/ronmamo/reflections](http://github.com/ronmamo/reflections) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [WTFPL](http://www.wtfpl.net/) + +1. **Group** : org.snakeyaml. **Name** : snakeyaml-engine. **Version** : 2.6. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml-engine](https://bitbucket.org/snakeyaml/snakeyaml-engine) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.xmlresolver. **Name** : xmlresolver. **Version** : 5.1.2. + * **Project URL:** [https://github.com/xmlresolver/xmlresolver](https://github.com/xmlresolver/xmlresolver) + * **License:** [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0) + + +The dependencies distributed under several licenses, are used according their commercial-use-friendly license. + +This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -11521,19 +12815,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12124,7 +13418,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12152,19 +13446,19 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12273,7 +13567,7 @@ This report was generated on **Mon Jan 13 17:43:19 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -12327,19 +13621,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12897,7 +14191,7 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12925,19 +14219,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13046,7 +14340,7 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -13201,19 +14495,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13804,7 +15098,7 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13832,19 +15126,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13953,7 +15247,7 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -14007,19 +15301,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -14577,7 +15871,7 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-reflect. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -14605,19 +15899,19 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-common. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.23. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -14726,4 +16020,4 @@ This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 17:43:20 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index c0d46b928..447aef98f 100644 --- a/pom.xml +++ b/pom.xml @@ -23,6 +23,12 @@ all modules and does not describe the project structure per-subproject. + + com.google.devtools.ksp + symbol-processing-api + 1.9.24-1.0.20 + compile + com.google.guava guava @@ -113,10 +119,16 @@ all modules and does not describe the project structure per-subproject. 3.1.0 compile + + org.jetbrains.kotlin + kotlin-stdlib + 1.9.24 + compile + org.jetbrains.kotlin kotlin-stdlib-jdk8 - 1.9.23 + 1.9.24 compile From d7b727a740ff469916d48a7d0ce6d7fef6352091 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 19:04:25 +0000 Subject: [PATCH 08/96] Address deprecations --- build.gradle.kts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 8ce96b443..0c153fc95 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -47,7 +47,6 @@ import org.jetbrains.dokka.gradle.DokkaMultiModuleTask buildscript { standardSpineSdkRepositories() - val spine = io.spine.dependency.local.Spine val toolBase = io.spine.dependency.local.ToolBase val coreJava = io.spine.dependency.local.CoreJava val validation = io.spine.dependency.local.Validation @@ -61,8 +60,8 @@ buildscript { resolutionStrategy { force( io.spine.dependency.lib.Grpc.api, - spine.baseForBuildScript, - spine.reflect, + io.spine.dependency.local.Base.libForBuildScript, + io.spine.dependency.local.Reflect.lib, toolBase.lib, coreJava.server, logging.lib, From b2e7b1e24989ff74e4d1f2ef734c7a240c9c2f2d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 19:29:01 +0000 Subject: [PATCH 09/96] Update dependency reports --- dependencies.md | 58 +++++++++++++++++++++++++++++++------------------ pom.xml | 5 +++++ 2 files changed, 42 insertions(+), 21 deletions(-) diff --git a/dependencies.md b/dependencies.md index 4ab838858..fc056a2f3 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1030,7 +1030,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1937,7 +1937,7 @@ This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2844,7 +2844,7 @@ This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3660,7 +3660,7 @@ This report was generated on **Mon Jan 13 19:00:13 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4567,7 +4567,7 @@ This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5340,7 +5340,7 @@ This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -6247,7 +6247,7 @@ This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7020,7 +7020,7 @@ This report was generated on **Mon Jan 13 19:00:14 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7927,7 +7927,7 @@ This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -8700,7 +8700,7 @@ This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -9607,7 +9607,7 @@ This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -10380,7 +10380,7 @@ This report was generated on **Mon Jan 13 19:00:15 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -11366,7 +11366,7 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -12021,7 +12021,7 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -12083,11 +12083,11 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.8.22. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.8.22. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12171,6 +12171,14 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing. **Version** : 1.9.24-1.0.20. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.errorprone. **Name** : error_prone_annotation. **Version** : 2.23.0. * **Project URL:** [https://errorprone.info/error_prone_annotation](https://errorprone.info/error_prone_annotation) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12559,10 +12567,18 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12660,7 +12676,7 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -13567,7 +13583,7 @@ This report was generated on **Mon Jan 13 19:00:16 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -14340,7 +14356,7 @@ This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -15247,7 +15263,7 @@ This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -16020,4 +16036,4 @@ This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:00:17 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Mon Jan 13 19:26:02 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 447aef98f..2f9572b93 100644 --- a/pom.xml +++ b/pom.xml @@ -239,6 +239,11 @@ all modules and does not describe the project structure per-subproject. 3.0.2 provided + + com.google.devtools.ksp + symbol-processing + 1.9.24-1.0.20 + com.google.errorprone error_prone_annotations From 71530a21e503ff2136454c9d466d7b81cce30431 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 19:29:15 +0000 Subject: [PATCH 10/96] Add `routing` module --- mc-java-routing-tests/build.gradle.kts | 34 ++++++++++++++++++++++++ mc-java-routing/build.gradle.kts | 36 ++++++++++++++++++++++++++ settings.gradle.kts | 2 ++ 3 files changed, 72 insertions(+) create mode 100644 mc-java-routing-tests/build.gradle.kts create mode 100644 mc-java-routing/build.gradle.kts diff --git a/mc-java-routing-tests/build.gradle.kts b/mc-java-routing-tests/build.gradle.kts new file mode 100644 index 000000000..5c902fa0a --- /dev/null +++ b/mc-java-routing-tests/build.gradle.kts @@ -0,0 +1,34 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +plugins { + kotlin("jvm") + ksp +} + +dependencies { + implementation(kotlin("stdlib")) +} diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts new file mode 100644 index 000000000..3f63d4616 --- /dev/null +++ b/mc-java-routing/build.gradle.kts @@ -0,0 +1,36 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import io.spine.dependency.build.Ksp + +plugins { + kotlin("jvm") +} + +dependencies { + implementation(kotlin("stdlib")) + implementation(Ksp.symbolProcessingApi) +} diff --git a/settings.gradle.kts b/settings.gradle.kts index 621996cf2..47e2ae528 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -41,6 +41,8 @@ include( "mc-java-marker-tests", "mc-java-message-group", "mc-java-message-group-tests", + "mc-java-routing", + "mc-java-routing-tests", "mc-java-uuid", "mc-java-uuid-tests", "mc-java-plugin-bundle" From 919eaf74f677c3f3aaa7f9643403525e540c9c71 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 13 Jan 2025 20:45:35 +0000 Subject: [PATCH 11/96] Rollback Ksp Also: * Add `KotlinPoet` dependency object. --- .../kotlin/io/spine/dependency/build/Ksp.kt | 14 ++++++-- .../io/spine/dependency/lib/KotlinPoet.kt | 34 +++++++++++++++++++ mc-java-routing/build.gradle.kts | 2 ++ 3 files changed, 47 insertions(+), 3 deletions(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt index 5dbc1646c..2463257ec 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -31,13 +31,21 @@ package io.spine.dependency.build * * @see KSP GitHub repository */ +@Suppress("ConstPropertyName") object Ksp { + /** - * This is the latest version for the Kotlin compiler of the 1.x family. + * The latest version compatible with Kotlin v1.8.22, which is bundled with Gradle 7.6.4. + * + * We need to stick to this version until we migrate to newer Gradle. + * Trying to use a newer version results in the following console output: + * ``` + * ksp-1.9.24-1.0.20 is too new for kotlin-1.8.22. Please upgrade kotlin-gradle-plugin to 1.9.24. + * ``` * - * @see The release info. + * The version compatible with Kotlin v1.9.24 compiler is 1.9.24-1.0.20. */ - const val version = "1.9.24-1.0.20" + const val version = "1.8.22-1.0.11" const val id = "com.google.devtools.ksp" const val symbolProcessingApi = "com.google.devtools.ksp:symbol-processing-api:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt new file mode 100644 index 000000000..88a1fd5ce --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt @@ -0,0 +1,34 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.dependency.lib + +// https://github.com/square/kotlinpoet +@Suppress("unused", "ConstPropertyName") +object KotlinPoet { + private const val version = "2.0.0" + const val lib = "com.squareup:kotlinpoet:$version" +} diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 3f63d4616..9a30640da 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -25,6 +25,7 @@ */ import io.spine.dependency.build.Ksp +import io.spine.dependency.lib.KotlinPoet plugins { kotlin("jvm") @@ -33,4 +34,5 @@ plugins { dependencies { implementation(kotlin("stdlib")) implementation(Ksp.symbolProcessingApi) + implementation(KotlinPoet.lib) } From 6c362089185e325b0728ed5327df261d890a89d2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 14 Jan 2025 20:08:23 +0000 Subject: [PATCH 12/96] Draft `RouteProcessor` --- mc-java-routing-tests/build.gradle.kts | 18 +++ mc-java-routing/build.gradle.kts | 8 ++ .../tools/mc/java/routing/RouteProcessor.kt | 106 ++++++++++++++++++ .../mc/java/routing/RouteProcessorProvider.kt | 43 +++++++ 4 files changed, 175 insertions(+) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt diff --git a/mc-java-routing-tests/build.gradle.kts b/mc-java-routing-tests/build.gradle.kts index 5c902fa0a..3c50bf7c4 100644 --- a/mc-java-routing-tests/build.gradle.kts +++ b/mc-java-routing-tests/build.gradle.kts @@ -24,11 +24,29 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import io.spine.dependency.local.CoreJava + plugins { kotlin("jvm") ksp + `java-test-fixtures` } dependencies { implementation(kotlin("stdlib")) + implementation(CoreJava.server) + kspTest(project(":mc-java-routing")) + kspTestFixtures(project(":mc-java-routing")) +} + +kotlin { + sourceSets.main { + kotlin.srcDir("build/generated/ksp/main/kotlin") + } + sourceSets.test { + kotlin.srcDir("build/generated/ksp/test/kotlin") + } + sourceSets.testFixtures { + kotlin.srcDir("build/generated/ksp/testFixtures/kotlin") + } } diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 9a30640da..b8862169e 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -25,14 +25,22 @@ */ import io.spine.dependency.build.Ksp +import io.spine.dependency.lib.AutoService +import io.spine.dependency.lib.AutoServiceKsp import io.spine.dependency.lib.KotlinPoet +import io.spine.dependency.local.CoreJava plugins { kotlin("jvm") + ksp } dependencies { + ksp(AutoServiceKsp.processor) implementation(kotlin("stdlib")) implementation(Ksp.symbolProcessingApi) implementation(KotlinPoet.lib) + implementation(KotlinPoet.ksp) + implementation(CoreJava.server) + implementation(AutoService.annotations) } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt new file mode 100644 index 000000000..be698e60b --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -0,0 +1,106 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.CodeGenerator +import com.google.devtools.ksp.processing.Dependencies +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.symbol.KSAnnotated +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSFile +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSVisitorVoid +import com.google.devtools.ksp.validate +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.ksp.writeTo +import io.spine.server.route.Route + +internal class RouteProcessor( + private val codeGenerator: CodeGenerator, + @Suppress("unused") internal val logger: KSPLogger +) : SymbolProcessor { + + override fun process(resolver: Resolver): List { + val symbols = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) + val unprocessed = symbols.filterNot { !it.validate() }.toList() + val routingFunctions = symbols + .filter { it is KSFunctionDeclaration && it.validate() } + .map { it as KSFunctionDeclaration } + + validate(routingFunctions) + + val declaringClasses = routingFunctions.declaringClasses() + declaringClasses.forEach { (declaringClass, functions) -> + val visitor = RouteVisitor(functions) + declaringClass.accept(visitor, Unit) + visitor.writeFile() + } + return unprocessed + } + + private inner class RouteVisitor(private val functions: List) : + KSVisitorVoid() { + + private lateinit var packageName: String + private lateinit var originalFile: KSFile + private lateinit var routingClass: TypeSpec.Builder + + override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { + originalFile = classDeclaration.containingFile!! + packageName = originalFile.packageName.asString() + val className = classDeclaration.simpleName.asString() + "\$\$Routing" + routingClass = TypeSpec.classBuilder(className) + functions.forEach { it.accept(this, Unit) } + } + + override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { + //TODO:2025-01-14:alexander.yevsyukov: Implement + } + + fun writeFile() { + val cls = routingClass.build() + val code = FileSpec.builder(packageName, cls.name!!) + .addType(cls) + .build() + val deps = Dependencies(true, originalFile) + code.writeTo(codeGenerator, deps) + } + } +} + +@Suppress("UnusedReceiverParameter", "UNUSED_PARAMETER") +private fun RouteProcessor.validate(routingFunctions: Sequence) { + //TODO:2025-01-14:alexander.yevsyukov: +} + +private fun Sequence.declaringClasses(): + Map> = + filter { it.parentDeclaration!! is KSClassDeclaration } + .groupBy { it.parentDeclaration!! as KSClassDeclaration } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt new file mode 100644 index 000000000..9ffb17697 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.auto.service.AutoService +import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.processing.SymbolProcessorEnvironment +import com.google.devtools.ksp.processing.SymbolProcessorProvider + +/** + * Creates a symbol processor for the [Route][io.spine.server.route.Route] annotation. + * + * @see RouteProcessor + */ +@AutoService(SymbolProcessorProvider::class) +public class RouteProcessorProvider : SymbolProcessorProvider { + override fun create(environment: SymbolProcessorEnvironment): SymbolProcessor = + RouteProcessor(environment.codeGenerator, environment.logger) +} From d50e071f78b3247939fe848d22de3d6bda7f9c60 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 14 Jan 2025 20:08:36 +0000 Subject: [PATCH 13/96] Add `ksp` artifact --- buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt index 88a1fd5ce..346c5d8d3 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinPoet.kt @@ -31,4 +31,5 @@ package io.spine.dependency.lib object KotlinPoet { private const val version = "2.0.0" const val lib = "com.squareup:kotlinpoet:$version" + const val ksp = "com.squareup:kotlinpoet-ksp:$version" } From dddd60913ce12fdc4a0d1ea3ba403ff2a4e9a78b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 20 Jan 2025 19:50:34 +0000 Subject: [PATCH 14/96] Draft stub domain --- .../test/proto/given/devices/commands.proto | 47 ++++++++++++++++++ .../test/proto/given/devices/entities.proto | 48 +++++++++++++++++++ .../src/test/proto/given/devices/events.proto | 48 +++++++++++++++++++ 3 files changed, 143 insertions(+) create mode 100644 mc-java-routing/src/test/proto/given/devices/commands.proto create mode 100644 mc-java-routing/src/test/proto/given/devices/entities.proto create mode 100644 mc-java-routing/src/test/proto/given/devices/events.proto diff --git a/mc-java-routing/src/test/proto/given/devices/commands.proto b/mc-java-routing/src/test/proto/given/devices/commands.proto new file mode 100644 index 000000000..c1c154a81 --- /dev/null +++ b/mc-java-routing/src/test/proto/given/devices/commands.proto @@ -0,0 +1,47 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.devices; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.devices.commands"; +option java_outer_classname = "CommandsProto"; +option java_multiple_files = true; + +import "given/devices/values.proto"; + +message RegisterDevice { + DeviceId device = 1; + FirmwareVersion firmware = 2 [(required) = true]; +} + +message ReportStatus { + DeviceId device = 1; +} diff --git a/mc-java-routing/src/test/proto/given/devices/entities.proto b/mc-java-routing/src/test/proto/given/devices/entities.proto new file mode 100644 index 000000000..13d708251 --- /dev/null +++ b/mc-java-routing/src/test/proto/given/devices/entities.proto @@ -0,0 +1,48 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.devices; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.devices"; +option java_outer_classname = "EntitiesProto"; +option java_multiple_files = true; + +import "given/devices/values.proto"; + +message Device { + DeviceId id = 1; + FirmwareVersion firmware = 2 [(required) = true]; +} + +message DeviceStatus { + DeviceId id = 1; + repeated string status = 2 [(required) = true]; +} diff --git a/mc-java-routing/src/test/proto/given/devices/events.proto b/mc-java-routing/src/test/proto/given/devices/events.proto new file mode 100644 index 000000000..732ceaf1f --- /dev/null +++ b/mc-java-routing/src/test/proto/given/devices/events.proto @@ -0,0 +1,48 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.devices; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.devices.events"; +option java_outer_classname = "EventsProto"; +option java_multiple_files = true; + +import "given/devices/values.proto"; + +message DeviceRegistered { + DeviceId device = 1 [(required) = true]; + FirmwareVersion firmware = 2 [(required) = true]; +} + +message StatusReported { + DeviceId device = 1[(required) = true]; + string status = 2 [(required) = true]; +} From 0856667e6e7582916fb27372ac364b54009fabc8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 20 Jan 2025 19:51:14 +0000 Subject: [PATCH 15/96] Refine KSP-related dependencies --- .../kotlin/io/spine/dependency/build/Ksp.kt | 4 +- .../kotlin/io/spine/dependency/lib/Kotlin.kt | 5 +++ .../dependency/test/KotlinCompileTesting.kt | 40 +++++++++++++++++ mc-java-routing/build.gradle.kts | 19 ++++++++ .../src/test/proto/given/devices/values.proto | 44 +++++++++++++++++++ 5 files changed, 111 insertions(+), 1 deletion(-) create mode 100644 buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt create mode 100644 mc-java-routing/src/test/proto/given/devices/values.proto diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt index 2463257ec..3743e076b 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -47,5 +47,7 @@ object Ksp { */ const val version = "1.8.22-1.0.11" const val id = "com.google.devtools.ksp" - const val symbolProcessingApi = "com.google.devtools.ksp:symbol-processing-api:$version" + const val group = "com.google.devtools.ksp" + const val symbolProcessingApi = "$group:symbol-processing-api:$version" + const val symbolProcessing = "$group:symbol-processing:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt index 0235d65b3..21417f4ef 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Kotlin.kt @@ -63,4 +63,9 @@ object Kotlin { const val gradlePluginLib = "$group:kotlin-gradle-plugin:$version" const val jetbrainsAnnotations = "org.jetbrains:annotations:$annotationsVersion" + + object Compiler { + const val version = "1.8.22" + const val embeddable = "$group:kotlin-compiler-embeddable:$version" + } } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt new file mode 100644 index 000000000..d743985c6 --- /dev/null +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt @@ -0,0 +1,40 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.dependency.test + +/** + * A library for in-process compilation of Kotlin and Java code compilation. + * + * @see GitHub repo + */ +@Suppress("unused", "ConstPropertyName") +object KotlinCompileTesting { + private const val version = "1.5.0" // Compatible with Kotlin Compiler 1.8.22. + private const val group = "com.github.tschuchortdev" + const val lib = "$group:kotlin-compile-testing:$version" + const val libKsp = "$group:kotlin-compile-testing-ksp:$version" +} diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index b8862169e..1d4de4a3c 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -27,8 +27,11 @@ import io.spine.dependency.build.Ksp import io.spine.dependency.lib.AutoService import io.spine.dependency.lib.AutoServiceKsp +import io.spine.dependency.lib.Kotlin import io.spine.dependency.lib.KotlinPoet import io.spine.dependency.local.CoreJava +import io.spine.dependency.test.Kotest +import io.spine.dependency.test.KotlinCompileTesting plugins { kotlin("jvm") @@ -43,4 +46,20 @@ dependencies { implementation(KotlinPoet.ksp) implementation(CoreJava.server) implementation(AutoService.annotations) + + testImplementation(Kotest.assertions) + testImplementation(KotlinCompileTesting.libKsp) +} + +configurations + // https://detekt.dev/docs/gettingstarted/gradle/#dependencies + .matching { it.name != "detekt" } + .all { + resolutionStrategy { + force( + Ksp.symbolProcessingApi, + Ksp.symbolProcessing, + Kotlin.Compiler.embeddable, + ) + } } diff --git a/mc-java-routing/src/test/proto/given/devices/values.proto b/mc-java-routing/src/test/proto/given/devices/values.proto new file mode 100644 index 000000000..bf35baaa2 --- /dev/null +++ b/mc-java-routing/src/test/proto/given/devices/values.proto @@ -0,0 +1,44 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.devices; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.devices"; +option java_outer_classname = "ValuesProto"; +option java_multiple_files = true; + +message DeviceId { + string uuid = 1 [(required) = true]; +} + +message FirmwareVersion { + string value = 1 [(required) = true]; +} From 3707746a5212f9720aec844eb6991867a886fb7b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 20 Jan 2025 19:51:25 +0000 Subject: [PATCH 16/96] Draft compilation-based test --- .../tools/mc/java/routing/RouteProcessor.kt | 5 +- .../routing/RouteProcessorJavaErrorSpec.kt | 73 +++++++++++++++++++ 2 files changed, 76 insertions(+), 2 deletions(-) create mode 100644 mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index be698e60b..343996e35 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -65,8 +65,9 @@ internal class RouteProcessor( return unprocessed } - private inner class RouteVisitor(private val functions: List) : - KSVisitorVoid() { + private inner class RouteVisitor( + private val functions: List + ) : KSVisitorVoid() { private lateinit var packageName: String private lateinit var originalFile: KSFile diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt new file mode 100644 index 000000000..4eacb9fb1 --- /dev/null +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -0,0 +1,73 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.tschuchort.compiletesting.KotlinCompilation +import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR +import com.tschuchort.compiletesting.SourceFile +import com.tschuchort.compiletesting.symbolProcessorProviders +import io.kotest.matchers.shouldBe +import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@ExperimentalCompilerApi +@DisplayName("`RouteProcessor` should detect Java code errors") +internal class RouteProcessorJavaErrorSpec { + + private lateinit var compilation: KotlinCompilation + + @BeforeEach + fun prepareCompilation() { + compilation = KotlinCompilation() + } + + @Test + fun `when non-static method annotated`() { + compilation.apply { + javaPackagePrefix = "io.spine.routing.given" + sources = listOf(annotatedNonStatic) + symbolProcessorProviders = listOf(RouteProcessorProvider()) + } + val result = compilation.compile() + + result.exitCode shouldBe COMPILATION_ERROR + } +} + +private val annotatedNonStatic = SourceFile.java( + "io/spine/routing/given/AnnotatedNonStatic.java", """ + package io.spine.routing.given; + + import io.spine.server.route.Route; + + class AnnotatedNonStatic { + + } + """.trimIndent() +) From 1d9765efc6064e14f7b413e8df0c72ffcf622639 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 20 Jan 2025 21:07:17 +0000 Subject: [PATCH 17/96] Ensure generated code is ready for KSP tasks --- mc-java-routing/build.gradle.kts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 1d4de4a3c..50724fac6 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -36,6 +36,7 @@ import io.spine.dependency.test.KotlinCompileTesting plugins { kotlin("jvm") ksp + id("io.spine.mc-java") } dependencies { @@ -63,3 +64,10 @@ configurations ) } } + +// Avoid the missing file error for generated code when running tests out of IDE. +afterEvaluate { + val kspTestKotlin by tasks.getting + val launchTestProtoData by tasks.getting + kspTestKotlin.dependsOn(launchTestProtoData) +} From ce3b804dd2cafec54c092319501c05636e2280a4 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 20 Jan 2025 21:07:42 +0000 Subject: [PATCH 18/96] Test routing function must be static --- .../tools/mc/java/routing/RouteProcessor.kt | 21 +++++++-- .../routing/RouteProcessorJavaErrorSpec.kt | 43 ++++++++++++++++--- 2 files changed, 53 insertions(+), 11 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 343996e35..bbcb5758c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -31,6 +31,7 @@ import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.processing.SymbolProcessor +import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile @@ -49,12 +50,12 @@ internal class RouteProcessor( override fun process(resolver: Resolver): List { val symbols = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) - val unprocessed = symbols.filterNot { !it.validate() }.toList() + val unprocessed = symbols.filterNot { it.validate() }.toList() val routingFunctions = symbols .filter { it is KSFunctionDeclaration && it.validate() } .map { it as KSFunctionDeclaration } - validate(routingFunctions) + checkUsage(routingFunctions, logger) val declaringClasses = routingFunctions.declaringClasses() declaringClasses.forEach { (declaringClass, functions) -> @@ -97,8 +98,20 @@ internal class RouteProcessor( } @Suppress("UnusedReceiverParameter", "UNUSED_PARAMETER") -private fun RouteProcessor.validate(routingFunctions: Sequence) { - //TODO:2025-01-14:alexander.yevsyukov: +private fun RouteProcessor.checkUsage( + routingFunctions: Sequence, + logger: KSPLogger +) = routingFunctions.forEach { it.checkUsage(logger) } + +private fun KSFunctionDeclaration.checkUsage(logger: KSPLogger) { + val annotation = "`@Route`" + if (functionKind != FunctionKind.STATIC) { + val methodName = simpleName.getShortName() + logger.error( + "The method `$methodName()` annotated with $annotation must be `static`.", + this + ) + } } private fun Sequence.declaringClasses(): diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index 4eacb9fb1..c45aa95f5 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -31,6 +31,11 @@ import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERRO import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.spine.given.devices.Device +import io.spine.server.route.Route +import java.io.File +import kotlin.jvm.java import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName @@ -45,29 +50,53 @@ internal class RouteProcessorJavaErrorSpec { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() + val serverJar = File(Route::class.java.protectionDomain.codeSource.location.path) + val compiledProtos = File(Device::class.java.protectionDomain.codeSource.location.path) + + compilation.apply { + javaPackagePrefix = "io.spine.routing.given" + symbolProcessorProviders = listOf(RouteProcessorProvider()) + classpaths = classpaths + listOf( + serverJar, + compiledProtos + ) + } } @Test - fun `when non-static method annotated`() { + fun `when a non-static method is annotated`() { compilation.apply { - javaPackagePrefix = "io.spine.routing.given" sources = listOf(annotatedNonStatic) - symbolProcessorProviders = listOf(RouteProcessorProvider()) } val result = compilation.compile() result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "`route()`" // The name of the method in error. + it shouldContain "`@Route`" // The reference to the annotation. + it shouldContain "must be `static`." // The nature of the error. + } } } +private fun named(simpleName: String): String = "io/spine/given/devices/${simpleName}.java" + +@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") private val annotatedNonStatic = SourceFile.java( - "io/spine/routing/given/AnnotatedNonStatic.java", """ - package io.spine.routing.given; + named("AnnotatedNonStatic"), """ + package io.spine.given.devices; + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; import io.spine.server.route.Route; - class AnnotatedNonStatic { - + class AnnotatedNonStatic extends Projection { + + // Error: The method must be static. + @Route + DeviceId route(StatusReported event) { + return event.getDevice(); + } } """.trimIndent() ) From e6a919cb14f8679a87ef3bef509fcec90987f375 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 21 Jan 2025 14:35:16 +0000 Subject: [PATCH 19/96] Remove trailing spaces --- .../spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index c45aa95f5..3b9bcca49 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -97,6 +97,6 @@ private val annotatedNonStatic = SourceFile.java( DeviceId route(StatusReported event) { return event.getDevice(); } - } + } """.trimIndent() ) From 1f21121d475acafd2c56979d974055f99e49207b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 21 Jan 2025 19:01:32 +0000 Subject: [PATCH 20/96] Extract signature check into a class Also: * Extract obtaining classpath element by a class. --- .../tools/mc/java/routing/RouteProcessor.kt | 67 +++++++++++-------- .../tools/mc/java/routing/SignatureCheck.kt | 64 ++++++++++++++++++ .../routing/RouteProcessorJavaErrorSpec.kt | 9 ++- 3 files changed, 111 insertions(+), 29 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index bbcb5758c..bf0e9b0eb 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -31,7 +31,6 @@ import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.processing.SymbolProcessor -import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile @@ -49,21 +48,22 @@ internal class RouteProcessor( ) : SymbolProcessor { override fun process(resolver: Resolver): List { - val symbols = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) - val unprocessed = symbols.filterNot { it.validate() }.toList() - val routingFunctions = symbols - .filter { it is KSFunctionDeclaration && it.validate() } - .map { it as KSFunctionDeclaration } - - checkUsage(routingFunctions, logger) + val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) + val routingFunctions = filterAndGroup(allAnnotated) + routingFunctions.run { + checkUsage(logger) + generateCode() + } + val unprocessed = allAnnotated.filterNot { it.validate() }.toList() + return unprocessed + } - val declaringClasses = routingFunctions.declaringClasses() - declaringClasses.forEach { (declaringClass, functions) -> + private fun RoutingFunctions.generateCode() { + forEach { (declaringClass, functions) -> val visitor = RouteVisitor(functions) declaringClass.accept(visitor, Unit) visitor.writeFile() } - return unprocessed } private inner class RouteVisitor( @@ -97,24 +97,37 @@ internal class RouteProcessor( } } -@Suppress("UnusedReceiverParameter", "UNUSED_PARAMETER") -private fun RouteProcessor.checkUsage( - routingFunctions: Sequence, - logger: KSPLogger -) = routingFunctions.forEach { it.checkUsage(logger) } +/** + * Maps a class to the list of routing functions it declares. + */ +internal typealias RoutingFunctions = Map> -private fun KSFunctionDeclaration.checkUsage(logger: KSPLogger) { - val annotation = "`@Route`" - if (functionKind != FunctionKind.STATIC) { - val methodName = simpleName.getShortName() - logger.error( - "The method `$methodName()` annotated with $annotation must be `static`.", - this - ) - } +/** + * Filters all found annotated symbols to be valid instances of [KSFunctionDeclaration] and + * groups them by declaring classes. + */ +private fun filterAndGroup(allAnnotated: Sequence): RoutingFunctions { + val declarations = allAnnotated + .filter { it is KSFunctionDeclaration && it.validate() } + .map { it as KSFunctionDeclaration } + val routingFunctions = declarations.groupByClasses() + return routingFunctions } -private fun Sequence.declaringClasses(): - Map> = +/** + * Groups function declarations by declaring classes. + */ +private fun Sequence.groupByClasses(): RoutingFunctions = filter { it.parentDeclaration!! is KSClassDeclaration } .groupBy { it.parentDeclaration!! as KSClassDeclaration } + +/** + * Validates routing function declarations. + * + * @see SignatureCheck + */ +private fun RoutingFunctions.checkUsage(logger: KSPLogger) { + forEach { (declaringClass, functions) -> + SignatureCheck(declaringClass, functions, logger).apply() + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt new file mode 100644 index 000000000..78084e34d --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt @@ -0,0 +1,64 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.symbol.FunctionKind +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import io.spine.tools.mc.java.routing.SignatureCheck.Companion.annotationRef + +/** + * Verifies that all [functions] of the [declaringClass] satisfy the contract + * of the [@Route][io.spine.server.route.Route] annotation. + */ +internal class SignatureCheck( + @Suppress("unused") private val declaringClass: KSClassDeclaration, + private val functions: List, + private val logger: KSPLogger +) { + + fun apply() { + functions.forEach { it.checkUsage(logger) } + } + + @Suppress("ConstPropertyName") // https://bit.ly/kotlin-prop-names + internal companion object { + + const val annotationRef = "`@Route`" + } +} + +private fun KSFunctionDeclaration.checkUsage(logger: KSPLogger) { + if (functionKind != FunctionKind.STATIC) { + val methodName = simpleName.getShortName() + logger.error( + "The method `$methodName()` annotated with $annotationRef must be `static`.", + this + ) + } +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index 3b9bcca49..f62b49880 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -50,8 +50,8 @@ internal class RouteProcessorJavaErrorSpec { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() - val serverJar = File(Route::class.java.protectionDomain.codeSource.location.path) - val compiledProtos = File(Device::class.java.protectionDomain.codeSource.location.path) + val serverJar = Route::class.java.classpathFile() + val compiledProtos = Device::class.java.classpathFile() compilation.apply { javaPackagePrefix = "io.spine.routing.given" @@ -100,3 +100,8 @@ private val annotatedNonStatic = SourceFile.java( } """.trimIndent() ) + +/** + * Obtains the path to the classpath element which contains the receiver class. + */ +private fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.location.path) From afec8d816218398617f5289f9433284564d6a6d2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 22 Jan 2025 17:16:32 +0000 Subject: [PATCH 21/96] Separate processing of command- and event routing functions --- .../tools/mc/java/routing/RouteProcessor.kt | 63 ++-------- .../tools/mc/java/routing/RouteVisitor.kt | 118 ++++++++++++++++++ .../tools/mc/java/routing/SignatureCheck.kt | 47 +++++-- .../routing/RouteProcessorJavaErrorSpec.kt | 2 +- 4 files changed, 166 insertions(+), 64 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index bf0e9b0eb..0e392ddb0 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -27,19 +27,13 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.CodeGenerator -import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.symbol.KSAnnotated import com.google.devtools.ksp.symbol.KSClassDeclaration -import com.google.devtools.ksp.symbol.KSFile import com.google.devtools.ksp.symbol.KSFunctionDeclaration -import com.google.devtools.ksp.symbol.KSVisitorVoid import com.google.devtools.ksp.validate -import com.squareup.kotlinpoet.FileSpec -import com.squareup.kotlinpoet.TypeSpec -import com.squareup.kotlinpoet.ksp.writeTo import io.spine.server.route.Route internal class RouteProcessor( @@ -50,49 +44,19 @@ internal class RouteProcessor( override fun process(resolver: Resolver): List { val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val routingFunctions = filterAndGroup(allAnnotated) - routingFunctions.run { - checkUsage(logger) - generateCode() - } + routingFunctions.applyVisitors(resolver) val unprocessed = allAnnotated.filterNot { it.validate() }.toList() return unprocessed } - private fun RoutingFunctions.generateCode() { + private fun RoutingFunctions.applyVisitors(resolver: Resolver) { forEach { (declaringClass, functions) -> - val visitor = RouteVisitor(functions) - declaringClass.accept(visitor, Unit) - visitor.writeFile() - } - } - - private inner class RouteVisitor( - private val functions: List - ) : KSVisitorVoid() { - - private lateinit var packageName: String - private lateinit var originalFile: KSFile - private lateinit var routingClass: TypeSpec.Builder - - override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { - originalFile = classDeclaration.containingFile!! - packageName = originalFile.packageName.asString() - val className = classDeclaration.simpleName.asString() + "\$\$Routing" - routingClass = TypeSpec.classBuilder(className) - functions.forEach { it.accept(this, Unit) } - } - - override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { - //TODO:2025-01-14:alexander.yevsyukov: Implement - } - - fun writeFile() { - val cls = routingClass.build() - val code = FileSpec.builder(packageName, cls.name!!) - .addType(cls) - .build() - val deps = Dependencies(true, originalFile) - code.writeTo(codeGenerator, deps) + val crv = CommandRouteVisitor(functions, codeGenerator, resolver, logger) + declaringClass.accept(crv, Unit) + crv.writeFile() + val erv = EventRouteVisitor(functions, codeGenerator, resolver, logger) + declaringClass.accept(erv, Unit) + erv.writeFile() } } } @@ -120,14 +84,3 @@ private fun filterAndGroup(allAnnotated: Sequence): RoutingFunction private fun Sequence.groupByClasses(): RoutingFunctions = filter { it.parentDeclaration!! is KSClassDeclaration } .groupBy { it.parentDeclaration!! as KSClassDeclaration } - -/** - * Validates routing function declarations. - * - * @see SignatureCheck - */ -private fun RoutingFunctions.checkUsage(logger: KSPLogger) { - forEach { (declaringClass, functions) -> - SignatureCheck(declaringClass, functions, logger).apply() - } -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt new file mode 100644 index 000000000..ca92e954e --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -0,0 +1,118 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.CodeGenerator +import com.google.devtools.ksp.processing.Dependencies +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSFile +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSVisitorVoid +import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.ksp.writeTo + +internal sealed class RouteVisitor( + private val functions: List, + protected val codeGenerator: CodeGenerator, + protected val resolver: Resolver, + protected val logger: KSPLogger +) : KSVisitorVoid() { + + private lateinit var packageName: String + private lateinit var originalFile: KSFile + private lateinit var routingClass: TypeSpec.Builder + + protected abstract val classNameSuffix: String + + override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { + originalFile = classDeclaration.containingFile!! + packageName = originalFile.packageName.asString() + val className = classDeclaration.simpleName.asString() + classNameSuffix + routingClass = TypeSpec.Companion.classBuilder(className) + functions.forEach { it.accept(this, Unit) } + } + + protected abstract fun checkSignature(function: KSFunctionDeclaration) + protected abstract fun generateCode(function: KSFunctionDeclaration) + + override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { + checkSignature(function) + generateCode(function) + } + + fun writeFile() { + val cls = routingClass.build() + val code = FileSpec.Companion.builder(packageName, cls.name!!) + .addType(cls) + .build() + val deps = Dependencies(true, originalFile) + code.writeTo(codeGenerator, deps) + } +} + +internal class CommandRouteVisitor( + functions: List, + codeGenerator: CodeGenerator, + resolver: Resolver, + logger: KSPLogger +) : RouteVisitor(functions, codeGenerator, resolver, logger) { + + override val classNameSuffix: String = "$\$CommandRouting" + + override fun checkSignature(function: KSFunctionDeclaration) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } + + override fun generateCode(function: KSFunctionDeclaration) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } +} + +internal class EventRouteVisitor( + functions: List, + codeGenerator: CodeGenerator, + resolver: Resolver, + logger: KSPLogger +) : RouteVisitor(functions, codeGenerator, resolver, logger) { + + override val classNameSuffix: String = "$\$EventRouting" + + private val signatureCheck: EventRouteSignatureCheck by lazy { + EventRouteSignatureCheck(resolver, logger) + } + + override fun checkSignature(function: KSFunctionDeclaration) { + signatureCheck.apply(function) + } + + override fun generateCode(function: KSFunctionDeclaration) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt index 78084e34d..9ea633b98 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt @@ -27,23 +27,27 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSName +import com.google.devtools.ksp.symbol.KSType +import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import io.spine.tools.mc.java.routing.SignatureCheck.Companion.annotationRef /** - * Verifies that all [functions] of the [declaringClass] satisfy the contract + * Verifies that a function satisfies the contract * of the [@Route][io.spine.server.route.Route] annotation. */ -internal class SignatureCheck( - @Suppress("unused") private val declaringClass: KSClassDeclaration, - private val functions: List, - private val logger: KSPLogger +internal sealed class SignatureCheck( + protected val resolver: Resolver, + protected val logger: KSPLogger ) { - fun apply() { - functions.forEach { it.checkUsage(logger) } + @OverridingMethodsMustInvokeSuper + fun apply(function: KSFunctionDeclaration) { + function.checkIsStatic(logger) } @Suppress("ConstPropertyName") // https://bit.ly/kotlin-prop-names @@ -53,7 +57,7 @@ internal class SignatureCheck( } } -private fun KSFunctionDeclaration.checkUsage(logger: KSPLogger) { +private fun KSFunctionDeclaration.checkIsStatic(logger: KSPLogger) { if (functionKind != FunctionKind.STATIC) { val methodName = simpleName.getShortName() logger.error( @@ -62,3 +66,30 @@ private fun KSFunctionDeclaration.checkUsage(logger: KSPLogger) { ) } } + +@Suppress("unused") +internal class TypeCheck( + private val cls: Class<*>, + private val resolver: Resolver +) { + private val name: KSName by lazy { + resolver.getKSNameFromString(cls.canonicalName) + } + + private val type: KSType by lazy { + resolver.getClassDeclarationByName(name)!!.asStarProjectedType() + } + + fun isAssignableFrom(cls: KSClassDeclaration): Boolean { + return type.isAssignableFrom(cls.asStarProjectedType()) + } + + fun matches(cls: KSClassDeclaration): Boolean { + return cls.qualifiedName?.asString() == name.asString() + } +} + +internal class EventRouteSignatureCheck( + resolver: Resolver, + logger: KSPLogger +) : SignatureCheck(resolver, logger) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index f62b49880..bc6b79f40 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -73,7 +73,7 @@ internal class RouteProcessorJavaErrorSpec { result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "`route()`" // The name of the method in error. - it shouldContain "`@Route`" // The reference to the annotation. + it shouldContain SignatureCheck.annotationRef it shouldContain "must be `static`." // The nature of the error. } } From e7409d5efe158f828b04f5d48f05dc89669dd40c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 22 Jan 2025 21:24:05 +0000 Subject: [PATCH 22/96] Pre-process declared functions --- .../mc/java/routing/CommandRouteSignature.kt | 60 ++++++++ .../mc/java/routing/EventRouteSignature.kt | 60 ++++++++ .../spine/tools/mc/java/routing/RouteFun.kt | 39 +++++ .../tools/mc/java/routing/RouteProcessor.kt | 53 ++++--- .../tools/mc/java/routing/RouteSignature.kt | 145 ++++++++++++++++++ .../tools/mc/java/routing/RouteVisitor.kt | 28 +--- .../{SignatureCheck.kt => TypeCheck.kt} | 41 ----- .../tools/mc/java/routing/ErrorSpecExts.kt | 50 ++++++ .../routing/RouteProcessorJavaErrorSpec.kt | 14 +- .../routing/RouteProcessorKotlinErrorSpec.kt | 93 +++++++++++ 10 files changed, 483 insertions(+), 100 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{SignatureCheck.kt => TypeCheck.kt} (61%) create mode 100644 mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt create mode 100644 mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt new file mode 100644 index 000000000..7ead82c93 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import io.spine.base.CommandMessage +import io.spine.core.CommandContext + +internal class CommandRouteSignature( + resolver: Resolver, + logger: KSPLogger +) : RouteSignature( + CommandMessage::class.java, + CommandContext::class.java, + resolver, + logger +) { + override fun parametersMatch(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement + return false + } + + override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement + return false + } + + override fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + return false + } + + override fun create(fn: KSFunctionDeclaration): CommandRouteFun = CommandRouteFun(fn) +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt new file mode 100644 index 000000000..9ed5fe881 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -0,0 +1,60 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import io.spine.base.EventMessage +import io.spine.core.EventContext + +internal class EventRouteSignature( + resolver: Resolver, logger: KSPLogger +) : RouteSignature( + EventMessage::class.java, + EventContext::class.java, + resolver, + logger +) { + + override fun parametersMatch(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement + return false + } + + override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement + return false + } + + override fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + return false + } + + override fun create(fn: KSFunctionDeclaration): EventRouteFun = EventRouteFun(fn) +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt new file mode 100644 index 000000000..926ddbd45 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -0,0 +1,39 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.symbol.KSFunctionDeclaration + +internal sealed class RouteFun( + internal val fn: KSFunctionDeclaration +) + +internal class CommandRouteFun(fn: KSFunctionDeclaration) : RouteFun(fn) { +} + +internal class EventRouteFun(fn: KSFunctionDeclaration) : RouteFun(fn) { +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 0e392ddb0..4d368864c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -43,17 +43,37 @@ internal class RouteProcessor( override fun process(resolver: Resolver): List { val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) - val routingFunctions = filterAndGroup(allAnnotated) - routingFunctions.applyVisitors(resolver) + val allValid = allAnnotated.filter { it.validate() } + .map { it as KSFunctionDeclaration } + + val qualified = RouteSignature.qualify(allValid, resolver, logger) + processCommands(qualified, resolver) + processEvents(qualified, resolver) + val unprocessed = allAnnotated.filterNot { it.validate() }.toList() return unprocessed } - private fun RoutingFunctions.applyVisitors(resolver: Resolver) { - forEach { (declaringClass, functions) -> + private fun processCommands( + qualified: Sequence, + resolver: Resolver + ) { + val commandRouting = qualified.filterIsInstance() + val commandRoutingGrouped = commandRouting.groupByClasses() + commandRoutingGrouped.forEach { (declaringClass, functions) -> val crv = CommandRouteVisitor(functions, codeGenerator, resolver, logger) declaringClass.accept(crv, Unit) crv.writeFile() + } + } + + private fun processEvents( + qualified: Sequence, + resolver: Resolver + ) { + val eventRouting = qualified.filterIsInstance() + val eventRoutingGrouped = eventRouting.groupByClasses() + eventRoutingGrouped.forEach { (declaringClass, functions) -> val erv = EventRouteVisitor(functions, codeGenerator, resolver, logger) declaringClass.accept(erv, Unit) erv.writeFile() @@ -61,26 +81,5 @@ internal class RouteProcessor( } } -/** - * Maps a class to the list of routing functions it declares. - */ -internal typealias RoutingFunctions = Map> - -/** - * Filters all found annotated symbols to be valid instances of [KSFunctionDeclaration] and - * groups them by declaring classes. - */ -private fun filterAndGroup(allAnnotated: Sequence): RoutingFunctions { - val declarations = allAnnotated - .filter { it is KSFunctionDeclaration && it.validate() } - .map { it as KSFunctionDeclaration } - val routingFunctions = declarations.groupByClasses() - return routingFunctions -} - -/** - * Groups function declarations by declaring classes. - */ -private fun Sequence.groupByClasses(): RoutingFunctions = - filter { it.parentDeclaration!! is KSClassDeclaration } - .groupBy { it.parentDeclaration!! as KSClassDeclaration } +private fun Sequence.groupByClasses(): Map> = + groupBy { it.fn.parentDeclaration!! as KSClassDeclaration } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt new file mode 100644 index 000000000..6660ca1fc --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -0,0 +1,145 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.FunctionKind +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import io.spine.base.SignalMessage +import io.spine.core.SignalContext +import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef +import kotlin.sequences.forEach + +internal sealed class RouteSignature( + protected val signalClass: Class, + protected val contextClass: Class, + protected val resolver: Resolver, + protected val logger: KSPLogger +) { + protected abstract fun parametersMatch(fn: KSFunctionDeclaration): Boolean + protected abstract fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean + protected abstract fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean + protected abstract fun create(fn: KSFunctionDeclaration): F + + fun match(fn: KSFunctionDeclaration): F? { + if (!parametersMatch(fn)) { + return null + } + if (!returnTypeMatches(fn)) { + return null + } + if (!declarationSiteMatches(fn)) { + return null + } + return create(fn) + } + + @Suppress("ConstPropertyName") // https://bit.ly/kotlin-prop-names + companion object { + + const val annotationRef = "`@Route`" + + fun qualify( + functions: Sequence, + resolver: Resolver, + logger: KSPLogger + ): Sequence { + val qualifier = Qualifier(functions, resolver, logger) + return qualifier.run() + } + } +} + +private class Qualifier( + private val functions: Sequence, + resolver: Resolver, + private val logger: KSPLogger +) { + private var errors = false + private val cmd = CommandRouteSignature(resolver, logger) + private val evt = EventRouteSignature(resolver, logger) + + fun run(): Sequence { + val result = sequence { + functions.forEach { fn -> + if (fn.commonChecks(logger)) { + qualify(fn) + } else { + errors = true + } + } + } + if (errors) { + error("Errors using $annotationRef.") + } + return result + } + + private suspend fun SequenceScope.qualify(fn: KSFunctionDeclaration) { + cmd.match(fn)?.let { + yield(it) + } ?: evt.match(fn)?.let { + yield(it) + } ?: run { + logger.error( + "The function `${fn.qualifiedName}`" + + " does not match the $annotationRef contract." + ) + errors = true + } + } +} + +private fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean = + isStatic(logger) && declaredInAClass(logger) + +private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { + val isStatic = functionKind == FunctionKind.STATIC + if (!isStatic) { + val methodName = simpleName.getShortName() + logger.error( + "The method `$methodName()` annotated with $annotationRef must be `static`.", + this + ) + } + return isStatic +} + +private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { + val inClass = parentDeclaration is KSClassDeclaration + if (!inClass) { + val name = simpleName.getShortName() + logger.error( + "The function `$name()` annotated with $annotationRef must be " + + "a method of a companion object of an entity class.", + this + ) + } + return inClass +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index ca92e954e..65bea2504 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -38,8 +38,8 @@ import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.TypeSpec import com.squareup.kotlinpoet.ksp.writeTo -internal sealed class RouteVisitor( - private val functions: List, +internal sealed class RouteVisitor( + private val functions: List, protected val codeGenerator: CodeGenerator, protected val resolver: Resolver, protected val logger: KSPLogger @@ -56,14 +56,12 @@ internal sealed class RouteVisitor( packageName = originalFile.packageName.asString() val className = classDeclaration.simpleName.asString() + classNameSuffix routingClass = TypeSpec.Companion.classBuilder(className) - functions.forEach { it.accept(this, Unit) } + functions.forEach { it.fn.accept(this, Unit) } } - protected abstract fun checkSignature(function: KSFunctionDeclaration) protected abstract fun generateCode(function: KSFunctionDeclaration) override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { - checkSignature(function) generateCode(function) } @@ -78,40 +76,28 @@ internal sealed class RouteVisitor( } internal class CommandRouteVisitor( - functions: List, + functions: List, codeGenerator: CodeGenerator, resolver: Resolver, logger: KSPLogger -) : RouteVisitor(functions, codeGenerator, resolver, logger) { +) : RouteVisitor(functions, codeGenerator, resolver, logger) { override val classNameSuffix: String = "$\$CommandRouting" - override fun checkSignature(function: KSFunctionDeclaration) { - //TODO:2025-01-22:alexander.yevsyukov: Implement. - } - override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } internal class EventRouteVisitor( - functions: List, + functions: List, codeGenerator: CodeGenerator, resolver: Resolver, logger: KSPLogger -) : RouteVisitor(functions, codeGenerator, resolver, logger) { +) : RouteVisitor(functions, codeGenerator, resolver, logger) { override val classNameSuffix: String = "$\$EventRouting" - private val signatureCheck: EventRouteSignatureCheck by lazy { - EventRouteSignatureCheck(resolver, logger) - } - - override fun checkSignature(function: KSFunctionDeclaration) { - signatureCheck.apply(function) - } - override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt similarity index 61% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt index 9ea633b98..1595a6674 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/SignatureCheck.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt @@ -26,46 +26,10 @@ package io.spine.tools.mc.java.routing -import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver -import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration -import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSName import com.google.devtools.ksp.symbol.KSType -import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper -import io.spine.tools.mc.java.routing.SignatureCheck.Companion.annotationRef - -/** - * Verifies that a function satisfies the contract - * of the [@Route][io.spine.server.route.Route] annotation. - */ -internal sealed class SignatureCheck( - protected val resolver: Resolver, - protected val logger: KSPLogger -) { - - @OverridingMethodsMustInvokeSuper - fun apply(function: KSFunctionDeclaration) { - function.checkIsStatic(logger) - } - - @Suppress("ConstPropertyName") // https://bit.ly/kotlin-prop-names - internal companion object { - - const val annotationRef = "`@Route`" - } -} - -private fun KSFunctionDeclaration.checkIsStatic(logger: KSPLogger) { - if (functionKind != FunctionKind.STATIC) { - val methodName = simpleName.getShortName() - logger.error( - "The method `$methodName()` annotated with $annotationRef must be `static`.", - this - ) - } -} @Suppress("unused") internal class TypeCheck( @@ -88,8 +52,3 @@ internal class TypeCheck( return cls.qualifiedName?.asString() == name.asString() } } - -internal class EventRouteSignatureCheck( - resolver: Resolver, - logger: KSPLogger -) : SignatureCheck(resolver, logger) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt new file mode 100644 index 000000000..f4cbc9238 --- /dev/null +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import java.io.File + +/** + * Obtains the path to the classpath element which contains the receiver class. + */ +internal fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.location.path) + +/** + * The package directory is `io/spine/given/devices/` which matches the options of + * proto types defined under `test/proto/given/devices/`. + */ +private val packageDir = "io/spine/given/devices" + +/** + * Obtains a file name with the package directories for a Java class with the given simple name. + */ +internal fun javaFile(simpleName: String): String = "$packageDir/${simpleName}.java" + +/** + * Obtains a file name with the package directories for a Kotlin file with the given name. + */ +internal fun kotlinFile(simpleName: String): String = "$packageDir/${simpleName}.kt" diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index bc6b79f40..0fe3501de 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -34,8 +34,7 @@ import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import io.spine.given.devices.Device import io.spine.server.route.Route -import java.io.File -import kotlin.jvm.java +import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName @@ -73,17 +72,15 @@ internal class RouteProcessorJavaErrorSpec { result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "`route()`" // The name of the method in error. - it shouldContain SignatureCheck.annotationRef + it shouldContain annotationRef it shouldContain "must be `static`." // The nature of the error. } } } -private fun named(simpleName: String): String = "io/spine/given/devices/${simpleName}.java" - @Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") private val annotatedNonStatic = SourceFile.java( - named("AnnotatedNonStatic"), """ + javaFile("AnnotatedNonStatic"), """ package io.spine.given.devices; import io.spine.given.devices.events.StatusReported; @@ -100,8 +97,3 @@ private val annotatedNonStatic = SourceFile.java( } """.trimIndent() ) - -/** - * Obtains the path to the classpath element which contains the receiver class. - */ -private fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.location.path) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt new file mode 100644 index 000000000..fa8808669 --- /dev/null +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt @@ -0,0 +1,93 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.tschuchort.compiletesting.KotlinCompilation +import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR +import com.tschuchort.compiletesting.SourceFile +import com.tschuchort.compiletesting.symbolProcessorProviders +import io.kotest.matchers.shouldBe +import io.kotest.matchers.string.shouldContain +import io.spine.given.devices.Device +import io.spine.server.route.Route +import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef +import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +@ExperimentalCompilerApi +@DisplayName("`RouteProcessor` should detect Kotlin code errors") +internal class RouteProcessorKotlinErrorSpec { + + private lateinit var compilation: KotlinCompilation + + @BeforeEach + fun prepareCompilation() { + compilation = KotlinCompilation() + val serverJar = Route::class.java.classpathFile() + val compiledProtos = Device::class.java.classpathFile() + + compilation.apply { + javaPackagePrefix = "io.spine.routing.given" + symbolProcessorProviders = listOf(RouteProcessorProvider()) + classpaths = classpaths + listOf( + serverJar, + compiledProtos + ) + } + } + + @Test + fun `when a function is defined on a file level`() { + compilation.apply { + sources = listOf(fileLevelFunction) + } + + val result = compilation.compile() + + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "`route()`" // The name of the function in error. + it shouldContain annotationRef + it shouldContain "must be a `static` member of an entity class." // The nature of the error. + } + } +} + +private val fileLevelFunction = SourceFile.kotlin( + kotlinFile("FileLevelFunction"), """ + package io.spine.given.devices + + import io.spine.base.EventMessage + import io.spine.server.route.Route + + // Error: The function must be a static method of a class. + @Route + private fun route(e: EventMessage): String = "Hello" + """.trimIndent() +) From 7a1bd40075d94ef2088ea84dba220fd7c33fc199 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 22 Jan 2025 21:24:20 +0000 Subject: [PATCH 23/96] Auto-updated by IDEA --- .idea/inspectionProfiles/Project_Default.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index b09173471..312610353 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -867,6 +867,7 @@ + - + \ No newline at end of file From 33ccdc3bcad955c92642307160f97d676f3beb50 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 15:43:53 +0000 Subject: [PATCH 24/96] Check routing function is a class member --- .../tools/mc/java/routing/RouteProcessor.kt | 21 ++++------ .../tools/mc/java/routing/RouteSignature.kt | 41 +++++++++++-------- .../routing/RouteProcessorJavaErrorSpec.kt | 4 +- .../routing/RouteProcessorKotlinErrorSpec.kt | 11 +++-- 4 files changed, 42 insertions(+), 35 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 4d368864c..79466c46f 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -38,26 +38,26 @@ import io.spine.server.route.Route internal class RouteProcessor( private val codeGenerator: CodeGenerator, - @Suppress("unused") internal val logger: KSPLogger + internal val logger: KSPLogger ) : SymbolProcessor { + private lateinit var resolver: Resolver + override fun process(resolver: Resolver): List { + this.resolver = resolver val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } val qualified = RouteSignature.qualify(allValid, resolver, logger) - processCommands(qualified, resolver) - processEvents(qualified, resolver) + processCommands(qualified) + processEvents(qualified) val unprocessed = allAnnotated.filterNot { it.validate() }.toList() return unprocessed } - private fun processCommands( - qualified: Sequence, - resolver: Resolver - ) { + private fun processCommands(qualified: List) { val commandRouting = qualified.filterIsInstance() val commandRoutingGrouped = commandRouting.groupByClasses() commandRoutingGrouped.forEach { (declaringClass, functions) -> @@ -67,10 +67,7 @@ internal class RouteProcessor( } } - private fun processEvents( - qualified: Sequence, - resolver: Resolver - ) { + private fun processEvents(qualified: List) { val eventRouting = qualified.filterIsInstance() val eventRoutingGrouped = eventRouting.groupByClasses() eventRoutingGrouped.forEach { (declaringClass, functions) -> @@ -81,5 +78,5 @@ internal class RouteProcessor( } } -private fun Sequence.groupByClasses(): Map> = +private fun List.groupByClasses(): Map> = groupBy { it.fn.parentDeclaration!! as KSClassDeclaration } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 6660ca1fc..75134e2c9 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -33,7 +33,10 @@ import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import io.spine.base.SignalMessage import io.spine.core.SignalContext -import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef +import io.spine.server.route.Route +import io.spine.string.simply +import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import kotlin.sequences.forEach internal sealed class RouteSignature( @@ -60,16 +63,16 @@ internal sealed class RouteSignature( return create(fn) } - @Suppress("ConstPropertyName") // https://bit.ly/kotlin-prop-names companion object { - const val annotationRef = "`@Route`" + val routeRef by lazy { "`@${simply()}`" } + val jvmStaticRef by lazy { "`@${simply()}`" } fun qualify( functions: Sequence, resolver: Resolver, logger: KSPLogger - ): Sequence { + ): List { val qualifier = Qualifier(functions, resolver, logger) return qualifier.run() } @@ -85,46 +88,47 @@ private class Qualifier( private val cmd = CommandRouteSignature(resolver, logger) private val evt = EventRouteSignature(resolver, logger) - fun run(): Sequence { - val result = sequence { + fun run(): List { + val result = buildList { functions.forEach { fn -> if (fn.commonChecks(logger)) { - qualify(fn) - } else { - errors = true + qualify(fn)?.let { + add(it) + } } } } if (errors) { - error("Errors using $annotationRef.") + error("Errors using $routeRef.") } return result } - private suspend fun SequenceScope.qualify(fn: KSFunctionDeclaration) { + private fun qualify(fn: KSFunctionDeclaration): RouteFun? { cmd.match(fn)?.let { - yield(it) + return it } ?: evt.match(fn)?.let { - yield(it) + return it } ?: run { logger.error( "The function `${fn.qualifiedName}`" + - " does not match the $annotationRef contract." + " does not match the $routeRef contract." ) errors = true + return null } } } private fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean = - isStatic(logger) && declaredInAClass(logger) + declaredInAClass(logger) && isStatic(logger) private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { val isStatic = functionKind == FunctionKind.STATIC if (!isStatic) { val methodName = simpleName.getShortName() logger.error( - "The method `$methodName()` annotated with $annotationRef must be `static`.", + "The method `$methodName()` annotated with $routeRef must be `static`.", this ) } @@ -136,8 +140,9 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { if (!inClass) { val name = simpleName.getShortName() logger.error( - "The function `$name()` annotated with $annotationRef must be " + - "a method of a companion object of an entity class.", + "The function `$name()` annotated with $routeRef must be" + + " a method of a companion object of an entity class" + + " annotated with $jvmStaticRef.", this ) } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index 0fe3501de..05c09f535 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -34,7 +34,7 @@ import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain import io.spine.given.devices.Device import io.spine.server.route.Route -import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName @@ -72,7 +72,7 @@ internal class RouteProcessorJavaErrorSpec { result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "`route()`" // The name of the method in error. - it shouldContain annotationRef + it shouldContain routeRef it shouldContain "must be `static`." // The nature of the error. } } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt index fa8808669..9d65f03e8 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt @@ -32,9 +32,11 @@ import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain +import io.spine.base.EventMessage import io.spine.given.devices.Device import io.spine.server.route.Route -import io.spine.tools.mc.java.routing.RouteSignature.Companion.annotationRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName @@ -49,6 +51,7 @@ internal class RouteProcessorKotlinErrorSpec { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() + val baseJar = EventMessage::class.java.classpathFile() val serverJar = Route::class.java.classpathFile() val compiledProtos = Device::class.java.classpathFile() @@ -56,6 +59,7 @@ internal class RouteProcessorKotlinErrorSpec { javaPackagePrefix = "io.spine.routing.given" symbolProcessorProviders = listOf(RouteProcessorProvider()) classpaths = classpaths + listOf( + baseJar, serverJar, compiledProtos ) @@ -73,8 +77,9 @@ internal class RouteProcessorKotlinErrorSpec { result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "`route()`" // The name of the function in error. - it shouldContain annotationRef - it shouldContain "must be a `static` member of an entity class." // The nature of the error. + it shouldContain routeRef + it shouldContain "a method of a companion object of an entity class" // The nature of the error. + it shouldContain jvmStaticRef } } } From 3cc1e4854f9f91ce9c29fe56c5daa7e64e6b31ce Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 16:08:52 +0000 Subject: [PATCH 25/96] Use Kotlin-specific error for non-static routing function --- .../tools/mc/java/routing/RouteSignature.kt | 9 ++- .../routing/RouteProcessorKotlinErrorSpec.kt | 80 ++++++++++++++++++- 2 files changed, 86 insertions(+), 3 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 75134e2c9..215e39e3c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -31,13 +31,13 @@ import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.Origin.KOTLIN import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef -import kotlin.sequences.forEach internal sealed class RouteSignature( protected val signalClass: Class, @@ -128,7 +128,12 @@ private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { if (!isStatic) { val methodName = simpleName.getShortName() logger.error( - "The method `$methodName()` annotated with $routeRef must be `static`.", + if (origin == KOTLIN) { + "The function `$methodName()` annotated with $routeRef must be" + + " a member of a companion object and annotated with $jvmStaticRef." + } else { + "The method `$methodName()` annotated with $routeRef must be `static`." + }, this ) } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt index 9d65f03e8..e7a5c23bb 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt @@ -78,7 +78,42 @@ internal class RouteProcessorKotlinErrorSpec { result.messages.let { it shouldContain "`route()`" // The name of the function in error. it shouldContain routeRef - it shouldContain "a method of a companion object of an entity class" // The nature of the error. + it shouldContain "a method of a companion object of an entity class" + it shouldContain jvmStaticRef + } + } + + @Test + fun `when a function is not 'JvmStatic''`() { + compilation.apply { + sources = listOf(notJvmStatic) + } + + val result = compilation.compile() + + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "`route()`" // The name of the function in error. + it shouldContain routeRef + it shouldContain "a member of a companion object and annotated with" + it shouldContain jvmStaticRef + } + } + + @Test + fun `when a function is not a member of a companion object`() { + compilation.apply { + sources = listOf(notCompanionMember) + } + + val result = compilation.compile() + + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "`route()`" // The name of the function in error. + it shouldContain routeRef + // The error is the same as for not annotated as `JvmStatic`. + it shouldContain "a member of a companion object and annotated with" it shouldContain jvmStaticRef } } @@ -96,3 +131,46 @@ private val fileLevelFunction = SourceFile.kotlin( private fun route(e: EventMessage): String = "Hello" """.trimIndent() ) + +@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") +private val notJvmStatic = SourceFile.kotlin( + kotlinFile("NotJvmStatic"), """ + package io.spine.given.devices + + import io.spine.given.devices.events.StatusReported + import io.spine.server.projection.Projection + import io.spine.server.route.Route + + class NotJvmStatic : Projection() { + + companion object { + + // Error: The method must be annotated as `JvmStatic`. + @Route + fun route(e: StatusReported): DeviceId { + return event.getDevice() + } + } + } + """.trimIndent() +) + +@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") +private val notCompanionMember = SourceFile.kotlin( + kotlinFile("NotCompanionMember"), """ + package io.spine.given.devices + + import io.spine.given.devices.events.StatusReported + import io.spine.server.projection.Projection + import io.spine.server.route.Route + + class NotCompanionMember : Projection() { + + // Error: The method must belong to a companion object. + @Route + fun route(e: StatusReported): DeviceId { + return event.getDevice() + } + } + """.trimIndent() +) From ff62fb2ccc148541d199c153117b89bee423cafe Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 16:15:35 +0000 Subject: [PATCH 26/96] Improve language about functions in Kotlin --- .../kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt | 2 +- .../tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 215e39e3c..d741dcefd 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -146,7 +146,7 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { val name = simpleName.getShortName() logger.error( "The function `$name()` annotated with $routeRef must be" + - " a method of a companion object of an entity class" + + " a member of a companion object of an entity class" + " annotated with $jvmStaticRef.", this ) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt index e7a5c23bb..1db0ad158 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt @@ -78,7 +78,7 @@ internal class RouteProcessorKotlinErrorSpec { result.messages.let { it shouldContain "`route()`" // The name of the function in error. it shouldContain routeRef - it shouldContain "a method of a companion object of an entity class" + it shouldContain "a member of a companion object of an entity class" it shouldContain jvmStaticRef } } From 7a8e2c079ea4141ee2c022ae5dd4959879fdfb40 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 16:57:11 +0000 Subject: [PATCH 27/96] Simplify diagnostics depending on declaration origin --- .../main/kotlin/KSFunctionDeclarationExts.kt | 52 +++++++++++++++++++ .../tools/mc/java/routing/RouteSignature.kt | 30 +++++++---- 2 files changed, 72 insertions(+), 10 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/KSFunctionDeclarationExts.kt diff --git a/mc-java-routing/src/main/kotlin/KSFunctionDeclarationExts.kt b/mc-java-routing/src/main/kotlin/KSFunctionDeclarationExts.kt new file mode 100644 index 000000000..61ace9641 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/KSFunctionDeclarationExts.kt @@ -0,0 +1,52 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.Origin.JAVA +import com.google.devtools.ksp.symbol.Origin.JAVA_LIB + +/** + * Selects either diagnostic message depending on + * the [origin][KSFunctionDeclaration.origin] of the declaration. + * + * For origins [JAVA] and [JAVA_LIB] the value of the [java] parameter is returned. + * Otherwise, the [kotlin] string is returned. + */ +internal fun KSFunctionDeclaration.msg(kotlin: String, java: String): String = + if (origin == JAVA || origin == JAVA_LIB) { + java + } else { + kotlin + } + +/** + * Obtains the text for referencing this function in a diagnostic message. + */ +internal val KSFunctionDeclaration.funRef: String + get() { + val shortRef = "`${simpleName.getShortName()}()`" + return msg("function $shortRef", "method $shortRef") + } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index d741dcefd..05d54146f 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -31,14 +31,18 @@ import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration -import com.google.devtools.ksp.symbol.Origin.KOTLIN import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import msg +import funRef +/** + * The base class for classes checking the contract of the functions with the [Route] annotation. + */ internal sealed class RouteSignature( protected val signalClass: Class, protected val contextClass: Class, @@ -79,6 +83,13 @@ internal sealed class RouteSignature( } } +/** + * The helper class which transforms the incoming sequence with [functions] into + * a list containing [CommandRouteFun] or [EventRouteFun]. + * + * If a function is not recognized to be one of these types, + * the compilation terminates with an error. + */ private class Qualifier( private val functions: Sequence, resolver: Resolver, @@ -111,7 +122,7 @@ private class Qualifier( return it } ?: run { logger.error( - "The function `${fn.qualifiedName}`" + + "The function `${fn.qualifiedName?.asString()}`" + " does not match the $routeRef contract." ) errors = true @@ -126,14 +137,12 @@ private fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean = private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { val isStatic = functionKind == FunctionKind.STATIC if (!isStatic) { - val methodName = simpleName.getShortName() - logger.error( - if (origin == KOTLIN) { - "The function `$methodName()` annotated with $routeRef must be" + - " a member of a companion object and annotated with $jvmStaticRef." - } else { - "The method `$methodName()` annotated with $routeRef must be `static`." - }, + logger.error(msg( + "The $funRef annotated with $routeRef must be" + + " a member of a companion object and annotated with $jvmStaticRef.", + + "The $funRef annotated with $routeRef must be `static`." + ), this ) } @@ -144,6 +153,7 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { val inClass = parentDeclaration is KSClassDeclaration if (!inClass) { val name = simpleName.getShortName() + // This case is Kotlin-only because in Java a function would belong to a class. logger.error( "The function `$name()` annotated with $routeRef must be" + " a member of a companion object of an entity class" + From 37fbc1955a3a86588dce52d3d3e17a9c07520543 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 17:39:07 +0000 Subject: [PATCH 28/96] Check the number of parameters --- .../tools/mc/java/routing/RouteSignature.kt | 22 ++++- .../routing/RouteProcessorJavaErrorSpec.kt | 93 +++++++++++++++++-- 2 files changed, 102 insertions(+), 13 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 05d54146f..aefff6f2b 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -122,8 +122,7 @@ private class Qualifier( return it } ?: run { logger.error( - "The function `${fn.qualifiedName?.asString()}`" + - " does not match the $routeRef contract." + "The ${fn.funRef} does not match the $routeRef contract.", fn ) errors = true return null @@ -132,7 +131,9 @@ private class Qualifier( } private fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean = - declaredInAClass(logger) && isStatic(logger) + declaredInAClass(logger) + && isStatic(logger) + && acceptsOneOrTwoParameters(logger) private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { val isStatic = functionKind == FunctionKind.STATIC @@ -152,10 +153,9 @@ private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { val inClass = parentDeclaration is KSClassDeclaration if (!inClass) { - val name = simpleName.getShortName() // This case is Kotlin-only because in Java a function would belong to a class. logger.error( - "The function `$name()` annotated with $routeRef must be" + + "The $funRef annotated with $routeRef must be" + " a member of a companion object of an entity class" + " annotated with $jvmStaticRef.", this @@ -163,3 +163,15 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { } return inClass } + +private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): Boolean { + val wrongNumber = parameters.isEmpty() || parameters.size > 2 + if (wrongNumber) { + logger.error( + "The $funRef annotated with $routeRef must accept one or two parameters. " + + "Encountered: ${parameters.size}.", + this + ) + } + return !wrongNumber +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index 05c09f535..3be10fb49 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -24,6 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +@file:Suppress( + "ClassNameDiffersFromFileName" /* false positive in IDEA */, + "MissingPackageInfo" /* don't need them for these tests. */ +) + package io.spine.tools.mc.java.routing import com.tschuchort.compiletesting.KotlinCompilation @@ -32,6 +37,7 @@ import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain +import io.spine.core.EventContext import io.spine.given.devices.Device import io.spine.server.route.Route import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef @@ -49,6 +55,7 @@ internal class RouteProcessorJavaErrorSpec { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() + val coreJar = EventContext::class.java.classpathFile() val serverJar = Route::class.java.classpathFile() val compiledProtos = Device::class.java.classpathFile() @@ -56,6 +63,7 @@ internal class RouteProcessorJavaErrorSpec { javaPackagePrefix = "io.spine.routing.given" symbolProcessorProviders = listOf(RouteProcessorProvider()) classpaths = classpaths + listOf( + coreJar, serverJar, compiledProtos ) @@ -65,31 +73,59 @@ internal class RouteProcessorJavaErrorSpec { @Test fun `when a non-static method is annotated`() { compilation.apply { - sources = listOf(annotatedNonStatic) + sources = listOf(nonStatic) } val result = compilation.compile() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { - it shouldContain "`route()`" // The name of the method in error. + it shouldContain "The method `route()`" // The name of the method in error. it shouldContain routeRef it shouldContain "must be `static`." // The nature of the error. } } + + @Test + fun `when no parameters are specified`() { + compilation.apply { + sources = listOf(noParameters) + } + val result = compilation.compile() + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "The method `route()`" // The name of the method in error. + it shouldContain routeRef + it shouldContain "one or two parameters. Encountered: 0." + } + } + + @Test + fun `when too many parameters are specified`() { + compilation.apply { + sources = listOf(tooManyParameters) + } + val result = compilation.compile() + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "The method `route()`" // The name of the method in error. + it shouldContain routeRef + it shouldContain "one or two parameters. Encountered: 3." + } + } } -@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") -private val annotatedNonStatic = SourceFile.java( - javaFile("AnnotatedNonStatic"), """ +/** + * Error: non-static method. + */ +private val nonStatic = SourceFile.java( + javaFile("NonStatic"), """ package io.spine.given.devices; import io.spine.given.devices.events.StatusReported; import io.spine.server.projection.Projection; import io.spine.server.route.Route; - class AnnotatedNonStatic extends Projection { - - // Error: The method must be static. + class NonStatic extends Projection { @Route DeviceId route(StatusReported event) { return event.getDevice(); @@ -97,3 +133,44 @@ private val annotatedNonStatic = SourceFile.java( } """.trimIndent() ) + +/** + * Error: no parameters. + */ +private val noParameters = SourceFile.java( + javaFile("NoParameters"), """ + package io.spine.given.devices; + + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class NoParameters extends Projection { + @Route + static DeviceId route() { + return DeviceId.generate(); + } + } + """.trimIndent() +) + +/** + * Error: too many parameters. + */ +private val tooManyParameters = SourceFile.java( + javaFile("TooManyParameters"), """ + package io.spine.given.devices; + + import io.spine.core.EventContext; + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class TooManyParameters extends Projection { + @Route + static DeviceId route(StatusReported event, EventContext context, Object other) { + return event.getDevice(); + } + } + """.trimIndent() +) From 6c350a5a98eb39e014642eca10c21e14f77c16e9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 17:50:02 +0000 Subject: [PATCH 29/96] Simplify docs and suppressions --- .../routing/RouteProcessorKotlinErrorSpec.kt | 25 ++++++++++++------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt index 1db0ad158..78805d8f7 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt @@ -24,6 +24,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +@file:Suppress( + "ClassNameDiffersFromFileName" /* false positive in IDEA */, + "MissingPackageInfo" /* don't need them for these tests. */ +) + package io.spine.tools.mc.java.routing import com.tschuchort.compiletesting.KotlinCompilation @@ -119,6 +124,9 @@ internal class RouteProcessorKotlinErrorSpec { } } +/** + * Error: The function must be a static method of a class. + */ private val fileLevelFunction = SourceFile.kotlin( kotlinFile("FileLevelFunction"), """ package io.spine.given.devices @@ -126,26 +134,25 @@ private val fileLevelFunction = SourceFile.kotlin( import io.spine.base.EventMessage import io.spine.server.route.Route - // Error: The function must be a static method of a class. @Route private fun route(e: EventMessage): String = "Hello" """.trimIndent() ) -@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") +/** + * Error: The method must be annotated as `JvmStatic`. + */ private val notJvmStatic = SourceFile.kotlin( kotlinFile("NotJvmStatic"), """ package io.spine.given.devices - import io.spine.given.devices.events.StatusReported + import io.spine.given.devices.events.StatusReported import io.spine.server.projection.Projection import io.spine.server.route.Route class NotJvmStatic : Projection() { companion object { - - // Error: The method must be annotated as `JvmStatic`. @Route fun route(e: StatusReported): DeviceId { return event.getDevice() @@ -155,18 +162,18 @@ private val notJvmStatic = SourceFile.kotlin( """.trimIndent() ) -@Suppress("ClassNameDiffersFromFileName", "MissingPackageInfo") +/** + * Error: The method must belong to a companion object. + */ private val notCompanionMember = SourceFile.kotlin( kotlinFile("NotCompanionMember"), """ package io.spine.given.devices - import io.spine.given.devices.events.StatusReported + import io.spine.given.devices.events.StatusReported import io.spine.server.projection.Projection import io.spine.server.route.Route class NotCompanionMember : Projection() { - - // Error: The method must belong to a companion object. @Route fun route(e: StatusReported): DeviceId { return event.getDevice() From db6710765100d049511e401cc45b3095575942ee Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 18:24:07 +0000 Subject: [PATCH 30/96] Simplify control flow --- .../tools/mc/java/routing/CommonChecks.kt | 93 +++++++++++++++++++ .../tools/mc/java/routing/RouteSignature.kt | 86 ++++------------- 2 files changed, 113 insertions(+), 66 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt new file mode 100644 index 000000000..0136e51a1 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt @@ -0,0 +1,93 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.symbol.FunctionKind +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import funRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef +import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import msg + +/** + * Runs general usage checks for this function declaration. + * + * @param logger The logger to report errors or warnings, if any. + * @return `true` if all the checks pass, `false` otherwise. + */ +internal fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean { + // Run all the checks assuming that compilation may terminate after more than one error. + val declaredInAClass = declaredInAClass(logger) + val isStatic = isStatic(logger) + val acceptsOneOrTwoParameters = acceptsOneOrTwoParameters(logger) + return (declaredInAClass + && isStatic + && acceptsOneOrTwoParameters) +} + +private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { + val isStatic = functionKind == FunctionKind.STATIC + if (!isStatic) { + logger.error(msg( + "The $funRef annotated with $routeRef must be" + + " a member of a companion object and annotated with $jvmStaticRef.", + + "The $funRef annotated with $routeRef must be `static`." + ), + this + ) + } + return isStatic +} + +private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { + val inClass = parentDeclaration is KSClassDeclaration + if (!inClass) { + // This case is Kotlin-only because in Java a function would belong to a class. + logger.error( + "The $funRef annotated with $routeRef must be" + + " a member of a companion object of an entity class" + + " annotated with $jvmStaticRef.", + this + ) + } + return inClass +} + +private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): Boolean { + val wrongNumber = parameters.isEmpty() || parameters.size > 2 + if (wrongNumber) { + logger.error( + "The $funRef annotated with $routeRef must accept one or two parameters. " + + "Encountered: ${parameters.size}.", + this + ) + } + return !wrongNumber +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index aefff6f2b..35eeae428 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -28,17 +28,13 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver -import com.google.devtools.ksp.symbol.FunctionKind -import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import funRef import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply -import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef -import msg -import funRef /** * The base class for classes checking the contract of the functions with the [Route] annotation. @@ -95,22 +91,28 @@ private class Qualifier( resolver: Resolver, private val logger: KSPLogger ) { - private var errors = false + private var errorCount = 0 private val cmd = CommandRouteSignature(resolver, logger) private val evt = EventRouteSignature(resolver, logger) fun run(): List { - val result = buildList { - functions.forEach { fn -> - if (fn.commonChecks(logger)) { - qualify(fn)?.let { - add(it) - } - } + val result = mutableListOf() + functions.forEach { fn -> + val commonChecksPass = fn.commonChecks(logger) + if (!commonChecksPass) { + errorCount += 1 + return@forEach + } + val qualified = qualify(fn) + if (qualified != null) { + result.add(qualified) + } else { + logger.error("The ${fn.funRef} does not match the $routeRef contract.", fn) + errorCount += 1 } } - if (errors) { - error("Errors using $routeRef.") + if (errorCount > 0) { + error("${"Error".pluralize(errorCount)} using $routeRef.") } return result } @@ -120,58 +122,10 @@ private class Qualifier( return it } ?: evt.match(fn)?.let { return it - } ?: run { - logger.error( - "The ${fn.funRef} does not match the $routeRef contract.", fn - ) - errors = true - return null - } - } -} - -private fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean = - declaredInAClass(logger) - && isStatic(logger) - && acceptsOneOrTwoParameters(logger) - -private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { - val isStatic = functionKind == FunctionKind.STATIC - if (!isStatic) { - logger.error(msg( - "The $funRef annotated with $routeRef must be" + - " a member of a companion object and annotated with $jvmStaticRef.", - - "The $funRef annotated with $routeRef must be `static`." - ), - this - ) + } ?: return null } - return isStatic } -private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { - val inClass = parentDeclaration is KSClassDeclaration - if (!inClass) { - // This case is Kotlin-only because in Java a function would belong to a class. - logger.error( - "The $funRef annotated with $routeRef must be" + - " a member of a companion object of an entity class" + - " annotated with $jvmStaticRef.", - this - ) - } - return inClass -} - -private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): Boolean { - val wrongNumber = parameters.isEmpty() || parameters.size > 2 - if (wrongNumber) { - logger.error( - "The $funRef annotated with $routeRef must accept one or two parameters. " + - "Encountered: ${parameters.size}.", - this - ) - } - return !wrongNumber +private fun String.pluralize(count: Int, pluralForm: String? = null): String { + return if (count == 1) this else pluralForm ?: "${this}s" } From 1f767772dc01b7155c68ad81c5b40e8c12de6117 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 20:17:23 +0000 Subject: [PATCH 31/96] Check parameter types --- .../mc/java/routing/CommandRouteSignature.kt | 5 - .../mc/java/routing/EventRouteSignature.kt | 6 - .../tools/mc/java/routing/RouteProcessor.kt | 12 +- .../tools/mc/java/routing/RouteSignature.kt | 57 ++++++- .../tools/mc/java/routing/ErrorSpecExts.kt | 16 +- .../routing/RouteProcessorJavaErrorSpec.kt | 144 +++++++++++------- 6 files changed, 167 insertions(+), 73 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt index 7ead82c93..63aac7183 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt @@ -41,11 +41,6 @@ internal class CommandRouteSignature( resolver, logger ) { - override fun parametersMatch(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement - return false - } - override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { //TODO:2025-01-22:alexander.yevsyukov: Implement return false diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt index 9ed5fe881..0bfff9a4d 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -40,12 +40,6 @@ internal class EventRouteSignature( resolver, logger ) { - - override fun parametersMatch(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement - return false - } - override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { //TODO:2025-01-22:alexander.yevsyukov: Implement return false diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 79466c46f..5ab693bf2 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -58,9 +58,9 @@ internal class RouteProcessor( } private fun processCommands(qualified: List) { - val commandRouting = qualified.filterIsInstance() - val commandRoutingGrouped = commandRouting.groupByClasses() - commandRoutingGrouped.forEach { (declaringClass, functions) -> + val routing = qualified.filterIsInstance() + val grouped = routing.groupByClasses() + grouped.forEach { (declaringClass, functions) -> val crv = CommandRouteVisitor(functions, codeGenerator, resolver, logger) declaringClass.accept(crv, Unit) crv.writeFile() @@ -68,9 +68,9 @@ internal class RouteProcessor( } private fun processEvents(qualified: List) { - val eventRouting = qualified.filterIsInstance() - val eventRoutingGrouped = eventRouting.groupByClasses() - eventRoutingGrouped.forEach { (declaringClass, functions) -> + val routing = qualified.filterIsInstance() + val grouped = routing.groupByClasses() + grouped.forEach { (declaringClass, functions) -> val erv = EventRouteVisitor(functions, codeGenerator, resolver, logger) declaringClass.accept(erv, Unit) erv.writeFile() diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 35eeae428..c76927901 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -29,6 +29,8 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType +import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import funRef import io.spine.base.SignalMessage import io.spine.core.SignalContext @@ -45,7 +47,10 @@ internal sealed class RouteSignature( protected val resolver: Resolver, protected val logger: KSPLogger ) { - protected abstract fun parametersMatch(fn: KSFunctionDeclaration): Boolean + + private val signalType by lazy { signalClass.toType(resolver) } + private val contextType by lazy { contextClass.toType(resolver) } + protected abstract fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean protected abstract fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean protected abstract fun create(fn: KSFunctionDeclaration): F @@ -63,6 +68,43 @@ internal sealed class RouteSignature( return create(fn) } + @OverridingMethodsMustInvokeSuper + protected open fun parametersMatch(fn: KSFunctionDeclaration): Boolean { + checkParamSize(fn) + + val firstParamType = fn.parameters[0].type.resolve() + if (!signalType.isAssignableFrom(firstParamType)) { + // Even if the parameter does not match, it could be another kind of + // routing function, so we simply return `false`. + return false + } + if (fn.parameters.size == 2) { + val secondParamType = fn.parameters[1].type.resolve() + val match = contextType.isAssignableFrom(secondParamType) + if (!match) { + // Here, knowing that the first parameter type is correct, we can complain + // about the type of the second parameter. + val actualSecondParamName = secondParamType.declaration.simpleName.getShortName() + logger.error( + "The second parameter of the ${fn.funRef} annotated with $routeRef" + + " must be `${contextClass.simpleName}`." + + " Encountered: `$actualSecondParamName`.", + fn + ) + } + return match + } + return true + } + + /** + * A safety net to accept functions with the proper number of parameters. + * + * We formally for this to be true in [KSFunctionDeclaration.acceptsOneOrTwoParameters]. + */ + private fun checkParamSize(fn: KSFunctionDeclaration) = + require(fn.parameters.size == 1 || fn.parameters.size == 2) + companion object { val routeRef by lazy { "`@${simply()}`" } @@ -79,6 +121,18 @@ internal sealed class RouteSignature( } } +private fun Class<*>.toType(resolver: Resolver): KSType { + val name = resolver.getKSNameFromString(canonicalName) + val classDecl = resolver.getClassDeclarationByName(name) + // This is a reminder to add a proper JAR for `KotlinCompilation` in tests. + check(classDecl != null) { + "Unable to find the declaration of `$canonicalName`." + + " Make sure the class is in the compilation classpath." + } + val type = classDecl.asStarProjectedType() + return type +} + /** * The helper class which transforms the incoming sequence with [functions] into * a list containing [CommandRouteFun] or [EventRouteFun]. @@ -107,7 +161,6 @@ private class Qualifier( if (qualified != null) { result.add(qualified) } else { - logger.error("The ${fn.funRef} does not match the $routeRef contract.", fn) errorCount += 1 } } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt index f4cbc9238..6e2a520a3 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt @@ -26,7 +26,10 @@ package io.spine.tools.mc.java.routing +import com.tschuchort.compiletesting.SourceFile +import com.tschuchort.compiletesting.SourceFile.Companion.java import java.io.File +import org.intellij.lang.annotations.Language /** * Obtains the path to the classpath element which contains the receiver class. @@ -42,9 +45,20 @@ private val packageDir = "io/spine/given/devices" /** * Obtains a file name with the package directories for a Java class with the given simple name. */ -internal fun javaFile(simpleName: String): String = "$packageDir/${simpleName}.java" +private fun javaFn(simpleName: String): String = "$packageDir/${simpleName}.java" /** * Obtains a file name with the package directories for a Kotlin file with the given name. */ internal fun kotlinFile(simpleName: String): String = "$packageDir/${simpleName}.kt" + +/** + * Creates an instance of [SourceFile] with the Java file containing the class + * with the specified name. + */ +internal fun javaFile( + simpleClassName: String, + @Language("java") contents: String +): SourceFile { + return java(name = javaFn(simpleClassName), contents = contents, trimIndent = true) +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index 3be10fb49..e2a5df077 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -33,13 +33,15 @@ package io.spine.tools.mc.java.routing import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR -import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain +import io.spine.base.CommandMessage +import io.spine.core.CommandContext import io.spine.core.EventContext import io.spine.given.devices.Device import io.spine.server.route.Route +import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.BeforeEach @@ -55,6 +57,7 @@ internal class RouteProcessorJavaErrorSpec { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() + val baseJar = CommandMessage::class.java.classpathFile() val coreJar = EventContext::class.java.classpathFile() val serverJar = Route::class.java.classpathFile() val compiledProtos = Device::class.java.classpathFile() @@ -63,6 +66,7 @@ internal class RouteProcessorJavaErrorSpec { javaPackagePrefix = "io.spine.routing.given" symbolProcessorProviders = listOf(RouteProcessorProvider()) classpaths = classpaths + listOf( + baseJar, coreJar, serverJar, compiledProtos @@ -70,6 +74,25 @@ internal class RouteProcessorJavaErrorSpec { } } + /* + * Error: non-static method. + */ + private val nonStatic = javaFile("NonStatic", """ + + package io.spine.given.devices; + + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class NonStatic extends Projection { + @Route + DeviceId route(StatusReported event) { + return event.getDevice(); + } + } + """.trimIndent()) + @Test fun `when a non-static method is annotated`() { compilation.apply { @@ -79,12 +102,31 @@ internal class RouteProcessorJavaErrorSpec { result.exitCode shouldBe COMPILATION_ERROR result.messages.let { - it shouldContain "The method `route()`" // The name of the method in error. + it shouldContain "The method `route()`" it shouldContain routeRef - it shouldContain "must be `static`." // The nature of the error. + it shouldContain "must be `static`." } } + /* + * Error: no parameters. + */ + private val noParameters = javaFile("NoParameters", """ + + package io.spine.given.devices; + + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class NoParameters extends Projection { + @Route + static DeviceId route() { + return DeviceId.generate(); + } + } + """.trimIndent()) + @Test fun `when no parameters are specified`() { compilation.apply { @@ -93,12 +135,32 @@ internal class RouteProcessorJavaErrorSpec { val result = compilation.compile() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { - it shouldContain "The method `route()`" // The name of the method in error. + it shouldContain "The method `route()`" it shouldContain routeRef it shouldContain "one or two parameters. Encountered: 0." } } + /* + * Error: too many parameters. + */ + private val tooManyParameters = javaFile("TooManyParameters", """ + + package io.spine.given.devices; + + import io.spine.core.EventContext; + import io.spine.given.devices.events.StatusReported; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class TooManyParameters extends Projection { + @Route + static DeviceId route(StatusReported event, EventContext context, Object other) { + return event.getDevice(); + } + } + """.trimIndent()) + @Test fun `when too many parameters are specified`() { compilation.apply { @@ -107,70 +169,46 @@ internal class RouteProcessorJavaErrorSpec { val result = compilation.compile() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { - it shouldContain "The method `route()`" // The name of the method in error. + it shouldContain "The method `route()`" it shouldContain routeRef it shouldContain "one or two parameters. Encountered: 3." } } -} -/** - * Error: non-static method. - */ -private val nonStatic = SourceFile.java( - javaFile("NonStatic"), """ - package io.spine.given.devices; + /** + * Error: the second parameter is [io.spine.core.CommandContext] instead of [EventContext]. + */ + private val wrongSecondParameter = javaFile("WrongSecondParameter", """ - import io.spine.given.devices.events.StatusReported; + package io.spine.given.devices; + + import io.spine.core.CommandContext; + import io.spine.given.devices.events.StatusReported; import io.spine.server.projection.Projection; import io.spine.server.route.Route; - class NonStatic extends Projection { + class WrongSecondParameter extends Projection { @Route - DeviceId route(StatusReported event) { + static DeviceId route(StatusReported event, CommandContext context) { return event.getDevice(); } } """.trimIndent() -) + ) -/** - * Error: no parameters. - */ -private val noParameters = SourceFile.java( - javaFile("NoParameters"), """ - package io.spine.given.devices; - - import io.spine.given.devices.events.StatusReported; - import io.spine.server.projection.Projection; - import io.spine.server.route.Route; - - class NoParameters extends Projection { - @Route - static DeviceId route() { - return DeviceId.generate(); + @Test + fun `when the second parameters is of incorrect type`() { + compilation.apply { + sources = listOf(wrongSecondParameter) } - } - """.trimIndent() -) - -/** - * Error: too many parameters. - */ -private val tooManyParameters = SourceFile.java( - javaFile("TooManyParameters"), """ - package io.spine.given.devices; - - import io.spine.core.EventContext; - import io.spine.given.devices.events.StatusReported; - import io.spine.server.projection.Projection; - import io.spine.server.route.Route; - - class TooManyParameters extends Projection { - @Route - static DeviceId route(StatusReported event, EventContext context, Object other) { - return event.getDevice(); + val result = compilation.compile() + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "The second parameter of the method `route()`" + it shouldContain routeRef + it shouldContain "must be `${simply()}`." + it shouldContain "Encountered: `${simply()}`." } } - """.trimIndent() -) +} + From 1537c2fc501e96f60f309c91b6212e36aa38aa16 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 23 Jan 2025 20:23:34 +0000 Subject: [PATCH 32/96] Improve docs --- .../io/spine/tools/mc/java/routing/RouteSignature.kt | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index c76927901..2aa3b9b9e 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -47,7 +47,6 @@ internal sealed class RouteSignature( protected val resolver: Resolver, protected val logger: KSPLogger ) { - private val signalType by lazy { signalClass.toType(resolver) } private val contextType by lazy { contextClass.toType(resolver) } @@ -55,6 +54,7 @@ internal sealed class RouteSignature( protected abstract fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean protected abstract fun create(fn: KSFunctionDeclaration): F + @Suppress("ReturnCount") fun match(fn: KSFunctionDeclaration): F? { if (!parametersMatch(fn)) { return null @@ -100,7 +100,7 @@ internal sealed class RouteSignature( /** * A safety net to accept functions with the proper number of parameters. * - * We formally for this to be true in [KSFunctionDeclaration.acceptsOneOrTwoParameters]. + * We formally check for this to be true in [KSFunctionDeclaration.acceptsOneOrTwoParameters]. */ private fun checkParamSize(fn: KSFunctionDeclaration) = require(fn.parameters.size == 1 || fn.parameters.size == 2) @@ -121,10 +121,13 @@ internal sealed class RouteSignature( } } +/** + * Converts this class into [KSType] using the given resolver. + */ private fun Class<*>.toType(resolver: Resolver): KSType { val name = resolver.getKSNameFromString(canonicalName) val classDecl = resolver.getClassDeclarationByName(name) - // This is a reminder to add a proper JAR for `KotlinCompilation` in tests. + // This is a reminder to add corresponding JAR to `KotlinCompilation` in tests. check(classDecl != null) { "Unable to find the declaration of `$canonicalName`." + " Make sure the class is in the compilation classpath." From 53def511ddd37f8b122cb93bfe30fc0feba4b736 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 24 Jan 2025 16:10:44 +0000 Subject: [PATCH 33/96] Document matching parameters --- .../io/spine/tools/mc/java/routing/RouteSignature.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 2aa3b9b9e..4a0beec5b 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -68,6 +68,15 @@ internal sealed class RouteSignature( return create(fn) } + /** + * Verifies that the given function accepts one or two parameters with + * the types matching [signalClass] and [contextClass]. + * + * The first parameter must be of [signalClass] or implement the interface specified + * by this property. + * + * The second parameter, if any, must be of the [contextClass] type. + */ @OverridingMethodsMustInvokeSuper protected open fun parametersMatch(fn: KSFunctionDeclaration): Boolean { checkParamSize(fn) @@ -80,7 +89,7 @@ internal sealed class RouteSignature( } if (fn.parameters.size == 2) { val secondParamType = fn.parameters[1].type.resolve() - val match = contextType.isAssignableFrom(secondParamType) + val match = contextType == secondParamType if (!match) { // Here, knowing that the first parameter type is correct, we can complain // about the type of the second parameter. From d7208683430abd4319f7f2c7ae76476eb882494f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 24 Jan 2025 16:30:37 +0000 Subject: [PATCH 34/96] Improve code layout --- .../io/spine/tools/mc/java/routing/Exts.kt | 56 ++++++++++++++ .../spine/tools/mc/java/routing/Qualifier.kt | 77 +++++++++++++++++++ .../tools/mc/java/routing/RouteSignature.kt | 67 ---------------- 3 files changed, 133 insertions(+), 67 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt new file mode 100644 index 000000000..03232bea2 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSType + +/** + * Converts this class into [com.google.devtools.ksp.symbol.KSType] using the given resolver. + */ +internal fun Class<*>.toType(resolver: Resolver): KSType { + val name = resolver.getKSNameFromString(canonicalName) + val classDecl = resolver.getClassDeclarationByName(name) + // This is a reminder to add corresponding JAR to `KotlinCompilation` in tests. + check(classDecl != null) { + "Unable to find the declaration of `$canonicalName`." + + " Make sure the class is in the compilation classpath." + } + val type = classDecl.asStarProjectedType() + return type +} + +/** + * Transform this string into a plural form if the count is greater than one. + * + * @param pluralForm Optional parameter to be used for count > 1. If not specified `"s"` will + * be appended to this string in the returned result. + * @return this string if count == 1, [pluralForm], if specified, "${this}s" otherwise. + */ +internal fun String.pluralize(count: Int, pluralForm: String? = null): String { + return if (count == 1) this else pluralForm ?: "${this}s" +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt new file mode 100644 index 000000000..af9d47d6f --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -0,0 +1,77 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSFunctionDeclaration + +/** + * The helper class which transforms the incoming sequence with [functions] into + * a list containing [CommandRouteFun] or [EventRouteFun]. + * + * If a function is not recognized to be one of these types, + * the compilation terminates with an error. + */ +internal class Qualifier( + private val functions: Sequence, + resolver: Resolver, + private val logger: KSPLogger +) { + private var errorCount = 0 + private val cmd = CommandRouteSignature(resolver, logger) + private val evt = EventRouteSignature(resolver, logger) + + fun run(): List { + val result = mutableListOf() + functions.forEach { fn -> + val commonChecksPass = fn.commonChecks(logger) + if (!commonChecksPass) { + errorCount += 1 + return@forEach + } + val qualified = qualify(fn) + if (qualified != null) { + result.add(qualified) + } else { + errorCount += 1 + } + } + if (errorCount > 0) { + error("${"Error".pluralize(errorCount)} using ${RouteSignature.Companion.routeRef}.") + } + return result + } + + private fun qualify(fn: KSFunctionDeclaration): RouteFun? { + cmd.match(fn)?.let { + return it + } ?: evt.match(fn)?.let { + return it + } ?: return null + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index 4a0beec5b..f07d4b826 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -29,14 +29,12 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration -import com.google.devtools.ksp.symbol.KSType import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import funRef import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply -import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef /** * The base class for classes checking the contract of the functions with the [Route] annotation. @@ -129,68 +127,3 @@ internal sealed class RouteSignature( } } } - -/** - * Converts this class into [KSType] using the given resolver. - */ -private fun Class<*>.toType(resolver: Resolver): KSType { - val name = resolver.getKSNameFromString(canonicalName) - val classDecl = resolver.getClassDeclarationByName(name) - // This is a reminder to add corresponding JAR to `KotlinCompilation` in tests. - check(classDecl != null) { - "Unable to find the declaration of `$canonicalName`." + - " Make sure the class is in the compilation classpath." - } - val type = classDecl.asStarProjectedType() - return type -} - -/** - * The helper class which transforms the incoming sequence with [functions] into - * a list containing [CommandRouteFun] or [EventRouteFun]. - * - * If a function is not recognized to be one of these types, - * the compilation terminates with an error. - */ -private class Qualifier( - private val functions: Sequence, - resolver: Resolver, - private val logger: KSPLogger -) { - private var errorCount = 0 - private val cmd = CommandRouteSignature(resolver, logger) - private val evt = EventRouteSignature(resolver, logger) - - fun run(): List { - val result = mutableListOf() - functions.forEach { fn -> - val commonChecksPass = fn.commonChecks(logger) - if (!commonChecksPass) { - errorCount += 1 - return@forEach - } - val qualified = qualify(fn) - if (qualified != null) { - result.add(qualified) - } else { - errorCount += 1 - } - } - if (errorCount > 0) { - error("${"Error".pluralize(errorCount)} using $routeRef.") - } - return result - } - - private fun qualify(fn: KSFunctionDeclaration): RouteFun? { - cmd.match(fn)?.let { - return it - } ?: evt.match(fn)?.let { - return it - } ?: return null - } -} - -private fun String.pluralize(count: Int, pluralForm: String? = null): String { - return if (count == 1) this else pluralForm ?: "${this}s" -} From 630828a4041fc7ba9a8e5f211c82e7d80e19b4b8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 24 Jan 2025 21:14:36 +0000 Subject: [PATCH 35/96] Improve filtering and general error checks --- .../mc/java/routing/CommandRouteSignature.kt | 40 +++++---- .../tools/mc/java/routing/CommonChecks.kt | 23 +++++- .../io/spine/tools/mc/java/routing/Context.kt | 43 ++++++++++ .../tools/mc/java/routing/EntityClass.kt | 62 ++++++++++++++ .../mc/java/routing/EventRouteSignature.kt | 30 +++---- .../spine/tools/mc/java/routing/KSTypeExts.kt | 41 ++++++++++ .../spine/tools/mc/java/routing/Qualifier.kt | 22 +++-- .../spine/tools/mc/java/routing/RouteFun.kt | 22 +++-- .../tools/mc/java/routing/RouteProcessor.kt | 14 ++-- .../tools/mc/java/routing/RouteSignature.kt | 82 +++++++++++++------ .../tools/mc/java/routing/RouteVisitor.kt | 17 ++-- .../routing/RouteProcessorJavaErrorSpec.kt | 42 +++++++++- 12 files changed, 348 insertions(+), 90 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt index 63aac7183..a4771ecae 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt @@ -26,30 +26,40 @@ package io.spine.tools.mc.java.routing -import com.google.devtools.ksp.processing.KSPLogger -import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType import io.spine.base.CommandMessage import io.spine.core.CommandContext internal class CommandRouteSignature( - resolver: Resolver, - logger: KSPLogger + context: Context ) : RouteSignature( CommandMessage::class.java, CommandContext::class.java, - resolver, - logger + context ) { - override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement - return false + override fun matchDeclaringClass( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): Boolean = with(context) { + val isAggregate = aggregateClass.isAssignableFrom(declaringClass.type) + val isProcessManager = processManagerClass.isAssignableFrom(declaringClass.type) + val match = isAggregate || isProcessManager + if (!match) { + val parent = declaringClass.superClass() + logger.error( + "A command routing function can be declared in a class derived" + + " from ${processManagerClass.ref} or ${aggregateClass.ref}." + + " Encountered: ${parent.qualifiedRef}.", + fn) + } + return match } - override fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement. - return false - } - - override fun create(fn: KSFunctionDeclaration): CommandRouteFun = CommandRouteFun(fn) + override fun create( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType + ): CommandRouteFun = CommandRouteFun(fn, declaringClass, parameters, returnType) } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt index 0136e51a1..df5cbfdf2 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt @@ -31,6 +31,7 @@ import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import funRef +import io.spine.server.entity.Entity import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import msg @@ -41,7 +42,8 @@ import msg * @param logger The logger to report errors or warnings, if any. * @return `true` if all the checks pass, `false` otherwise. */ -internal fun KSFunctionDeclaration.commonChecks(logger: KSPLogger): Boolean { +internal fun KSFunctionDeclaration.commonChecks(context: Context): Boolean { + val logger = context.logger // Run all the checks assuming that compilation may terminate after more than one error. val declaredInAClass = declaredInAClass(logger) val isStatic = isStatic(logger) @@ -91,3 +93,22 @@ private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): } return !wrongNumber } + +internal fun KSFunctionDeclaration.declaringClass(context: Context): EntityClass? { + val parent = parentDeclaration!!.qualifiedName!! + var declaringClass = context.resolver.getClassDeclarationByName(parent)!! + if (declaringClass.isCompanionObject) { + // In Kotlin routing functions are declared in a companion object. + // We need the enclosing entity class. + declaringClass = declaringClass.parentDeclaration!! as KSClassDeclaration + } + if (!context.entityInterface.isAssignableFrom(declaringClass.asStarProjectedType())) { + context.logger.error( + "The declaring class of the ${funRef} annotated with $routeRef" + + " must implement the `${Entity::class.java.canonicalName}` interface.", + this + ) + return null + } + return EntityClass(declaringClass, context.entityInterface) +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt new file mode 100644 index 000000000..bdd3f8731 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt @@ -0,0 +1,43 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.processing.KSPLogger +import com.google.devtools.ksp.processing.Resolver +import io.spine.server.entity.Entity +import io.spine.server.procman.ProcessManager +import io.spine.server.projection.Projection + +internal class Context( + val resolver: Resolver, + val logger: KSPLogger +) { + val entityInterface by lazy { Entity::class.java.toType(resolver) } + val aggregateClass by lazy { ProcessManager::class.java.toType(resolver) } + val projectionClass by lazy { Projection::class.java.toType(resolver) } + val processManagerClass by lazy { ProcessManager::class.java.toType(resolver) } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt new file mode 100644 index 000000000..68c8bb185 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt @@ -0,0 +1,62 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.symbol.ClassKind.CLASS +import com.google.devtools.ksp.symbol.KSClassDeclaration +import com.google.devtools.ksp.symbol.KSType + +internal class EntityClass( + private val decl: KSClassDeclaration, + entityInterface: KSType +) { + fun accept(visitor: RouteVisitor<*>, data: Unit) { + decl.accept(visitor, data) + } + + val type: KSType by lazy { decl.asStarProjectedType() } + + val idClass: KSType by lazy { + val asEntity = decl.superTypes.find { + entityInterface.isAssignableFrom(it.resolve()) + } + check(asEntity != null) { + "The class `${decl.qualifiedName!!.asString()}`" + + " must implement ${entityInterface.declaration.qualifiedName!!.asString()}`." + } + val firstTypeArgument = asEntity.element!!.typeArguments.first() + firstTypeArgument.type!!.resolve() + } + + fun superClass(): KSType { + val found = decl.superTypes.find { + val superType = it.resolve().declaration + (superType is KSClassDeclaration) && (superType.classKind == CLASS) + } + return found!!.resolve() + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt index 0bfff9a4d..04dea9886 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -26,29 +26,31 @@ package io.spine.tools.mc.java.routing -import com.google.devtools.ksp.processing.KSPLogger -import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType import io.spine.base.EventMessage import io.spine.core.EventContext internal class EventRouteSignature( - resolver: Resolver, logger: KSPLogger + context: Context ) : RouteSignature( EventMessage::class.java, EventContext::class.java, - resolver, - logger + context ) { - override fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement - return false + override fun matchDeclaringClass( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): Boolean { + val isProjection = context.projectionClass.isAssignableFrom(declaringClass.type) + val isProcessManager = context.processManagerClass.isAssignableFrom(declaringClass.type) + return isProjection || isProcessManager } - override fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean { - //TODO:2025-01-22:alexander.yevsyukov: Implement. - return false - } - - override fun create(fn: KSFunctionDeclaration): EventRouteFun = EventRouteFun(fn) + override fun create( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType + ): EventRouteFun = EventRouteFun(fn, declaringClass, parameters, returnType) } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt new file mode 100644 index 000000000..dc194c1c6 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt @@ -0,0 +1,41 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.symbol.KSType + +/** + * Obtains backticked simple name of the type. + */ +internal val KSType.ref: String + get() = "`${declaration.simpleName.asString()}`" + +/** + * Obtains backticked qualified name of the type. + */ +internal val KSType.qualifiedRef: String + get() = "`${declaration.qualifiedName?.asString()}`" diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt index af9d47d6f..6a02020e3 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -39,22 +39,26 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration */ internal class Qualifier( private val functions: Sequence, - resolver: Resolver, - private val logger: KSPLogger + private val context: Context ) { private var errorCount = 0 - private val cmd = CommandRouteSignature(resolver, logger) - private val evt = EventRouteSignature(resolver, logger) + private val cmd = CommandRouteSignature(context) + private val evt = EventRouteSignature(context) fun run(): List { val result = mutableListOf() functions.forEach { fn -> - val commonChecksPass = fn.commonChecks(logger) + val commonChecksPass = fn.commonChecks(context) if (!commonChecksPass) { errorCount += 1 return@forEach } - val qualified = qualify(fn) + val declaringClass = fn.declaringClass(context) + if (declaringClass == null) { + errorCount += 1 + return@forEach + } + val qualified = qualify(fn, declaringClass) if (qualified != null) { result.add(qualified) } else { @@ -67,10 +71,10 @@ internal class Qualifier( return result } - private fun qualify(fn: KSFunctionDeclaration): RouteFun? { - cmd.match(fn)?.let { + private fun qualify(fn: KSFunctionDeclaration, declaringClass: EntityClass): RouteFun? { + cmd.match(fn, declaringClass)?.let { return it - } ?: evt.match(fn)?.let { + } ?: evt.match(fn, declaringClass)?.let { return it } ?: return null } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt index 926ddbd45..d39cf3e35 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -27,13 +27,25 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType internal sealed class RouteFun( - internal val fn: KSFunctionDeclaration + val fn: KSFunctionDeclaration, + val declaringClass: EntityClass, + protected val parameters: Pair, + protected val returnType: KSType ) -internal class CommandRouteFun(fn: KSFunctionDeclaration) : RouteFun(fn) { -} +internal class CommandRouteFun( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType +) : RouteFun(fn, declaringClass, parameters, returnType) -internal class EventRouteFun(fn: KSFunctionDeclaration) : RouteFun(fn) { -} +internal class EventRouteFun( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType +) : RouteFun(fn, declaringClass, parameters, returnType) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 5ab693bf2..2cdec1b52 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -31,7 +31,6 @@ import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.processing.SymbolProcessor import com.google.devtools.ksp.symbol.KSAnnotated -import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.validate import io.spine.server.route.Route @@ -43,13 +42,16 @@ internal class RouteProcessor( private lateinit var resolver: Resolver + private lateinit var context: Context + override fun process(resolver: Resolver): List { this.resolver = resolver + this.context = Context(resolver, logger) val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } - val qualified = RouteSignature.qualify(allValid, resolver, logger) + val qualified = RouteSignature.qualify(allValid, context) processCommands(qualified) processEvents(qualified) @@ -61,7 +63,7 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val crv = CommandRouteVisitor(functions, codeGenerator, resolver, logger) + val crv = CommandRouteVisitor(functions, codeGenerator, context) declaringClass.accept(crv, Unit) crv.writeFile() } @@ -71,12 +73,12 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val erv = EventRouteVisitor(functions, codeGenerator, resolver, logger) + val erv = EventRouteVisitor(functions, codeGenerator, context) declaringClass.accept(erv, Unit) erv.writeFile() } } } -private fun List.groupByClasses(): Map> = - groupBy { it.fn.parentDeclaration!! as KSClassDeclaration } +private fun List.groupByClasses(): Map> = + groupBy { it.declaringClass } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index f07d4b826..e8106401e 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -26,44 +26,72 @@ package io.spine.tools.mc.java.routing -import com.google.devtools.ksp.processing.KSPLogger -import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import funRef import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply +import io.spine.tools.mc.java.routing.RouteSignature.Companion.qualify /** * The base class for classes checking the contract of the functions with the [Route] annotation. + * + * The [match] function checks the signature of the function and creates an instance of + * a class derived from [RouteFun], if the contract is satisfied. + * + * The [qualify] method of the companion object walks through the annotated functions + * detected by the [RouteProcessor] matching them to corresponding signature kind and thus + * producing proper [RouteFun] instances. */ internal sealed class RouteSignature( protected val signalClass: Class, protected val contextClass: Class, - protected val resolver: Resolver, - protected val logger: KSPLogger + protected val context: Context ) { - private val signalType by lazy { signalClass.toType(resolver) } - private val contextType by lazy { contextClass.toType(resolver) } + private val signalType by lazy { signalClass.toType(context.resolver) } + private val contextType by lazy { contextClass.toType(context.resolver) } - protected abstract fun returnTypeMatches(fn: KSFunctionDeclaration): Boolean - protected abstract fun declarationSiteMatches(fn: KSFunctionDeclaration): Boolean - protected abstract fun create(fn: KSFunctionDeclaration): F + protected abstract fun matchDeclaringClass( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): Boolean - @Suppress("ReturnCount") - fun match(fn: KSFunctionDeclaration): F? { - if (!parametersMatch(fn)) { - return null - } - if (!returnTypeMatches(fn)) { - return null + @OverridingMethodsMustInvokeSuper + protected open fun matchReturnType( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): KSType? { + val idClass = declaringClass.idClass + val returnType = fn.returnType!!.resolve() + if (idClass.isAssignableFrom(returnType)) { + return returnType } - if (!declarationSiteMatches(fn)) { + return null + } + + /** + * Creates a [RouteFun] of the type [F] for the given function and resolved types. + */ + protected abstract fun create( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType + ): F + + @Suppress("ReturnCount") + fun match(fn: KSFunctionDeclaration, declaringClass: EntityClass): F? { + val params = matchParameters(fn) + ?: return null + if (!matchDeclaringClass(fn, declaringClass)) { return null } - return create(fn) + val returnType = matchReturnType(fn, declaringClass) + ?: return null + return create(fn, declaringClass, params, returnType) } /** @@ -76,32 +104,33 @@ internal sealed class RouteSignature( * The second parameter, if any, must be of the [contextClass] type. */ @OverridingMethodsMustInvokeSuper - protected open fun parametersMatch(fn: KSFunctionDeclaration): Boolean { + protected open fun matchParameters(fn: KSFunctionDeclaration): Pair? { checkParamSize(fn) val firstParamType = fn.parameters[0].type.resolve() if (!signalType.isAssignableFrom(firstParamType)) { // Even if the parameter does not match, it could be another kind of // routing function, so we simply return `false`. - return false + return null } + var secondParamType: KSType? = null if (fn.parameters.size == 2) { - val secondParamType = fn.parameters[1].type.resolve() + secondParamType = fn.parameters[1].type.resolve() val match = contextType == secondParamType if (!match) { // Here, knowing that the first parameter type is correct, we can complain // about the type of the second parameter. val actualSecondParamName = secondParamType.declaration.simpleName.getShortName() - logger.error( + context.logger.error( "The second parameter of the ${fn.funRef} annotated with $routeRef" + " must be `${contextClass.simpleName}`." + " Encountered: `$actualSecondParamName`.", fn ) + return null } - return match } - return true + return Pair(firstParamType, secondParamType) } /** @@ -119,10 +148,9 @@ internal sealed class RouteSignature( fun qualify( functions: Sequence, - resolver: Resolver, - logger: KSPLogger + context: Context ): List { - val qualifier = Qualifier(functions, resolver, logger) + val qualifier = Qualifier(functions, context) return qualifier.run() } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 65bea2504..d965eac9d 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -28,8 +28,6 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.Dependencies -import com.google.devtools.ksp.processing.KSPLogger -import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile import com.google.devtools.ksp.symbol.KSFunctionDeclaration @@ -41,8 +39,7 @@ import com.squareup.kotlinpoet.ksp.writeTo internal sealed class RouteVisitor( private val functions: List, protected val codeGenerator: CodeGenerator, - protected val resolver: Resolver, - protected val logger: KSPLogger + protected val context: Context, ) : KSVisitorVoid() { private lateinit var packageName: String @@ -67,7 +64,7 @@ internal sealed class RouteVisitor( fun writeFile() { val cls = routingClass.build() - val code = FileSpec.Companion.builder(packageName, cls.name!!) + val code = FileSpec.builder(packageName, cls.name!!) .addType(cls) .build() val deps = Dependencies(true, originalFile) @@ -78,9 +75,8 @@ internal sealed class RouteVisitor( internal class CommandRouteVisitor( functions: List, codeGenerator: CodeGenerator, - resolver: Resolver, - logger: KSPLogger -) : RouteVisitor(functions, codeGenerator, resolver, logger) { + context: Context +) : RouteVisitor(functions, codeGenerator, context) { override val classNameSuffix: String = "$\$CommandRouting" @@ -92,9 +88,8 @@ internal class CommandRouteVisitor( internal class EventRouteVisitor( functions: List, codeGenerator: CodeGenerator, - resolver: Resolver, - logger: KSPLogger -) : RouteVisitor(functions, codeGenerator, resolver, logger) { + context: Context +) : RouteVisitor(functions, codeGenerator, context) { override val classNameSuffix: String = "$\$EventRouting" diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt index e2a5df077..c7920a362 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt @@ -40,6 +40,7 @@ import io.spine.base.CommandMessage import io.spine.core.CommandContext import io.spine.core.EventContext import io.spine.given.devices.Device +import io.spine.server.entity.Entity import io.spine.server.route.Route import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef @@ -193,8 +194,7 @@ internal class RouteProcessorJavaErrorSpec { return event.getDevice(); } } - """.trimIndent() - ) + """.trimIndent()) @Test fun `when the second parameters is of incorrect type`() { @@ -210,5 +210,43 @@ internal class RouteProcessorJavaErrorSpec { it shouldContain "Encountered: `${simply()}`." } } + + /** + * Error: a routing function declared in a non-entity class. + */ + private val nonEntityClass = javaFile("NonEntityClass", """ + + package io.spine.given.devices; + + import io.spine.given.devices.events.StatusReported; + import io.spine.server.event.AbstractEventReactor; + import io.spine.server.route.Route; + + /** + * This inheritance does not make any sense. + * + *

We just want to have a class which extends another class explicitly. + */ + class NonEntityClass extends AbstractEventReactor { + @Route + static DeviceId route(StatusReported event) { + return event.getDevice(); + } + } + """.trimIndent()) + + @Test + fun `when a function declared in a non-entity class`() { + compilation.apply { + sources = listOf(nonEntityClass) + } + val result = compilation.compile() + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "The declaring class of the method `route()`" + it shouldContain routeRef + it shouldContain " must implement the `${Entity::class.java.canonicalName}` interface." + } + } } From 7cf10cf1a2d3ede8fbb1d60d0655c06ccfe65f8a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 24 Jan 2025 21:32:26 +0000 Subject: [PATCH 36/96] Remove redundant class --- .../spine/tools/mc/java/routing/TypeCheck.kt | 54 ------------------- 1 file changed, 54 deletions(-) delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt deleted file mode 100644 index 1595a6674..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/TypeCheck.kt +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.tools.mc.java.routing - -import com.google.devtools.ksp.processing.Resolver -import com.google.devtools.ksp.symbol.KSClassDeclaration -import com.google.devtools.ksp.symbol.KSName -import com.google.devtools.ksp.symbol.KSType - -@Suppress("unused") -internal class TypeCheck( - private val cls: Class<*>, - private val resolver: Resolver -) { - private val name: KSName by lazy { - resolver.getKSNameFromString(cls.canonicalName) - } - - private val type: KSType by lazy { - resolver.getClassDeclarationByName(name)!!.asStarProjectedType() - } - - fun isAssignableFrom(cls: KSClassDeclaration): Boolean { - return type.isAssignableFrom(cls.asStarProjectedType()) - } - - fun matches(cls: KSClassDeclaration): Boolean { - return cls.qualifiedName?.asString() == name.asString() - } -} From 20d7d5d44f54422f32e606bec43c70786df197bf Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 26 Jan 2025 16:43:48 +0000 Subject: [PATCH 37/96] Add state update routing Also: * Rename `Context` to `Environment`. --- .../mc/java/routing/CommandRouteSignature.kt | 6 +- .../tools/mc/java/routing/CommonChecks.kt | 42 +++++++------- .../routing/{Context.kt => Environment.kt} | 5 +- .../mc/java/routing/EventRouteSignature.kt | 8 +-- .../spine/tools/mc/java/routing/Qualifier.kt | 22 ++++---- .../spine/tools/mc/java/routing/RouteFun.kt | 7 +++ .../tools/mc/java/routing/RouteProcessor.kt | 24 +++++--- .../tools/mc/java/routing/RouteSignature.kt | 28 ++++++---- .../tools/mc/java/routing/RouteVisitor.kt | 23 ++++++-- .../java/routing/StateUpdateRouteSignature.kt | 56 +++++++++++++++++++ 10 files changed, 160 insertions(+), 61 deletions(-) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{Context.kt => Environment.kt} (94%) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt index a4771ecae..1d46f72f5 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt @@ -32,16 +32,16 @@ import io.spine.base.CommandMessage import io.spine.core.CommandContext internal class CommandRouteSignature( - context: Context + environment: Environment ) : RouteSignature( CommandMessage::class.java, CommandContext::class.java, - context + environment ) { override fun matchDeclaringClass( fn: KSFunctionDeclaration, declaringClass: EntityClass - ): Boolean = with(context) { + ): Boolean = with(environment) { val isAggregate = aggregateClass.isAssignableFrom(declaringClass.type) val isProcessManager = processManagerClass.isAssignableFrom(declaringClass.type) val match = isAggregate || isProcessManager diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt index df5cbfdf2..494c362bc 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt @@ -39,21 +39,25 @@ import msg /** * Runs general usage checks for this function declaration. * - * @param logger The logger to report errors or warnings, if any. - * @return `true` if all the checks pass, `false` otherwise. + * The function runs all the checks, assuming that compilation does not terminate after + * an error is reported via [KSPLogger.error]. + * + * @param environment The environment for resolving types and reporting errors or warnings. + * @return The number of detected errors, or zero if no errors were found. */ -internal fun KSFunctionDeclaration.commonChecks(context: Context): Boolean { - val logger = context.logger - // Run all the checks assuming that compilation may terminate after more than one error. +internal fun KSFunctionDeclaration.commonChecks(environment: Environment): Int { + val logger = environment.logger val declaredInAClass = declaredInAClass(logger) val isStatic = isStatic(logger) val acceptsOneOrTwoParameters = acceptsOneOrTwoParameters(logger) return (declaredInAClass - && isStatic - && acceptsOneOrTwoParameters) + + isStatic + + acceptsOneOrTwoParameters) } -private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { +private fun Boolean.toErrorCount(): Int = if (this) 0 else 1 + +private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Int { val isStatic = functionKind == FunctionKind.STATIC if (!isStatic) { logger.error(msg( @@ -65,10 +69,10 @@ private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Boolean { this ) } - return isStatic + return isStatic.toErrorCount() } -private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { +private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Int { val inClass = parentDeclaration is KSClassDeclaration if (!inClass) { // This case is Kotlin-only because in Java a function would belong to a class. @@ -79,10 +83,10 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Boolean { this ) } - return inClass + return inClass.toErrorCount() } -private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): Boolean { +private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): Int { val wrongNumber = parameters.isEmpty() || parameters.size > 2 if (wrongNumber) { logger.error( @@ -91,24 +95,24 @@ private fun KSFunctionDeclaration.acceptsOneOrTwoParameters(logger: KSPLogger): this ) } - return !wrongNumber + return (!wrongNumber).toErrorCount() } -internal fun KSFunctionDeclaration.declaringClass(context: Context): EntityClass? { +internal fun KSFunctionDeclaration.declaringClass(environment: Environment): EntityClass? { val parent = parentDeclaration!!.qualifiedName!! - var declaringClass = context.resolver.getClassDeclarationByName(parent)!! + var declaringClass = environment.resolver.getClassDeclarationByName(parent)!! if (declaringClass.isCompanionObject) { // In Kotlin routing functions are declared in a companion object. // We need the enclosing entity class. declaringClass = declaringClass.parentDeclaration!! as KSClassDeclaration } - if (!context.entityInterface.isAssignableFrom(declaringClass.asStarProjectedType())) { - context.logger.error( - "The declaring class of the ${funRef} annotated with $routeRef" + + if (!environment.entityInterface.isAssignableFrom(declaringClass.asStarProjectedType())) { + environment.logger.error( + "The declaring class of the $funRef annotated with $routeRef" + " must implement the `${Entity::class.java.canonicalName}` interface.", this ) return null } - return EntityClass(declaringClass, context.entityInterface) + return EntityClass(declaringClass, environment.entityInterface) } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt similarity index 94% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index bdd3f8731..e573de41d 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Context.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -32,7 +32,10 @@ import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection -internal class Context( +/** + * Provides instances required for resolving types or reporting errors or warnings. + */ +internal class Environment( val resolver: Resolver, val logger: KSPLogger ) { diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt index 04dea9886..437231b50 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -32,18 +32,18 @@ import io.spine.base.EventMessage import io.spine.core.EventContext internal class EventRouteSignature( - context: Context + environment: Environment ) : RouteSignature( EventMessage::class.java, EventContext::class.java, - context + environment ) { override fun matchDeclaringClass( fn: KSFunctionDeclaration, declaringClass: EntityClass ): Boolean { - val isProjection = context.projectionClass.isAssignableFrom(declaringClass.type) - val isProcessManager = context.processManagerClass.isAssignableFrom(declaringClass.type) + val isProjection = environment.projectionClass.isAssignableFrom(declaringClass.type) + val isProcessManager = environment.processManagerClass.isAssignableFrom(declaringClass.type) return isProjection || isProcessManager } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt index 6a02020e3..320db9934 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -26,8 +26,6 @@ package io.spine.tools.mc.java.routing -import com.google.devtools.ksp.processing.KSPLogger -import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSFunctionDeclaration /** @@ -39,21 +37,22 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration */ internal class Qualifier( private val functions: Sequence, - private val context: Context + private val environment: Environment ) { private var errorCount = 0 - private val cmd = CommandRouteSignature(context) - private val evt = EventRouteSignature(context) + private val cmd = CommandRouteSignature(environment) + private val evt = EventRouteSignature(environment) + private val state = StateUpdateRouteSignature(environment) fun run(): List { val result = mutableListOf() functions.forEach { fn -> - val commonChecksPass = fn.commonChecks(context) - if (!commonChecksPass) { - errorCount += 1 + val commonChecksErrors = fn.commonChecks(environment) + if (commonChecksErrors != 0) { + errorCount += commonChecksErrors return@forEach } - val declaringClass = fn.declaringClass(context) + val declaringClass = fn.declaringClass(environment) if (declaringClass == null) { errorCount += 1 return@forEach @@ -76,6 +75,9 @@ internal class Qualifier( return it } ?: evt.match(fn, declaringClass)?.let { return it - } ?: return null + } ?: state.match(fn, declaringClass)?.let { + return it + } + return null } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt index d39cf3e35..57d67c8ed 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -49,3 +49,10 @@ internal class EventRouteFun( parameters: Pair, returnType: KSType ) : RouteFun(fn, declaringClass, parameters, returnType) + +internal class StateUpdateRouteFun( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType +) : RouteFun(fn, declaringClass, parameters, returnType) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 2cdec1b52..bad4b33e6 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -40,20 +40,18 @@ internal class RouteProcessor( internal val logger: KSPLogger ) : SymbolProcessor { - private lateinit var resolver: Resolver - - private lateinit var context: Context + private lateinit var environment: Environment override fun process(resolver: Resolver): List { - this.resolver = resolver - this.context = Context(resolver, logger) + this.environment = Environment(resolver, logger) val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } - val qualified = RouteSignature.qualify(allValid, context) + val qualified = RouteSignature.qualify(allValid, environment) processCommands(qualified) processEvents(qualified) + processStateUpdates(qualified) val unprocessed = allAnnotated.filterNot { it.validate() }.toList() return unprocessed @@ -63,7 +61,7 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val crv = CommandRouteVisitor(functions, codeGenerator, context) + val crv = CommandRouteVisitor(functions, codeGenerator, environment) declaringClass.accept(crv, Unit) crv.writeFile() } @@ -73,7 +71,17 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val erv = EventRouteVisitor(functions, codeGenerator, context) + val erv = EventRouteVisitor(functions, codeGenerator, environment) + declaringClass.accept(erv, Unit) + erv.writeFile() + } + } + + private fun processStateUpdates(qualified: List) { + val routing = qualified.filterIsInstance() + val grouped = routing.groupByClasses() + grouped.forEach { (declaringClass, functions) -> + val erv = StateUpdateRouteVisitor(functions, codeGenerator, environment) declaringClass.accept(erv, Unit) erv.writeFile() } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index e8106401e..edf8beab0 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -30,11 +30,11 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import funRef -import io.spine.base.SignalMessage import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.qualify +import io.spine.type.KnownMessage /** * The base class for classes checking the contract of the functions with the [Route] annotation. @@ -45,14 +45,20 @@ import io.spine.tools.mc.java.routing.RouteSignature.Companion.qualify * The [qualify] method of the companion object walks through the annotated functions * detected by the [RouteProcessor] matching them to corresponding signature kind and thus * producing proper [RouteFun] instances. + * + * @property messageClass The class of the messages accepted as the first parameter of + * a routing function. + * @property contextClass The class of message contexts accepted as an optional second parameter of + * a routing function. + * @property environment The environment for resolving types and reporting errors and warnings. */ internal sealed class RouteSignature( - protected val signalClass: Class, + protected val messageClass: Class, protected val contextClass: Class, - protected val context: Context + protected val environment: Environment ) { - private val signalType by lazy { signalClass.toType(context.resolver) } - private val contextType by lazy { contextClass.toType(context.resolver) } + private val messageType by lazy { messageClass.toType(environment.resolver) } + private val contextType by lazy { contextClass.toType(environment.resolver) } protected abstract fun matchDeclaringClass( fn: KSFunctionDeclaration, @@ -96,9 +102,9 @@ internal sealed class RouteSignature( /** * Verifies that the given function accepts one or two parameters with - * the types matching [signalClass] and [contextClass]. + * the types matching [messageClass] and [contextClass]. * - * The first parameter must be of [signalClass] or implement the interface specified + * The first parameter must be of [messageClass] or implement the interface specified * by this property. * * The second parameter, if any, must be of the [contextClass] type. @@ -108,7 +114,7 @@ internal sealed class RouteSignature( checkParamSize(fn) val firstParamType = fn.parameters[0].type.resolve() - if (!signalType.isAssignableFrom(firstParamType)) { + if (!messageType.isAssignableFrom(firstParamType)) { // Even if the parameter does not match, it could be another kind of // routing function, so we simply return `false`. return null @@ -121,7 +127,7 @@ internal sealed class RouteSignature( // Here, knowing that the first parameter type is correct, we can complain // about the type of the second parameter. val actualSecondParamName = secondParamType.declaration.simpleName.getShortName() - context.logger.error( + environment.logger.error( "The second parameter of the ${fn.funRef} annotated with $routeRef" + " must be `${contextClass.simpleName}`." + " Encountered: `$actualSecondParamName`.", @@ -148,9 +154,9 @@ internal sealed class RouteSignature( fun qualify( functions: Sequence, - context: Context + environment: Environment ): List { - val qualifier = Qualifier(functions, context) + val qualifier = Qualifier(functions, environment) return qualifier.run() } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index d965eac9d..86853d20b 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -39,7 +39,7 @@ import com.squareup.kotlinpoet.ksp.writeTo internal sealed class RouteVisitor( private val functions: List, protected val codeGenerator: CodeGenerator, - protected val context: Context, + protected val environment: Environment, ) : KSVisitorVoid() { private lateinit var packageName: String @@ -75,8 +75,8 @@ internal sealed class RouteVisitor( internal class CommandRouteVisitor( functions: List, codeGenerator: CodeGenerator, - context: Context -) : RouteVisitor(functions, codeGenerator, context) { + environment: Environment +) : RouteVisitor(functions, codeGenerator, environment) { override val classNameSuffix: String = "$\$CommandRouting" @@ -88,8 +88,8 @@ internal class CommandRouteVisitor( internal class EventRouteVisitor( functions: List, codeGenerator: CodeGenerator, - context: Context -) : RouteVisitor(functions, codeGenerator, context) { + environment: Environment +) : RouteVisitor(functions, codeGenerator, environment) { override val classNameSuffix: String = "$\$EventRouting" @@ -97,3 +97,16 @@ internal class EventRouteVisitor( //TODO:2025-01-22:alexander.yevsyukov: Implement. } } + +internal class StateUpdateRouteVisitor( + functions: List, + codeGenerator: CodeGenerator, + environment: Environment +) : RouteVisitor(functions, codeGenerator, environment) { + + override val classNameSuffix: String = "$\$StateUpdateRouting" + + override fun generateCode(function: KSFunctionDeclaration) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt new file mode 100644 index 000000000..18c1d91ab --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt @@ -0,0 +1,56 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSType +import io.spine.base.EntityState +import io.spine.core.EventContext + +internal class StateUpdateRouteSignature( + environment: Environment +) : RouteSignature( + EntityState::class.java, + EventContext::class.java, + environment +) { + override fun matchDeclaringClass( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): Boolean { + val isProjection = environment.projectionClass.isAssignableFrom(declaringClass.type) + val isProcessManager = environment.processManagerClass.isAssignableFrom(declaringClass.type) + return isProjection || isProcessManager + } + + override fun create( + fn: KSFunctionDeclaration, + declaringClass: EntityClass, + parameters: Pair, + returnType: KSType + ): StateUpdateRouteFun = StateUpdateRouteFun(fn, declaringClass, parameters, returnType) +} From 3a28a08ea874213701b314901c48dc9d22bbcb1a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 26 Jan 2025 19:56:05 +0000 Subject: [PATCH 38/96] Fix matching `KSType`s Also: * Test error of command routing in a project. * Extract common test setup into an abstract base class. --- .../mc/java/routing/CommandRouteSignature.kt | 2 +- .../tools/mc/java/routing/Environment.kt | 3 +- .../mc/java/routing/EventRouteSignature.kt | 19 ++- .../io/spine/tools/mc/java/routing/Exts.kt | 6 + .../spine/tools/mc/java/routing/Qualifier.kt | 15 +- .../tools/mc/java/routing/RouteSignature.kt | 2 +- .../java/routing/StateUpdateRouteSignature.kt | 6 +- .../tools/mc/java/routing/ErrorSpecExts.kt | 34 +++-- .../tools/mc/java/routing/ErrorSpecTest.kt | 66 +++++++++ ...essorJavaErrorSpec.kt => JavaErrorSpec.kt} | 72 ++++++---- ...rKotlinErrorSpec.kt => KotlinErrorSpec.kt} | 131 +++++++----------- 11 files changed, 218 insertions(+), 138 deletions(-) create mode 100644 mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{RouteProcessorJavaErrorSpec.kt => JavaErrorSpec.kt} (82%) rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{RouteProcessorKotlinErrorSpec.kt => KotlinErrorSpec.kt} (80%) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt index 1d46f72f5..55dabfca0 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt @@ -41,7 +41,7 @@ internal class CommandRouteSignature( override fun matchDeclaringClass( fn: KSFunctionDeclaration, declaringClass: EntityClass - ): Boolean = with(environment) { + ): Boolean = environment.run { val isAggregate = aggregateClass.isAssignableFrom(declaringClass.type) val isProcessManager = processManagerClass.isAssignableFrom(declaringClass.type) val match = isAggregate || isProcessManager diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index e573de41d..88ad188df 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -28,6 +28,7 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver +import io.spine.server.aggregate.Aggregate import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection @@ -40,7 +41,7 @@ internal class Environment( val logger: KSPLogger ) { val entityInterface by lazy { Entity::class.java.toType(resolver) } - val aggregateClass by lazy { ProcessManager::class.java.toType(resolver) } + val aggregateClass by lazy { Aggregate::class.java.toType(resolver) } val projectionClass by lazy { Projection::class.java.toType(resolver) } val processManagerClass by lazy { ProcessManager::class.java.toType(resolver) } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt index 437231b50..ccc4221c1 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -41,10 +41,21 @@ internal class EventRouteSignature( override fun matchDeclaringClass( fn: KSFunctionDeclaration, declaringClass: EntityClass - ): Boolean { - val isProjection = environment.projectionClass.isAssignableFrom(declaringClass.type) - val isProcessManager = environment.processManagerClass.isAssignableFrom(declaringClass.type) - return isProjection || isProcessManager + ): Boolean = environment.run { + val isAggregate = aggregateClass.isAssignableFrom(declaringClass.type) + val isProjection = projectionClass.isAssignableFrom(declaringClass.type) + val isProcessManager = processManagerClass.isAssignableFrom(declaringClass.type) + val match = isAggregate || isProjection || isProcessManager + if (!match) { + val parent = declaringClass.superClass() + logger.error( + "An event routing function can be declared in a class derived" + + " from ${processManagerClass.ref} or ${aggregateClass.ref} or" + + " ${projectionClass.ref}." + + " Encountered: ${parent.qualifiedRef}.", + fn) + } + return match } override fun create( diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt index 03232bea2..f8c71fef6 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt @@ -54,3 +54,9 @@ internal fun Class<*>.toType(resolver: Resolver): KSType { internal fun String.pluralize(count: Int, pluralForm: String? = null): String { return if (count == 1) this else pluralForm ?: "${this}s" } + +/** + * Tells if this type has the same qualified name as the given one. + */ +internal fun KSType.isSame(other: KSType): Boolean = + declaration.qualifiedName?.asString() == other.declaration.qualifiedName?.asString() diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt index 320db9934..bae727b9a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -27,6 +27,7 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef /** * The helper class which transforms the incoming sequence with [functions] into @@ -40,9 +41,9 @@ internal class Qualifier( private val environment: Environment ) { private var errorCount = 0 - private val cmd = CommandRouteSignature(environment) - private val evt = EventRouteSignature(environment) - private val state = StateUpdateRouteSignature(environment) + private val commandRoutes = CommandRouteSignature(environment) + private val eventRoutes = EventRouteSignature(environment) + private val stateRoutes = StateUpdateRouteSignature(environment) fun run(): List { val result = mutableListOf() @@ -65,17 +66,17 @@ internal class Qualifier( } } if (errorCount > 0) { - error("${"Error".pluralize(errorCount)} using ${RouteSignature.Companion.routeRef}.") + error("${"Error".pluralize(errorCount)} using $routeRef.") } return result } private fun qualify(fn: KSFunctionDeclaration, declaringClass: EntityClass): RouteFun? { - cmd.match(fn, declaringClass)?.let { + commandRoutes.match(fn, declaringClass)?.let { return it - } ?: evt.match(fn, declaringClass)?.let { + } ?: eventRoutes.match(fn, declaringClass)?.let { return it - } ?: state.match(fn, declaringClass)?.let { + } ?: stateRoutes.match(fn, declaringClass)?.let { return it } return null diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index edf8beab0..c9149e357 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -122,7 +122,7 @@ internal sealed class RouteSignature( var secondParamType: KSType? = null if (fn.parameters.size == 2) { secondParamType = fn.parameters[1].type.resolve() - val match = contextType == secondParamType + val match = contextType.isSame(secondParamType) if (!match) { // Here, knowing that the first parameter type is correct, we can complain // about the type of the second parameter. diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt index 18c1d91ab..f945c2b84 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt @@ -41,9 +41,9 @@ internal class StateUpdateRouteSignature( override fun matchDeclaringClass( fn: KSFunctionDeclaration, declaringClass: EntityClass - ): Boolean { - val isProjection = environment.projectionClass.isAssignableFrom(declaringClass.type) - val isProcessManager = environment.processManagerClass.isAssignableFrom(declaringClass.type) + ): Boolean = environment.run { + val isProjection = projectionClass.isAssignableFrom(declaringClass.type) + val isProcessManager = processManagerClass.isAssignableFrom(declaringClass.type) return isProjection || isProcessManager } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt index 6e2a520a3..c40705b10 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt @@ -28,6 +28,7 @@ package io.spine.tools.mc.java.routing import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.SourceFile.Companion.java +import com.tschuchort.compiletesting.SourceFile.Companion.kotlin import java.io.File import org.intellij.lang.annotations.Language @@ -42,23 +43,28 @@ internal fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.l */ private val packageDir = "io/spine/given/devices" -/** - * Obtains a file name with the package directories for a Java class with the given simple name. - */ -private fun javaFn(simpleName: String): String = "$packageDir/${simpleName}.java" - -/** - * Obtains a file name with the package directories for a Kotlin file with the given name. - */ -internal fun kotlinFile(simpleName: String): String = "$packageDir/${simpleName}.kt" - /** * Creates an instance of [SourceFile] with the Java file containing the class - * with the specified name. + * with the specified name and contents. */ internal fun javaFile( simpleClassName: String, @Language("java") contents: String -): SourceFile { - return java(name = javaFn(simpleClassName), contents = contents, trimIndent = true) -} +): SourceFile = java( + name = "$packageDir/${simpleClassName}.java", + contents = contents, + trimIndent = true +) + +/** + * Creates an instance of [SourceFile] with the Kotlin file containing the class + * with the specified name and contents. + */ +internal fun kotlinFile( + simpleClassName: String, + @Language("kotlin") contents: String +): SourceFile = kotlin( + name = "$packageDir/${simpleClassName}.kt", + contents = contents, + trimIndent = true +) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt new file mode 100644 index 000000000..afb6b9b75 --- /dev/null +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt @@ -0,0 +1,66 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.tschuchort.compiletesting.KotlinCompilation +import com.tschuchort.compiletesting.symbolProcessorProviders +import io.spine.base.CommandMessage +import io.spine.core.EventContext +import io.spine.given.devices.Device +import io.spine.server.route.Route +import kotlin.collections.plus +import org.junit.jupiter.api.BeforeEach + +/** + * Abstract base for tests checking handling errors using the [Route] annotation. + * + * The tests use types from the Protobuf code generated for the `given.devices` proto package. + */ +sealed class ErrorSpecTest { + + protected lateinit var compilation: KotlinCompilation + + @BeforeEach + fun prepareCompilation() { + compilation = KotlinCompilation() + val baseJar = CommandMessage::class.java.classpathFile() + val coreJar = EventContext::class.java.classpathFile() + val serverJar = Route::class.java.classpathFile() + val compiledProtos = Device::class.java.classpathFile() + + compilation.apply { + javaPackagePrefix = "io.spine.routing.given" + symbolProcessorProviders = listOf(RouteProcessorProvider()) + classpaths = classpaths + listOf( + baseJar, + coreJar, + serverJar, + compiledProtos + ) + } + } +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt similarity index 82% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt index c7920a362..a95bcb3fa 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorJavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt @@ -31,49 +31,24 @@ package io.spine.tools.mc.java.routing -import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR -import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain -import io.spine.base.CommandMessage import io.spine.core.CommandContext import io.spine.core.EventContext -import io.spine.given.devices.Device +import io.spine.server.aggregate.Aggregate import io.spine.server.entity.Entity -import io.spine.server.route.Route +import io.spine.server.procman.ProcessManager +import io.spine.server.projection.Projection import io.spine.string.simply import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi -import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @ExperimentalCompilerApi @DisplayName("`RouteProcessor` should detect Java code errors") -internal class RouteProcessorJavaErrorSpec { - - private lateinit var compilation: KotlinCompilation - - @BeforeEach - fun prepareCompilation() { - compilation = KotlinCompilation() - val baseJar = CommandMessage::class.java.classpathFile() - val coreJar = EventContext::class.java.classpathFile() - val serverJar = Route::class.java.classpathFile() - val compiledProtos = Device::class.java.classpathFile() - - compilation.apply { - javaPackagePrefix = "io.spine.routing.given" - symbolProcessorProviders = listOf(RouteProcessorProvider()) - classpaths = classpaths + listOf( - baseJar, - coreJar, - serverJar, - compiledProtos - ) - } - } +internal class JavaErrorSpec : ErrorSpecTest() { /* * Error: non-static method. @@ -248,5 +223,44 @@ internal class RouteProcessorJavaErrorSpec { it shouldContain " must implement the `${Entity::class.java.canonicalName}` interface." } } + + /** + * Error: Command route method declared in a projection class. + */ + private val wrongSignalRouted = javaFile("WrongSignalRouted", """ + + package io.spine.given.devices; + + import io.spine.core.CommandContext; + import io.spine.given.devices.commands.RegisterDevice; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class WrongSignalRouted extends Projection { + + @Route + static DeviceId route(RegisterDevice command, CommandContext context) { + // Commands are automatically routed by the first message field. + // We add this method with meaningless routing just to cause the error. + return command.getDevice(); + } + } + """.trimIndent()) + + @Test + fun `when a command routing declared in a non-applicable class`() { + compilation.apply { + sources = listOf(wrongSignalRouted) + } + val result = compilation.compile() + result.exitCode shouldBe COMPILATION_ERROR + result.messages.let { + it shouldContain "A command routing function can be declared in a class derived" + it shouldContain simply>() + it shouldContain simply>() + it shouldContain routeRef + it shouldContain " Encountered: `${Projection::class.java.canonicalName}`." + } + } } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt similarity index 80% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt index 78805d8f7..31bd38ab9 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteProcessorKotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt @@ -49,27 +49,21 @@ import org.junit.jupiter.api.Test @ExperimentalCompilerApi @DisplayName("`RouteProcessor` should detect Kotlin code errors") -internal class RouteProcessorKotlinErrorSpec { +internal class KotlinErrorSpec : ErrorSpecTest() { - private lateinit var compilation: KotlinCompilation - - @BeforeEach - fun prepareCompilation() { - compilation = KotlinCompilation() - val baseJar = EventMessage::class.java.classpathFile() - val serverJar = Route::class.java.classpathFile() - val compiledProtos = Device::class.java.classpathFile() - - compilation.apply { - javaPackagePrefix = "io.spine.routing.given" - symbolProcessorProviders = listOf(RouteProcessorProvider()) - classpaths = classpaths + listOf( - baseJar, - serverJar, - compiledProtos - ) - } - } + /** + * Error: The function must be a static method of a class. + */ + private val fileLevelFunction = kotlinFile("FileLevelFunction", """ + + package io.spine.given.devices + + import io.spine.base.EventMessage + import io.spine.server.route.Route + + @Route + private fun route(e: EventMessage): String = "Hello" + """.trimIndent()) @Test fun `when a function is defined on a file level`() { @@ -88,6 +82,27 @@ internal class RouteProcessorKotlinErrorSpec { } } + /** + * Error: The method must be annotated as `JvmStatic`. + */ + private val notJvmStatic = kotlinFile("NotJvmStatic", """ + package io.spine.given.devices + + import io.spine.given.devices.events.StatusReported + import io.spine.server.projection.Projection + import io.spine.server.route.Route + + class NotJvmStatic : Projection() { + + companion object { + @Route + fun route(e: StatusReported): DeviceId { + return event.getDevice() + } + } + } + """.trimIndent()) + @Test fun `when a function is not 'JvmStatic''`() { compilation.apply { @@ -105,6 +120,24 @@ internal class RouteProcessorKotlinErrorSpec { } } + /** + * Error: The method must belong to a companion object. + */ + private val notCompanionMember = kotlinFile("NotCompanionMember", """ + package io.spine.given.devices + + import io.spine.given.devices.events.StatusReported + import io.spine.server.projection.Projection + import io.spine.server.route.Route + + class NotCompanionMember : Projection() { + @Route + fun route(e: StatusReported): DeviceId { + return event.getDevice() + } + } + """.trimIndent()) + @Test fun `when a function is not a member of a companion object`() { compilation.apply { @@ -123,61 +156,3 @@ internal class RouteProcessorKotlinErrorSpec { } } } - -/** - * Error: The function must be a static method of a class. - */ -private val fileLevelFunction = SourceFile.kotlin( - kotlinFile("FileLevelFunction"), """ - package io.spine.given.devices - - import io.spine.base.EventMessage - import io.spine.server.route.Route - - @Route - private fun route(e: EventMessage): String = "Hello" - """.trimIndent() -) - -/** - * Error: The method must be annotated as `JvmStatic`. - */ -private val notJvmStatic = SourceFile.kotlin( - kotlinFile("NotJvmStatic"), """ - package io.spine.given.devices - - import io.spine.given.devices.events.StatusReported - import io.spine.server.projection.Projection - import io.spine.server.route.Route - - class NotJvmStatic : Projection() { - - companion object { - @Route - fun route(e: StatusReported): DeviceId { - return event.getDevice() - } - } - } - """.trimIndent() -) - -/** - * Error: The method must belong to a companion object. - */ -private val notCompanionMember = SourceFile.kotlin( - kotlinFile("NotCompanionMember"), """ - package io.spine.given.devices - - import io.spine.given.devices.events.StatusReported - import io.spine.server.projection.Projection - import io.spine.server.route.Route - - class NotCompanionMember : Projection() { - @Route - fun route(e: StatusReported): DeviceId { - return event.getDevice() - } - } - """.trimIndent() -) From e6aa38e46c005de54ef13e289b1e7f06d45af4d6 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 26 Jan 2025 21:21:49 +0000 Subject: [PATCH 39/96] Update dependency reports --- dependencies.md | 416 +++++++++++++++++++++++++++++++++++++++++++++--- pom.xml | 38 ++++- 2 files changed, 429 insertions(+), 25 deletions(-) diff --git a/dependencies.md b/dependencies.md index fc056a2f3..41233fb15 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1030,7 +1030,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1937,7 +1937,7 @@ This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2844,7 +2844,7 @@ This report was generated on **Mon Jan 13 19:25:57 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3660,7 +3660,7 @@ This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4567,7 +4567,7 @@ This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5340,7 +5340,7 @@ This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -6247,7 +6247,7 @@ This report was generated on **Mon Jan 13 19:25:58 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7020,7 +7020,7 @@ This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7927,7 +7927,7 @@ This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -8700,7 +8700,7 @@ This report was generated on **Mon Jan 13 19:25:59 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -9607,7 +9607,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -10380,7 +10380,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -11366,7 +11366,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -11374,6 +11374,18 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice # Dependencies of `io.spine.tools:spine-mc-java-routing:2.0.0-SNAPSHOT.263` ## Runtime +1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. + * **Project URL:** [http://source.android.com/](http://source.android.com/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. + * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. + * **Project URL:** [https://github.com/google/auto/tree/main/service](https://github.com/google/auto/tree/main/service) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11382,7 +11394,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.8.22-1.0.11. * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11416,10 +11428,62 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice 1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-ksp. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. + * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) +1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. + * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11500,6 +11564,22 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://www.github.com/KevinStern/software-and-algorithms](https://www.github.com/KevinStern/software-and-algorithms) * **License:** [MIT License](http://www.opensource.org/licenses/mit-license.php) +1. **Group** : com.github.tschuchortdev. **Name** : kotlin-compile-testing. **Version** : 1.5.0. + * **Project URL:** [https://github.com/tschuchortdev/kotlin-compile-testing](https://github.com/tschuchortdev/kotlin-compile-testing) + * **License:** [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/) + +1. **Group** : com.github.tschuchortdev. **Name** : kotlin-compile-testing-ksp. **Version** : 1.5.0. + * **Project URL:** [https://github.com/tschuchortdev/kotlin-compile-testing](https://github.com/tschuchortdev/kotlin-compile-testing) + * **License:** [Mozilla Public License 2.0](https://www.mozilla.org/en-US/MPL/2.0/) + +1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. + * **Project URL:** [http://source.android.com/](http://source.android.com/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. + * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.2. * **Project URL:** [https://github.com/google/auto/tree/main/common](https://github.com/google/auto/tree/main/common) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11520,7 +11600,15 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing. **Version** : 1.8.22-1.0.11. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.8.22-1.0.11. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-cmdline. **Version** : 1.8.22-1.0.11. * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11548,6 +11636,14 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/error-prone-javac](https://github.com/google/error-prone-javac) * **License:** [GNU General Public License, version 2, with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html) +1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. + * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) + * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.flogger. **Name** : flogger-system-backend. **Version** : 0.7.4. + * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) + * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11606,6 +11702,34 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) +1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. + * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 1.14.2. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-ksp. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup.okio. **Name** : okio. **Version** : 3.6.0. + * **Project URL:** [https://github.com/square/okio/](https://github.com/square/okio/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup.okio. **Name** : okio-jvm. **Version** : 3.6.0. + * **Project URL:** [https://github.com/square/okio/](https://github.com/square/okio/) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11618,10 +11742,18 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : dev.zacsweers.autoservice. **Name** : auto-service-ksp. **Version** : 1.1.0. + * **Project URL:** [https://github.com/ZacSweers/auto-service-ksp](https://github.com/ZacSweers/auto-service-ksp) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.7.4. * **Project URL:** [https://picocli.info](https://picocli.info) * **License:** [The Apache Software License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.github.classgraph. **Name** : classgraph. **Version** : 4.8.156. + * **Project URL:** [https://github.com/classgraph/classgraph](https://github.com/classgraph/classgraph) + * **License:** [The MIT License (MIT)](http://opensource.org/licenses/MIT) + 1. **Group** : io.github.davidburstrom.contester. **Name** : contester-breakpoint. **Version** : 0.2.0. * **Project URL:** [https://github.com/davidburstrom/contester](https://github.com/davidburstrom/contester) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11733,10 +11865,86 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : protoc-gen-grpc-java. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-api. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-api-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. + * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : it.unimi.dsi. **Name** : fastutil-core. **Version** : 8.5.12. * **Project URL:** [http://fastutil.di.unimi.it/](http://fastutil.di.unimi.it/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) +1. **Group** : javax.annotation. **Name** : javax.annotation-api. **Version** : 1.3.2. + * **Project URL:** [http://jcp.org/en/jsr/detail?id=250](http://jcp.org/en/jsr/detail?id=250) + * **License:** [CDDL + GPLv2 with classpath exception](https://github.com/javaee/javax.annotation/blob/master/LICENSE) + 1. **Group** : javax.inject. **Name** : javax.inject. **Version** : 1. * **Project URL:** [http://code.google.com/p/atinject/](http://code.google.com/p/atinject/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11750,6 +11958,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **License:** [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [LGPL, version 2.1](http://www.gnu.org/licenses/licenses.html) +1. **Group** : net.ltgt.gradle. **Name** : gradle-errorprone-plugin. **Version** : 3.1.0.**No license information found** 1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 12.2. * **Project URL:** [http://www.saxonica.com/](http://www.saxonica.com/) * **License:** [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/2.0/) @@ -11789,10 +11998,19 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.3. + * **Project URL:** [https://checkerframework.org](https://checkerframework.org) + * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) +1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. + * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.codehaus.woodstox. **Name** : stax2-api. **Version** : 4.2.1. * **Project URL:** [http://github.com/FasterXML/stax2-api](http://github.com/FasterXML/stax2-api) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11816,6 +12034,14 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **License:** [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) * **License:** [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html) +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-api. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-jdt. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11844,10 +12070,18 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.dokka. **Name** : gfm-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.dokka. **Name** : jekyll-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11856,6 +12090,14 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/intellij-deps-trove4j](https://github.com/JetBrains/intellij-deps-trove4j) * **License:** [GNU LESSER GENERAL PUBLIC LICENSE 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-annotation-processing-embeddable. **Version** : 1.8.0. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.21. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11928,6 +12170,10 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlinx. **Name** : atomicfu. **Version** : 0.23.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.atomicfu](https://github.com/Kotlin/kotlinx.atomicfu) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.9.0. * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11940,6 +12186,10 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-jdk8. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.8.1. * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12021,7 +12271,7 @@ This report was generated on **Mon Jan 13 19:26:00 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -12029,6 +12279,14 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice # Dependencies of `io.spine.tools:spine-mc-java-routing-tests:2.0.0-SNAPSHOT.263` ## Runtime +1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. + * **Project URL:** [http://source.android.com/](http://source.android.com/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. + * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12067,10 +12325,50 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice 1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. + * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) +1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. + * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12151,6 +12449,14 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://www.github.com/KevinStern/software-and-algorithms](https://www.github.com/KevinStern/software-and-algorithms) * **License:** [MIT License](http://www.opensource.org/licenses/mit-license.php) +1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. + * **Project URL:** [http://source.android.com/](http://source.android.com/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) + +1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. + * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) + * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.auto. **Name** : auto-common. **Version** : 1.2.2. * **Project URL:** [https://github.com/google/auto/tree/main/common](https://github.com/google/auto/tree/main/common) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12171,11 +12477,15 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/gson/gson](https://github.com/google/gson/gson) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing. **Version** : 1.9.24-1.0.20. +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing. **Version** : 1.8.22-1.0.11. * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.9.24-1.0.20. +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-api. **Version** : 1.8.22-1.0.11. + * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.devtools.ksp. **Name** : symbol-processing-cmdline. **Version** : 1.8.22-1.0.11. * **Project URL:** [https://goo.gle/ksp](https://goo.gle/ksp) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12261,6 +12571,18 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-ksp. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12388,10 +12710,50 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://detekt.dev](https://detekt.dev) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. + * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : it.unimi.dsi. **Name** : fastutil-core. **Version** : 8.5.12. * **Project URL:** [http://fastutil.di.unimi.it/](http://fastutil.di.unimi.it/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.html) +1. **Group** : javax.annotation. **Name** : javax.annotation-api. **Version** : 1.3.2. + * **Project URL:** [http://jcp.org/en/jsr/detail?id=250](http://jcp.org/en/jsr/detail?id=250) + * **License:** [CDDL + GPLv2 with classpath exception](https://github.com/javaee/javax.annotation/blob/master/LICENSE) + 1. **Group** : javax.inject. **Name** : javax.inject. **Version** : 1. * **Project URL:** [http://code.google.com/p/atinject/](http://code.google.com/p/atinject/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12448,6 +12810,10 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) +1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. + * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.codehaus.woodstox. **Name** : stax2-api. **Version** : 4.2.1. * **Project URL:** [http://github.com/FasterXML/stax2-api](http://github.com/FasterXML/stax2-api) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12511,6 +12877,10 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/JetBrains/intellij-deps-trove4j](https://github.com/JetBrains/intellij-deps-trove4j) * **License:** [GNU LESSER GENERAL PUBLIC LICENSE 2.1](https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html) +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler. **Version** : 1.8.22. + * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) + * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-compiler-embeddable. **Version** : 1.8.21. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12676,7 +13046,7 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -13583,7 +13953,7 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -14356,7 +14726,7 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -15263,7 +15633,7 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -16036,4 +16406,4 @@ This report was generated on **Mon Jan 13 19:26:01 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Jan 13 19:26:02 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 2f9572b93..65e0a8d60 100644 --- a/pom.xml +++ b/pom.xml @@ -26,7 +26,7 @@ all modules and does not describe the project structure per-subproject. com.google.devtools.ksp symbol-processing-api - 1.9.24-1.0.20 + 1.8.22-1.0.11 compile @@ -41,6 +41,18 @@ all modules and does not describe the project structure per-subproject. 0.9.4 compile + + com.squareup + kotlinpoet + 2.0.0 + compile + + + com.squareup + kotlinpoet-ksp + 2.0.0 + compile + io.spine protodata @@ -131,6 +143,12 @@ all modules and does not describe the project structure per-subproject. 1.9.24 compile + + com.github.tschuchortdev + kotlin-compile-testing-ksp + 1.5.0 + test + com.google.errorprone error_prone_test_helpers @@ -161,6 +179,12 @@ all modules and does not describe the project structure per-subproject. 1.1.5 test + + io.kotest + kotest-assertions-core + 5.8.0 + test + io.spine.protodata protodata-testlib @@ -242,7 +266,12 @@ all modules and does not describe the project structure per-subproject. com.google.devtools.ksp symbol-processing - 1.9.24-1.0.20 + 1.8.22-1.0.11 + + + com.google.devtools.ksp + symbol-processing-cmdline + 1.8.22-1.0.11 com.google.errorprone @@ -276,6 +305,11 @@ all modules and does not describe the project structure per-subproject. checkstyle 10.12.1 + + dev.zacsweers.autoservice + auto-service-ksp + 1.1.0 + io.gitlab.arturbosch.detekt detekt-cli From e8b8e5afbec878b3ddf69dc76a54d0f2c0acced8 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 26 Jan 2025 21:22:35 +0000 Subject: [PATCH 40/96] Suppress Kotlin compilation console output Also: * Suppress `ReturnCount`. --- mc-java-routing/build.gradle.kts | 2 ++ .../spine/tools/mc/java/routing/Qualifier.kt | 1 + .../tools/mc/java/routing/RouteSignature.kt | 1 + .../tools/mc/java/routing/ErrorSpecExts.kt | 19 ++++++++++++++++++- .../tools/mc/java/routing/ErrorSpecTest.kt | 16 ++++++++++++++++ .../tools/mc/java/routing/JavaErrorSpec.kt | 12 ++++++------ .../tools/mc/java/routing/KotlinErrorSpec.kt | 13 +++---------- 7 files changed, 47 insertions(+), 17 deletions(-) diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 50724fac6..98d2a6fa7 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -30,6 +30,7 @@ import io.spine.dependency.lib.AutoServiceKsp import io.spine.dependency.lib.Kotlin import io.spine.dependency.lib.KotlinPoet import io.spine.dependency.local.CoreJava +import io.spine.dependency.local.Logging import io.spine.dependency.test.Kotest import io.spine.dependency.test.KotlinCompileTesting @@ -50,6 +51,7 @@ dependencies { testImplementation(Kotest.assertions) testImplementation(KotlinCompileTesting.libKsp) + testImplementation(Logging.testLib) } configurations diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt index bae727b9a..7da1dfc94 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -71,6 +71,7 @@ internal class Qualifier( return result } + @Suppress("ReturnCount") private fun qualify(fn: KSFunctionDeclaration, declaringClass: EntityClass): RouteFun? { commandRoutes.match(fn, declaringClass)?.let { return it diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt index c9149e357..4865972ea 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt @@ -110,6 +110,7 @@ internal sealed class RouteSignature( * The second parameter, if any, must be of the [contextClass] type. */ @OverridingMethodsMustInvokeSuper + @Suppress("ReturnCount") protected open fun matchParameters(fn: KSFunctionDeclaration): Pair? { checkParamSize(fn) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt index c40705b10..4f5510576 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt @@ -26,9 +26,11 @@ package io.spine.tools.mc.java.routing +import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.SourceFile import com.tschuchort.compiletesting.SourceFile.Companion.java import com.tschuchort.compiletesting.SourceFile.Companion.kotlin +import io.spine.logging.testing.tapConsole import java.io.File import org.intellij.lang.annotations.Language @@ -41,7 +43,8 @@ internal fun Class<*>.classpathFile(): File = File(protectionDomain.codeSource.l * The package directory is `io/spine/given/devices/` which matches the options of * proto types defined under `test/proto/given/devices/`. */ -private val packageDir = "io/spine/given/devices" +@Suppress("TopLevelPropertyNaming") +private const val packageDir = "io/spine/given/devices" /** * Creates an instance of [SourceFile] with the Java file containing the class @@ -68,3 +71,17 @@ internal fun kotlinFile( contents = contents, trimIndent = true ) + +/** + * Performs compilation with redirected console output. + * + * @see io.spine.logging.testing.ConsoleTap.install + * @see tapConsole + */ +internal fun KotlinCompilation.compileSilently(): KotlinCompilation.Result { + var result: KotlinCompilation.Result? = null + tapConsole { + result = compile() + } + return result!! +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt index afb6b9b75..4c744b50c 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt @@ -31,8 +31,10 @@ import com.tschuchort.compiletesting.symbolProcessorProviders import io.spine.base.CommandMessage import io.spine.core.EventContext import io.spine.given.devices.Device +import io.spine.logging.testing.ConsoleTap import io.spine.server.route.Route import kotlin.collections.plus +import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.BeforeEach /** @@ -42,6 +44,20 @@ import org.junit.jupiter.api.BeforeEach */ sealed class ErrorSpecTest { + companion object { + + /** + * Suppress excessive console output produced by [KotlinCompilation.compile]. + * + * @see Related issue + * @see KotlinCompilation.compileSilently + */ + @BeforeAll + @JvmStatic + fun redirectStreams() { + ConsoleTap.install() + } + } protected lateinit var compilation: KotlinCompilation @BeforeEach diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt index a95bcb3fa..2b36f8b58 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt @@ -74,7 +74,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(nonStatic) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { @@ -108,7 +108,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(noParameters) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "The method `route()`" @@ -142,7 +142,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(tooManyParameters) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "The method `route()`" @@ -176,7 +176,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(wrongSecondParameter) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "The second parameter of the method `route()`" @@ -215,7 +215,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(nonEntityClass) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "The declaring class of the method `route()`" @@ -252,7 +252,7 @@ internal class JavaErrorSpec : ErrorSpecTest() { compilation.apply { sources = listOf(wrongSignalRouted) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { it shouldContain "A command routing function can be declared in a class derived" diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt index 31bd38ab9..4e5f63075 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt @@ -31,19 +31,12 @@ package io.spine.tools.mc.java.routing -import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR -import com.tschuchort.compiletesting.SourceFile -import com.tschuchort.compiletesting.symbolProcessorProviders import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain -import io.spine.base.EventMessage -import io.spine.given.devices.Device -import io.spine.server.route.Route import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi -import org.junit.jupiter.api.BeforeEach import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test @@ -71,7 +64,7 @@ internal class KotlinErrorSpec : ErrorSpecTest() { sources = listOf(fileLevelFunction) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { @@ -109,7 +102,7 @@ internal class KotlinErrorSpec : ErrorSpecTest() { sources = listOf(notJvmStatic) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { @@ -144,7 +137,7 @@ internal class KotlinErrorSpec : ErrorSpecTest() { sources = listOf(notCompanionMember) } - val result = compilation.compile() + val result = compilation.compileSilently() result.exitCode shouldBe COMPILATION_ERROR result.messages.let { From 029e6a66be159b07aeced7928bd29d66cdf0b14b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 26 Jan 2025 21:25:09 +0000 Subject: [PATCH 41/96] Update dependency report --- pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pom.xml b/pom.xml index 65e0a8d60..02366594a 100644 --- a/pom.xml +++ b/pom.xml @@ -191,6 +191,12 @@ all modules and does not describe the project structure per-subproject. 0.91.1 test + + io.spine.tools + spine-logging-testlib + 2.0.0-SNAPSHOT.242 + test + io.spine.tools spine-plugin-testlib From 98df2b457756c9a886689d7bbad0d3c18e71a47f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 27 Jan 2025 13:13:04 +0000 Subject: [PATCH 42/96] Improve file name --- .../io/spine/tools/mc/java/routing/{ErrorSpecExts.kt => Exts.kt} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{ErrorSpecExts.kt => Exts.kt} (100%) diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/Exts.kt similarity index 100% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecExts.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/Exts.kt From d4affe5557e776662c26deed567c869d9a677dd4 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 27 Jan 2025 19:38:55 +0000 Subject: [PATCH 43/96] Add stub context for routing integration test Also: * Fix static check for Kotlin. * Make the generated routing classes `internal`. --- mc-java-routing-tests/build.gradle.kts | 15 +++- .../spine/given/home/events/DeviceEvent.java | 37 +++++++++ .../given/home/events/RoomDeviceEvent.java | 33 ++++++++ .../io/spine/given/home/events/RoomEvent.java | 37 +++++++++ .../spine/given/home/events/package-info.java | 33 ++++++++ .../io/spine/given/home/RoomProjection.kt | 70 ++++++++++++++++ .../proto/given/home/commands.proto | 59 ++++++++++++++ .../proto/given/home/entities.proto | 59 ++++++++++++++ .../proto/given/home/events.proto | 79 +++++++++++++++++++ .../proto/given/home/values.proto | 57 +++++++++++++ .../tools/mc/java/routing/CommonChecks.kt | 8 +- .../spine/tools/mc/java/routing/Qualifier.kt | 3 + .../tools/mc/java/routing/RouteVisitor.kt | 10 ++- .../tools/mc/java/routing/ErrorSpecTest.kt | 2 + .../tools/mc/java/routing/KotlinErrorSpec.kt | 32 ++++++++ .../mc/java/routing/{Exts.kt => TestExts.kt} | 0 .../test/proto/given/devices/entities.proto | 2 + 17 files changed, 528 insertions(+), 8 deletions(-) create mode 100644 mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/DeviceEvent.java create mode 100644 mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomDeviceEvent.java create mode 100644 mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomEvent.java create mode 100644 mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/package-info.java create mode 100644 mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt create mode 100644 mc-java-routing-tests/src/testFixtures/proto/given/home/commands.proto create mode 100644 mc-java-routing-tests/src/testFixtures/proto/given/home/entities.proto create mode 100644 mc-java-routing-tests/src/testFixtures/proto/given/home/events.proto create mode 100644 mc-java-routing-tests/src/testFixtures/proto/given/home/values.proto rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{Exts.kt => TestExts.kt} (100%) diff --git a/mc-java-routing-tests/build.gradle.kts b/mc-java-routing-tests/build.gradle.kts index 3c50bf7c4..f65bcf380 100644 --- a/mc-java-routing-tests/build.gradle.kts +++ b/mc-java-routing-tests/build.gradle.kts @@ -30,15 +30,16 @@ plugins { kotlin("jvm") ksp `java-test-fixtures` + id("io.spine.mc-java") } dependencies { - implementation(kotlin("stdlib")) - implementation(CoreJava.server) + testImplementation(kotlin("stdlib")) kspTest(project(":mc-java-routing")) kspTestFixtures(project(":mc-java-routing")) + testFixturesImplementation(CoreJava.server) } - + kotlin { sourceSets.main { kotlin.srcDir("build/generated/ksp/main/kotlin") @@ -50,3 +51,11 @@ kotlin { kotlin.srcDir("build/generated/ksp/testFixtures/kotlin") } } + +// Avoid Gradle warning on disabled execution optimization because of the absence of +// explicit or implicit dependencies. +afterEvaluate { + val kspTestFixturesKotlin by tasks.getting + val launchTestFixturesProtoData by tasks.getting + kspTestFixturesKotlin.dependsOn(launchTestFixturesProtoData) +} diff --git a/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/DeviceEvent.java b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/DeviceEvent.java new file mode 100644 index 000000000..230eebb65 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/DeviceEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.given.home.events; + +import io.spine.annotation.GeneratedMixin; +import io.spine.base.EventMessage; + +import io.spine.given.home.DeviceId; + +@GeneratedMixin +public interface DeviceEvent extends EventMessage{ + DeviceId getDevice(); +} diff --git a/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomDeviceEvent.java b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomDeviceEvent.java new file mode 100644 index 000000000..7643be197 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomDeviceEvent.java @@ -0,0 +1,33 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.given.home.events; + +import io.spine.annotation.GeneratedMixin; + +@GeneratedMixin +public interface RoomDeviceEvent extends RoomEvent, DeviceEvent { +} diff --git a/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomEvent.java b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomEvent.java new file mode 100644 index 000000000..a699766f5 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/RoomEvent.java @@ -0,0 +1,37 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.given.home.events; + +import io.spine.annotation.GeneratedMixin; +import io.spine.base.EventMessage; + +import io.spine.given.home.RoomId; + +@GeneratedMixin +public interface RoomEvent extends EventMessage { + RoomId getRoom(); +} diff --git a/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/package-info.java b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/package-info.java new file mode 100644 index 000000000..3d2b39e4e --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/java/io/spine/given/home/events/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@CheckReturnValue +@ParametersAreNonnullByDefault +package io.spine.given.home.events; + +import com.google.errorprone.annotations.CheckReturnValue; + +import javax.annotation.ParametersAreNonnullByDefault; diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt new file mode 100644 index 000000000..81a8cf96b --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt @@ -0,0 +1,70 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.given.home + +import io.spine.core.Subscribe +import io.spine.given.home.events.DeviceMoved +import io.spine.given.home.events.RoomAdded +import io.spine.given.home.events.RoomEvent +import io.spine.given.home.events.RoomRenamed +import io.spine.server.entity.alter +import io.spine.server.projection.Projection +import io.spine.server.route.Route + +internal class RoomProjection : Projection() { + + @Subscribe + fun on(e: RoomAdded) = alter { + name = e.name + } + + @Subscribe + fun on(e: RoomRenamed) = alter { + name = e.name + } + + @Subscribe + fun on(e: DeviceMoved) = alter { + if (id == e.prevRoom) { + // + } + if (id == e.room) { + // + } + } + + companion object { + + @Route + @JvmStatic + fun route(e: RoomEvent): RoomId = e.room + +// @Route +// @JvmStatic +// fun routeMoved(e: DeviceMoved): Set = setOf(e.prevRoom, e.room) + } +} diff --git a/mc-java-routing-tests/src/testFixtures/proto/given/home/commands.proto b/mc-java-routing-tests/src/testFixtures/proto/given/home/commands.proto new file mode 100644 index 000000000..5c77e41c3 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/proto/given/home/commands.proto @@ -0,0 +1,59 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.home; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.home.commands"; +option java_outer_classname = "CommandsProto"; +option java_multiple_files = true; + +import "given/home/values.proto"; + +message AddDevice { + DeviceId device = 1; + string name = 2 [(required) = true]; +} + +message AddRoom { + RoomId room = 1; + string name = 2 [(required) = true]; +} + +message MoveDevice { + DeviceId device = 1 [(required) = true]; + RoomId from = 2; + RoomId to = 3 [(required) = true]; +} + +message SetState { + DeviceId device = 1; + State state = 2 [(required) = true]; +} diff --git a/mc-java-routing-tests/src/testFixtures/proto/given/home/entities.proto b/mc-java-routing-tests/src/testFixtures/proto/given/home/entities.proto new file mode 100644 index 000000000..05974e1ba --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/proto/given/home/entities.proto @@ -0,0 +1,59 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.home; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.home"; +option java_outer_classname = "EntitiesProto"; +option java_multiple_files = true; + +import "given/home/values.proto"; + +message Device { + option (entity).kind = AGGREGATE; + DeviceId id = 1; + string name = 2 [(required) = true]; + State state = 3; + RoomId room = 4; +} + +message Room { + option (entity).kind = PROJECTION; + RoomId id = 1; + string name = 2 [(required) = true]; + repeated DeviceId device = 3; +} + +message Home { + option (entity).kind = PROJECTION; + string name = 1; + repeated Room room = 2; +} diff --git a/mc-java-routing-tests/src/testFixtures/proto/given/home/events.proto b/mc-java-routing-tests/src/testFixtures/proto/given/home/events.proto new file mode 100644 index 000000000..51004dcd0 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/proto/given/home/events.proto @@ -0,0 +1,79 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.home; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.home.events"; +option java_outer_classname = "EventsProto"; +option java_multiple_files = true; + +import "given/home/values.proto"; + +message DeviceAdded { + option (is).java_type = "DeviceEvent"; + DeviceId device = 1 [(required) = true]; + string name = 2 [(required) = true]; +} + +message DeviceRenamed { + option (is).java_type = "DeviceEvent"; + DeviceId device = 1 [(required) = true]; + string prev_name = 2 [(required) = true]; + string name = 3 [(required) = true]; +} + +message RoomAdded { + option (is).java_type = "RoomEvent"; + RoomId room = 1; + string name = 2 [(required) = true]; +} + +message RoomRenamed { + option (is).java_type = "RoomEvent"; + RoomId room = 1; + string prev_name = 2 [(required) = true]; + string name = 3 [(required) = true]; +} + +message DeviceMoved { + option (is).java_type = "RoomDeviceEvent"; + DeviceId device = 1 [(required) = true]; + + RoomId prev_room = 3; + // This field is named `room` to satisfy the getter in the interface. + RoomId room = 4 [(required) = true]; +} + +message StateChanged { + option (is).java_type = "DeviceEvent"; + DeviceId device = 1 [(required) = true]; + State current = 2 [(required) = true]; +} diff --git a/mc-java-routing-tests/src/testFixtures/proto/given/home/values.proto b/mc-java-routing-tests/src/testFixtures/proto/given/home/values.proto new file mode 100644 index 000000000..b40707ee0 --- /dev/null +++ b/mc-java-routing-tests/src/testFixtures/proto/given/home/values.proto @@ -0,0 +1,57 @@ +/* +* Copyright 2025, TeamDev. All rights reserved. +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* https://www.apache.org/licenses/LICENSE-2.0 +* +* Redistribution and use in source and/or binary forms, with or without +* modification, must retain the above copyright notice and the following +* disclaimer. +* +* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +*/ + +syntax = "proto3"; + +package given.home; + +import "spine/options.proto"; + +option (type_url_prefix) = "type.spine.io"; +option java_package = "io.spine.given.home"; +option java_outer_classname = "ValuesProto"; +option java_multiple_files = true; + +message DeviceId { + string uuid = 1 [(required) = true]; +} + +message RoomId { + string uuid = 1 [(required) = true]; +} + +enum DeviceKind { + DK_UNDEFINED = 0; + LIGHT_BULB = 1; + THERMOSTAT = 2; + TV = 3; +} + +enum State { + STATUS_UNKNOWN = 0; + OFF = 1; + ON = 2; +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt index 494c362bc..92dc150c7 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt @@ -30,6 +30,7 @@ import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.Origin import funRef import io.spine.server.entity.Entity import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef @@ -58,7 +59,12 @@ internal fun KSFunctionDeclaration.commonChecks(environment: Environment): Int { private fun Boolean.toErrorCount(): Int = if (this) 0 else 1 private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Int { - val isStatic = functionKind == FunctionKind.STATIC + val isStatic = when (origin) { + Origin.JAVA -> functionKind == FunctionKind.STATIC + Origin.KOTLIN -> parentDeclaration is KSClassDeclaration && + (parentDeclaration as KSClassDeclaration).isCompanionObject + else -> false + } if (!isStatic) { logger.error(msg( "The $funRef annotated with $routeRef must be" + diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt index 7da1dfc94..3e71bd21a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt @@ -62,6 +62,9 @@ internal class Qualifier( if (qualified != null) { result.add(qualified) } else { + environment.logger.error( + "Unqualified function encountered: `${fn.qualifiedName?.asString()}`." + ) errorCount += 1 } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 86853d20b..1c19f8099 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -33,6 +33,7 @@ import com.google.devtools.ksp.symbol.KSFile import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSVisitorVoid import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.TypeSpec import com.squareup.kotlinpoet.ksp.writeTo @@ -52,7 +53,8 @@ internal sealed class RouteVisitor( originalFile = classDeclaration.containingFile!! packageName = originalFile.packageName.asString() val className = classDeclaration.simpleName.asString() + classNameSuffix - routingClass = TypeSpec.Companion.classBuilder(className) + routingClass = TypeSpec.classBuilder(className) + .addModifiers(KModifier.INTERNAL) functions.forEach { it.fn.accept(this, Unit) } } @@ -78,7 +80,7 @@ internal class CommandRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "$\$CommandRouting" + override val classNameSuffix: String = "_CommandRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -91,7 +93,7 @@ internal class EventRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "$\$EventRouting" + override val classNameSuffix: String = "_EventRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -104,7 +106,7 @@ internal class StateUpdateRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "$\$StateUpdateRouting" + override val classNameSuffix: String = "_StateUpdateRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt index 4c744b50c..d6b90032a 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt @@ -66,6 +66,7 @@ sealed class ErrorSpecTest { val baseJar = CommandMessage::class.java.classpathFile() val coreJar = EventContext::class.java.classpathFile() val serverJar = Route::class.java.classpathFile() + val processorJar = RouteProcessorProvider::class.java.classpathFile() val compiledProtos = Device::class.java.classpathFile() compilation.apply { @@ -75,6 +76,7 @@ sealed class ErrorSpecTest { baseJar, coreJar, serverJar, + processorJar, compiledProtos ) } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt index 4e5f63075..df3238bcf 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt @@ -31,6 +31,7 @@ package io.spine.tools.mc.java.routing +import com.tschuchort.compiletesting.KotlinCompilation.ExitCode import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain @@ -148,4 +149,35 @@ internal class KotlinErrorSpec : ErrorSpecTest() { it shouldContain jvmStaticRef } } + + /** + * Correct routing method. + */ + private val companionMember = kotlinFile("CompanionMember", """ + package io.spine.given.devices + + import io.spine.given.devices.events.StatusReported + import io.spine.server.projection.Projection + import io.spine.server.route.Route + + class CompanionMember : Projection() { + + companion object { + @Route + @JvmStatic + fun route(e: StatusReported): DeviceId { + return event.getDevice() + } + } + } + """.trimIndent()) + + @Test + fun `accept a function defined in a companion object`() { + compilation.apply { + sources = listOf(companionMember) + } + val result = compilation.compileSilently() + result.exitCode shouldBe ExitCode.OK + } } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/Exts.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/TestExts.kt similarity index 100% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/Exts.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/TestExts.kt diff --git a/mc-java-routing/src/test/proto/given/devices/entities.proto b/mc-java-routing/src/test/proto/given/devices/entities.proto index 13d708251..d8d8d6eba 100644 --- a/mc-java-routing/src/test/proto/given/devices/entities.proto +++ b/mc-java-routing/src/test/proto/given/devices/entities.proto @@ -38,11 +38,13 @@ option java_multiple_files = true; import "given/devices/values.proto"; message Device { + option (entity).kind = AGGREGATE; DeviceId id = 1; FirmwareVersion firmware = 2 [(required) = true]; } message DeviceStatus { + option (entity).kind = PROJECTION; DeviceId id = 1; repeated string status = 2 [(required) = true]; } From 12faef9bcd173da2d10c5828cc9919d7dbb5baf2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 28 Jan 2025 17:14:19 +0000 Subject: [PATCH 44/96] Fix grouping functions by classes --- .../tools/mc/java/routing/EntityClass.kt | 12 ++- .../tools/mc/java/routing/Environment.kt | 1 + .../mc/java/routing/EventRouteSignature.kt | 45 ++++++++++ .../mc/java/routing/KSDeclarationExts.kt | 35 ++++++++ .../spine/tools/mc/java/routing/KSTypeExts.kt | 4 +- ...JavaErrorSpec.kt => JavaRouteErrorSpec.kt} | 10 ++- .../tools/mc/java/routing/JavaRouteSpec.kt | 84 +++++++++++++++++++ ...inErrorSpec.kt => KotlinRouteErrorSpec.kt} | 2 +- ...rorSpecTest.kt => RouteCompilationTest.kt} | 29 +++---- 9 files changed, 203 insertions(+), 19 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{JavaErrorSpec.kt => JavaRouteErrorSpec.kt} (96%) create mode 100644 mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteSpec.kt rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{KotlinErrorSpec.kt => KotlinRouteErrorSpec.kt} (98%) rename mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/{ErrorSpecTest.kt => RouteCompilationTest.kt} (77%) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt index 68c8bb185..b2f1994b4 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt @@ -46,7 +46,7 @@ internal class EntityClass( } check(asEntity != null) { "The class `${decl.qualifiedName!!.asString()}`" + - " must implement ${entityInterface.declaration.qualifiedName!!.asString()}`." + " must implement ${entityInterface.declaration.qualified()}`." } val firstTypeArgument = asEntity.element!!.typeArguments.first() firstTypeArgument.type!!.resolve() @@ -59,4 +59,14 @@ internal class EntityClass( } return found!!.resolve() } + + override fun equals(other: Any?): Boolean { + if (this === other) return true + if (other !is EntityClass) return false + return decl == other.decl + } + + override fun hashCode(): Int { + return decl.hashCode() + } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index 88ad188df..c87396413 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -44,4 +44,5 @@ internal class Environment( val aggregateClass by lazy { Aggregate::class.java.toType(resolver) } val projectionClass by lazy { Projection::class.java.toType(resolver) } val processManagerClass by lazy { ProcessManager::class.java.toType(resolver) } + val setClass by lazy { Set::class.java.toType(resolver) } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt index ccc4221c1..42312ce22 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt @@ -58,6 +58,51 @@ internal class EventRouteSignature( return match } + @Suppress("ReturnCount") // Prefer a sooner exit to reduce nesting. + override fun matchReturnType( + fn: KSFunctionDeclaration, + declaringClass: EntityClass + ): KSType? = environment.run { + val unicast = super.matchReturnType(fn, declaringClass) + if (unicast != null) { + return unicast + } + // Return type is not the entity ID. + val returnType = fn.returnType?.resolve()!! + if (!setClass.isAssignableFrom(returnType)) { + logger.error( + "A multicast routing function for events must return" + + " a ${setClass.ref}` of entity identifiers." + + " Encountered: ${returnType.qualifiedRef}.", + fn + ) + return null + } + // The returned type is a `Set`. Let's check the generic argument. + val firstArg = returnType.arguments.firstOrNull() + if (firstArg == null) { + logger.error( + "A multicast routing function for events must return" + + " a `Set` whose generic argument is an entity identifier." + + " Encountered: no argument.", + fn + ) + return null + } + val argumentClass = firstArg.type!!.resolve() + if (!declaringClass.idClass.isAssignableFrom(argumentClass)) { + logger.error( + "A multicast routing function for events must return" + + " a `Set` whose generic argument is an entity identifier." + + " Expected: ${declaringClass.idClass.ref}." + + " Encountered: ${argumentClass.qualifiedRef}.", + fn + ) + return null + } + return returnType + } + override fun create( fn: KSFunctionDeclaration, declaringClass: EntityClass, diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt new file mode 100644 index 000000000..79a7b4382 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt @@ -0,0 +1,35 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.google.devtools.ksp.symbol.KSDeclaration + +/** + * Obtains the qualified name of this declaration or `null` + * if the declaration does not have a qualified name. + */ +internal fun KSDeclaration.qualified(): String? = qualifiedName?.asString() diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt index dc194c1c6..7cb808e9b 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt @@ -29,13 +29,13 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.symbol.KSType /** - * Obtains backticked simple name of the type. + * Obtains a simple name of the type surrounded with back ticks. */ internal val KSType.ref: String get() = "`${declaration.simpleName.asString()}`" /** - * Obtains backticked qualified name of the type. + * Obtains a qualified name of the type surrouned with back ticks. */ internal val KSType.qualifiedRef: String get() = "`${declaration.qualifiedName?.asString()}`" diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt similarity index 96% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt index 2b36f8b58..9ebd346ab 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt @@ -46,9 +46,17 @@ import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test +/** + * This test suite covers handling errors associated with misuse of + * the [Route][io.spine.server.route.Route] annotation in the Java code. + * + * For tests of the positive scenarios please see [JavaRouteSpec]. + * + * @see KotlinRouteErrorSpec + */ @ExperimentalCompilerApi @DisplayName("`RouteProcessor` should detect Java code errors") -internal class JavaErrorSpec : ErrorSpecTest() { +internal class JavaRouteErrorSpec : RouteCompilationTest() { /* * Error: non-static method. diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteSpec.kt new file mode 100644 index 000000000..29790ead6 --- /dev/null +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteSpec.kt @@ -0,0 +1,84 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +@file:Suppress( + "ClassNameDiffersFromFileName" /* false positive in IDEA */, + "MissingPackageInfo" /* don't need them for these tests. */ +) + +package io.spine.tools.mc.java.routing + +import com.tschuchort.compiletesting.KotlinCompilation.ExitCode +import io.kotest.matchers.shouldBe +import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test + +/** + * This test suite checks positive scenarios of the compilation of + * the [Route][io.spine.server.route.Route] annotation in the Java code. + * + * For error scenarios, please see [JavaRouteErrorSpec]. + * + * @see JavaRouteErrorSpec + */ +@ExperimentalCompilerApi +@DisplayName("`RouteProcessor` should detect Java code errors") +internal class JavaRouteSpec : RouteCompilationTest() { + + private val twoRoutes = javaFile("TwoRoutes", """ + + package io.spine.given.devices; + + import io.spine.given.devices.events.StatusReported; + import io.spine.given.devices.events.DeviceRegistered; + import io.spine.server.projection.Projection; + import io.spine.server.route.Route; + + class TwoRoutes extends Projection { + + @Route + static DeviceId route(StatusReported event) { + return event.getDevice(); + } + + @Route + static DeviceId route(DeviceRegistered event) { + return event.getDevice(); + } + } + """.trimIndent()) + + @Test + fun `handle two routes`() { + compilation.apply { + sources = listOf(twoRoutes) + } + val result = compilation.compile() + + result.exitCode shouldBe ExitCode.OK + } +} diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt similarity index 98% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt index df3238bcf..645e55a90 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt @@ -43,7 +43,7 @@ import org.junit.jupiter.api.Test @ExperimentalCompilerApi @DisplayName("`RouteProcessor` should detect Kotlin code errors") -internal class KotlinErrorSpec : ErrorSpecTest() { +internal class KotlinRouteErrorSpec : RouteCompilationTest() { /** * Error: The function must be a static method of a class. diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt similarity index 77% rename from mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt rename to mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt index d6b90032a..1ad93e8da 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/ErrorSpecTest.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt @@ -26,6 +26,7 @@ package io.spine.tools.mc.java.routing +import com.google.protobuf.MessageOrBuilder import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.symbolProcessorProviders import io.spine.base.CommandMessage @@ -33,16 +34,17 @@ import io.spine.core.EventContext import io.spine.given.devices.Device import io.spine.logging.testing.ConsoleTap import io.spine.server.route.Route +import io.spine.validate.ValidatingBuilder import kotlin.collections.plus import org.junit.jupiter.api.BeforeAll import org.junit.jupiter.api.BeforeEach /** - * Abstract base for tests checking handling errors using the [Route] annotation. + * Abstract base for tests checking handling compilation of the [Route] annotation. * * The tests use types from the Protobuf code generated for the `given.devices` proto package. */ -sealed class ErrorSpecTest { +sealed class RouteCompilationTest { companion object { @@ -63,22 +65,21 @@ sealed class ErrorSpecTest { @BeforeEach fun prepareCompilation() { compilation = KotlinCompilation() - val baseJar = CommandMessage::class.java.classpathFile() - val coreJar = EventContext::class.java.classpathFile() - val serverJar = Route::class.java.classpathFile() - val processorJar = RouteProcessorProvider::class.java.classpathFile() - val compiledProtos = Device::class.java.classpathFile() + + val dependencyJars = setOf( + MessageOrBuilder::class.java, // Protobuf + CommandMessage::class.java, // Base + ValidatingBuilder::class.java, // Validation runtime + EventContext::class.java, // CoreJava.core + Route::class.java, // CoreJava.server + RouteProcessorProvider::class.java, // RouteProcessor + Device::class.java // Compiled protos + ).map { it.classpathFile() } compilation.apply { javaPackagePrefix = "io.spine.routing.given" symbolProcessorProviders = listOf(RouteProcessorProvider()) - classpaths = classpaths + listOf( - baseJar, - coreJar, - serverJar, - processorJar, - compiledProtos - ) + classpaths = classpaths + dependencyJars } } } From 47ebcc698fd6265852369b791f2aefdfd3d9d914 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 28 Jan 2025 17:27:02 +0000 Subject: [PATCH 45/96] Uncomment routing function --- .../kotlin/io/spine/given/home/RoomProjection.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt index 81a8cf96b..34a986336 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt @@ -63,8 +63,8 @@ internal class RoomProjection : Projection() { @JvmStatic fun route(e: RoomEvent): RoomId = e.room -// @Route -// @JvmStatic -// fun routeMoved(e: DeviceMoved): Set = setOf(e.prevRoom, e.room) + @Route + @JvmStatic + fun routeMoved(e: DeviceMoved): Set = setOf(e.prevRoom, e.room) } } From 9f8b3d2da3dae90dbf1718d96018cf623246df07 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 28 Jan 2025 20:40:53 +0000 Subject: [PATCH 46/96] Draft generated routing setup API --- mc-java-routing-tests/build.gradle.kts | 5 + .../io/spine/given/home/RoomProjection.kt | 41 ++++++- .../io/spine/server/route/RoutingSetup.kt | 110 ++++++++++++++++++ .../tools/mc/java/routing/RouteVisitor.kt | 9 +- 4 files changed, 160 insertions(+), 5 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt diff --git a/mc-java-routing-tests/build.gradle.kts b/mc-java-routing-tests/build.gradle.kts index f65bcf380..8c30d85b8 100644 --- a/mc-java-routing-tests/build.gradle.kts +++ b/mc-java-routing-tests/build.gradle.kts @@ -38,6 +38,11 @@ dependencies { kspTest(project(":mc-java-routing")) kspTestFixtures(project(":mc-java-routing")) testFixturesImplementation(CoreJava.server) + + testFixturesImplementation(project(":mc-java-routing"))?.because( + "We need this dependency temporarily, until the interfaces defined" + + " in the package `io.spine.server.route` are moved to CoreJava." + ) } kotlin { diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt index 34a986336..059008503 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt @@ -26,6 +26,10 @@ package io.spine.given.home +import com.google.protobuf.Message +import io.spine.base.EventMessage +import io.spine.base.MessageContext +import io.spine.core.EventContext import io.spine.core.Subscribe import io.spine.given.home.events.DeviceMoved import io.spine.given.home.events.RoomAdded @@ -33,7 +37,13 @@ import io.spine.given.home.events.RoomEvent import io.spine.given.home.events.RoomRenamed import io.spine.server.entity.alter import io.spine.server.projection.Projection +import io.spine.server.projection.ProjectionRepository +import io.spine.server.route.EventRouting +import io.spine.server.route.EventRoutingSetup import io.spine.server.route.Route +import io.spine.server.route.StateRoutingSetup +import io.spine.server.route.StateUpdateRouting +import kotlin.apply internal class RoomProjection : Projection() { @@ -50,10 +60,13 @@ internal class RoomProjection : Projection() { @Subscribe fun on(e: DeviceMoved) = alter { if (id == e.prevRoom) { - // + val toRemove = deviceBuilderList.find { b -> b.uuid == e.device.uuid } + if (toRemove != null) { + deviceBuilderList.remove(toRemove) + } } if (id == e.room) { - // + addDevice(e.device) } } @@ -68,3 +81,27 @@ internal class RoomProjection : Projection() { fun routeMoved(e: DeviceMoved): Set = setOf(e.prevRoom, e.room) } } + +internal class RoomProjectionRepository : ProjectionRepository() { + + override fun setupEventRouting(routing: EventRouting) { + super.setupEventRouting(routing) + EventRoutingSetup.apply(entityClass(), routing) + } + + override fun setupStateRouting(routing: StateUpdateRouting) { + super.setupStateRouting(routing) + StateRoutingSetup.apply(entityClass(), routing) + } +} + +@Suppress("unused") // Loaded dynamically. +internal object RoomProjectionEventRouting: EventRoutingSetup { + + override fun setup(routing: EventRouting) { + routing.run { + route { e, _ -> RoomProjection.routeMoved(e) } + unicast { e -> RoomProjection.route(e) } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt new file mode 100644 index 000000000..9083c6475 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt @@ -0,0 +1,110 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.server.route + +import io.spine.base.CommandMessage +import io.spine.base.EntityState +import io.spine.base.EventMessage +import io.spine.base.MessageContext +import io.spine.core.CommandContext +import io.spine.core.EventContext +import io.spine.server.entity.Entity +import io.spine.type.KnownMessage + +public interface RoutingSetup< + I : Any, + M : KnownMessage, + C : MessageContext, + R : Any, + U : MessageRouting> { + + public fun setup(routing: U) +} + +public sealed class RoutingSetupDiscovery< + M : KnownMessage, + C : MessageContext, + U : MessageRouting + >(public val classSuffix: String) { + + public fun serving(cls: Class>): RoutingSetup? { + val setupClassName = cls.name + classSuffix + try { + val setupClass = Class.forName(setupClassName).kotlin + @Suppress("UNCHECKED_CAST") + return setupClass.objectInstance as RoutingSetup + } catch (_: ClassNotFoundException) { + // No generated class found. + return null + } + } +} + +public interface CommandRoutingSetup : + RoutingSetup> { + + public companion object : + RoutingSetupDiscovery>("CommandRouting") { + + public fun apply(cls: Class>, routing: CommandRouting) { + @Suppress("UNCHECKED_CAST") + val discovered = serving(cls) as CommandRoutingSetup? + discovered?.setup(routing) + } + } +} + +public interface EventRoutingSetup : + RoutingSetup, EventRouting> { + + public companion object : + RoutingSetupDiscovery>( + "EventRouting" + ) { + public fun apply(cls: Class>, routing: EventRouting) { + @Suppress("UNCHECKED_CAST") + val discovered = serving(cls) as EventRoutingSetup? + discovered?.setup(routing) + } + } +} + +public interface StateRoutingSetup : + RoutingSetup, EventContext, Set, StateUpdateRouting> { + + public companion object : + RoutingSetupDiscovery, EventContext, StateUpdateRouting<*>>( + "StateUpdateRouting" + ) { + + public fun apply(cls: Class>, routing: StateUpdateRouting) { + @Suppress("UNCHECKED_CAST") + val discovered = serving(cls) as StateRoutingSetup? + discovered?.setup(routing) + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 1c19f8099..d8187f5ff 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -36,6 +36,9 @@ import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.TypeSpec import com.squareup.kotlinpoet.ksp.writeTo +import io.spine.server.route.CommandRoutingSetup +import io.spine.server.route.EventRoutingSetup +import io.spine.server.route.StateRoutingSetup internal sealed class RouteVisitor( private val functions: List, @@ -80,7 +83,7 @@ internal class CommandRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "_CommandRouting" + override val classNameSuffix: String = CommandRoutingSetup.classSuffix override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -93,7 +96,7 @@ internal class EventRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "_EventRouting" + override val classNameSuffix: String = EventRoutingSetup.classSuffix override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -106,7 +109,7 @@ internal class StateUpdateRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = "_StateUpdateRouting" + override val classNameSuffix: String = StateRoutingSetup.classSuffix override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. From abc0e55939554520541092356d95a9b252a12259 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 28 Jan 2025 20:47:32 +0000 Subject: [PATCH 47/96] Improve code layout --- .../src/main/kotlin/io/spine/server/route/RoutingSetup.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt index 9083c6475..f7ead6c01 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt @@ -68,7 +68,9 @@ public interface CommandRoutingSetup : RoutingSetup> { public companion object : - RoutingSetupDiscovery>("CommandRouting") { + RoutingSetupDiscovery>( + "CommandRouting" + ) { public fun apply(cls: Class>, routing: CommandRouting) { @Suppress("UNCHECKED_CAST") From 37b9fa595727f1319a2a9f0e30318e6e98ee0725 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 29 Jan 2025 14:31:02 +0000 Subject: [PATCH 48/96] Optimise imports --- .../kotlin/io/spine/given/home/RoomProjection.kt | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt index 059008503..7e4d6aaf2 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt @@ -26,10 +26,6 @@ package io.spine.given.home -import com.google.protobuf.Message -import io.spine.base.EventMessage -import io.spine.base.MessageContext -import io.spine.core.EventContext import io.spine.core.Subscribe import io.spine.given.home.events.DeviceMoved import io.spine.given.home.events.RoomAdded @@ -43,7 +39,6 @@ import io.spine.server.route.EventRoutingSetup import io.spine.server.route.Route import io.spine.server.route.StateRoutingSetup import io.spine.server.route.StateUpdateRouting -import kotlin.apply internal class RoomProjection : Projection() { @@ -96,7 +91,7 @@ internal class RoomProjectionRepository : ProjectionRepository { +internal object RoomProjectionEventRouting : EventRoutingSetup { override fun setup(routing: EventRouting) { routing.run { From b7ab494efb2b883eae32107f358def4c04bdf1de Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Wed, 29 Jan 2025 19:49:05 +0000 Subject: [PATCH 49/96] Draft loading routing setup as a service --- buildSrc/src/main/kotlin/module.gradle.kts | 3 + mc-java-checks/build.gradle.kts | 10 +- mc-java-routing-tests/build.gradle.kts | 7 ++ .../routing/tests/EventRoutingSetupITest.kt | 73 ++++++++++++ ...Projection.kt => HomeAutomationContext.kt} | 29 ++++- mc-java-routing/build.gradle.kts | 2 +- .../io/spine/server/route/RoutingSetup.kt | 108 ++++++++++++------ .../tools/mc/java/routing/RouteVisitor.kt | 9 +- 8 files changed, 190 insertions(+), 51 deletions(-) create mode 100644 mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt rename mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/{RoomProjection.kt => HomeAutomationContext.kt} (77%) diff --git a/buildSrc/src/main/kotlin/module.gradle.kts b/buildSrc/src/main/kotlin/module.gradle.kts index 6b0c282ff..34a3a7d48 100644 --- a/buildSrc/src/main/kotlin/module.gradle.kts +++ b/buildSrc/src/main/kotlin/module.gradle.kts @@ -33,6 +33,7 @@ import io.spine.dependency.lib.Grpc import io.spine.dependency.lib.Guava import io.spine.dependency.lib.Jackson import io.spine.dependency.lib.Kotlin +import io.spine.dependency.lib.KotlinPoet import io.spine.dependency.lib.KotlinX import io.spine.dependency.lib.Protobuf import io.spine.dependency.local.ArtifactVersion @@ -135,6 +136,8 @@ fun Module.forceConfigurations() { Kotlin.stdLibJdk7, KotlinX.Coroutines.core, KotlinX.Coroutines.jdk8, + KotlinPoet.ksp, + KotlinPoet.lib, Protobuf.compiler, Grpc.api, Grpc.core, diff --git a/mc-java-checks/build.gradle.kts b/mc-java-checks/build.gradle.kts index 954a7469b..d7c21264f 100644 --- a/mc-java-checks/build.gradle.kts +++ b/mc-java-checks/build.gradle.kts @@ -26,7 +26,9 @@ import io.spine.dependency.build.ErrorProne import io.spine.dependency.lib.AutoService -import io.spine.dependency.local.Spine +import io.spine.dependency.local.Base +import io.spine.dependency.local.ModelCompiler +import io.spine.dependency.local.TestLib import io.spine.dependency.local.ToolBase dependencies { @@ -38,13 +40,13 @@ dependencies { ErrorProne.annotations.forEach { api(it) } implementation(ErrorProne.GradlePlugin.lib) - implementation(Spine.base) + implementation(Base.lib) implementation(ToolBase.pluginBase) - implementation(Spine.modelCompiler) + implementation(ModelCompiler.lib) testImplementation(ErrorProne.testHelpers) testImplementation(gradleKotlinDsl()) - testImplementation(Spine.testlib) + testImplementation(TestLib.lib) } /** diff --git a/mc-java-routing-tests/build.gradle.kts b/mc-java-routing-tests/build.gradle.kts index 8c30d85b8..6542dbac3 100644 --- a/mc-java-routing-tests/build.gradle.kts +++ b/mc-java-routing-tests/build.gradle.kts @@ -24,6 +24,8 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import io.spine.dependency.lib.AutoService +import io.spine.dependency.lib.AutoServiceKsp import io.spine.dependency.local.CoreJava plugins { @@ -34,7 +36,12 @@ plugins { } dependencies { + ksp(AutoServiceKsp.processor) + compileOnlyApi(AutoService.annotations) + testImplementation(kotlin("stdlib")) + testImplementation(CoreJava.testUtilServer) + kspTest(project(":mc-java-routing")) kspTestFixtures(project(":mc-java-routing")) testFixturesImplementation(CoreJava.server) diff --git a/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt b/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt new file mode 100644 index 000000000..a7ed54b7a --- /dev/null +++ b/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt @@ -0,0 +1,73 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing.tests + +import io.kotest.matchers.collections.shouldContain +import io.kotest.matchers.shouldBe +import io.spine.given.home.DeviceId +import io.spine.given.home.Room +import io.spine.given.home.RoomId +import io.spine.given.home.RoomProjection +import io.spine.given.home.events.deviceMoved +import io.spine.given.home.events.roomAdded +import io.spine.given.home.homeAutomation +import io.spine.testing.server.blackbox.BlackBox +import org.junit.jupiter.api.Test +import io.spine.testing.server.blackbox.assertEntity + +internal class EventRoutingSetupITest { + + @Test + fun `loads event routing setup as a service`() { + BlackBox.from(homeAutomation()).use { context -> + val r1 = RoomId.generate() + val lamp = DeviceId.generate() + val n1 = "Living Room" + + context.receivesEvent( + roomAdded { + room = r1 + name = n1 + } + ) + + context.receivesEvent( + deviceMoved { + device = lamp + room = r1 + } + ) + + val room = context.assertEntity(r1).actual()?.state() as Room + + room.run { + name shouldBe n1 + deviceList shouldContain lamp + } + } + } +} diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt similarity index 77% rename from mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt rename to mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt index 7e4d6aaf2..635f7a81f 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/RoomProjection.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt @@ -26,11 +26,15 @@ package io.spine.given.home +import com.google.auto.service.AutoService import io.spine.core.Subscribe import io.spine.given.home.events.DeviceMoved import io.spine.given.home.events.RoomAdded import io.spine.given.home.events.RoomEvent import io.spine.given.home.events.RoomRenamed +import io.spine.protobuf.isDefault +import io.spine.server.BoundedContext +import io.spine.server.entity.Entity import io.spine.server.entity.alter import io.spine.server.projection.Projection import io.spine.server.projection.ProjectionRepository @@ -40,7 +44,11 @@ import io.spine.server.route.Route import io.spine.server.route.StateRoutingSetup import io.spine.server.route.StateUpdateRouting -internal class RoomProjection : Projection() { +fun homeAutomation(): BoundedContext = BoundedContext.singleTenant("HomeAutomation") + .add(RoomProjectionRepository()) + .build() + +public class RoomProjection : Projection() { @Subscribe fun on(e: RoomAdded) = alter { @@ -73,7 +81,8 @@ internal class RoomProjection : Projection() { @Route @JvmStatic - fun routeMoved(e: DeviceMoved): Set = setOf(e.prevRoom, e.room) + fun routeMoved(e: DeviceMoved): Set = + if (e.prevRoom.isDefault()) setOf(e.room) else setOf(e.prevRoom, e.room) } } @@ -81,6 +90,13 @@ internal class RoomProjectionRepository : ProjectionRepository) { super.setupEventRouting(routing) + + // Remove routs added via reflective class analysis. + routing.run { + remove() + remove() + } + EventRoutingSetup.apply(entityClass(), routing) } @@ -90,8 +106,13 @@ internal class RoomProjectionRepository : ProjectionRepository { +/** + * This class simulates the generated code. + */ +@AutoService(EventRoutingSetup::class) +public class RoomProjectionEventRoutingX : EventRoutingSetup { + + override fun entityClass(): Class> = RoomProjection::class.java override fun setup(routing: EventRouting) { routing.run { diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 98d2a6fa7..f7d3ce9a5 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -42,12 +42,12 @@ plugins { dependencies { ksp(AutoServiceKsp.processor) + compileOnlyApi(AutoService.annotations) implementation(kotlin("stdlib")) implementation(Ksp.symbolProcessingApi) implementation(KotlinPoet.lib) implementation(KotlinPoet.ksp) implementation(CoreJava.server) - implementation(AutoService.annotations) testImplementation(Kotest.assertions) testImplementation(KotlinCompileTesting.libKsp) diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt index f7ead6c01..94c64d845 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt @@ -34,6 +34,7 @@ import io.spine.core.CommandContext import io.spine.core.EventContext import io.spine.server.entity.Entity import io.spine.type.KnownMessage +import java.util.ServiceLoader public interface RoutingSetup< I : Any, @@ -42,24 +43,61 @@ public interface RoutingSetup< R : Any, U : MessageRouting> { + public fun entityClass(): Class> public fun setup(routing: U) } -public sealed class RoutingSetupDiscovery< - M : KnownMessage, - C : MessageContext, - U : MessageRouting - >(public val classSuffix: String) { - - public fun serving(cls: Class>): RoutingSetup? { - val setupClassName = cls.name + classSuffix - try { - val setupClass = Class.forName(setupClassName).kotlin - @Suppress("UNCHECKED_CAST") - return setupClass.objectInstance as RoutingSetup - } catch (_: ClassNotFoundException) { - // No generated class found. - return null +internal typealias RSetup = RoutingSetup<*, *, *, *, *> + +internal object RoutingSetupRegistry { + + private val entries: Set + + init { + val setupClasses = setOf( + CommandRoutingSetup::class, + EventRoutingSetup::class, + StateRoutingSetup::class + ) + val allServices = setupClasses + .map { it.java } + .flatMap { ServiceLoader.load(it) } + val grouped = allServices.groupBy { it.entityClass() } + + entries = grouped.map { (cls, setups) -> Entry(cls, setups) }.toSet() + } + + fun find( + entityClass: Class>, + setupClass: Class + ): RSetup? { + val entry = entries.find { it.entityClass == entityClass } + return entry?.find(setupClass) + } + + private data class Entry( + val entityClass: Class>, + private val setups: List + ) { + init { + // Check the consistency of grouping. + setups.forEach { + require(it.entityClass() == entityClass) { + val setupClass = it::class.qualifiedName + val servedBySetup = it.entityClass().simpleName + "The `entityClass` (`${entityClass.simpleName}`) of the entry" + + " must match the property of the setup (`$setupClass`)." + + " Encountered: `$servedBySetup`." + } + } + } + + fun find( + setupClass: Class + ): RSetup? { + val found = setups.find { setupClass.isAssignableFrom(it.javaClass) } + @Suppress("UNCHECKED_CAST") // The cast is protected by the initial check + return found } } } @@ -67,15 +105,14 @@ public sealed class RoutingSetupDiscovery< public interface CommandRoutingSetup : RoutingSetup> { - public companion object : - RoutingSetupDiscovery>( - "CommandRouting" - ) { + public companion object { public fun apply(cls: Class>, routing: CommandRouting) { - @Suppress("UNCHECKED_CAST") - val discovered = serving(cls) as CommandRoutingSetup? - discovered?.setup(routing) + val found = RoutingSetupRegistry.find(cls, CommandRoutingSetup::class.java) + found?.let { + @Suppress("UNCHECKED_CAST") + (it as CommandRoutingSetup).setup(routing) + } } } } @@ -83,14 +120,14 @@ public interface CommandRoutingSetup : public interface EventRoutingSetup : RoutingSetup, EventRouting> { - public companion object : - RoutingSetupDiscovery>( - "EventRouting" - ) { + public companion object { + public fun apply(cls: Class>, routing: EventRouting) { - @Suppress("UNCHECKED_CAST") - val discovered = serving(cls) as EventRoutingSetup? - discovered?.setup(routing) + val fount = RoutingSetupRegistry.find(cls, EventRoutingSetup::class.java) + fount?.let { + @Suppress("UNCHECKED_CAST") + (it as EventRoutingSetup).setup(routing) + } } } } @@ -98,15 +135,14 @@ public interface EventRoutingSetup : public interface StateRoutingSetup : RoutingSetup, EventContext, Set, StateUpdateRouting> { - public companion object : - RoutingSetupDiscovery, EventContext, StateUpdateRouting<*>>( - "StateUpdateRouting" - ) { + public companion object { public fun apply(cls: Class>, routing: StateUpdateRouting) { - @Suppress("UNCHECKED_CAST") - val discovered = serving(cls) as StateRoutingSetup? - discovered?.setup(routing) + val found = RoutingSetupRegistry.find(cls, StateRoutingSetup::class.java) + found?.let { + @Suppress("UNCHECKED_CAST") + (it as StateRoutingSetup).setup(routing) + } } } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index d8187f5ff..f5d773f09 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -36,9 +36,6 @@ import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.TypeSpec import com.squareup.kotlinpoet.ksp.writeTo -import io.spine.server.route.CommandRoutingSetup -import io.spine.server.route.EventRoutingSetup -import io.spine.server.route.StateRoutingSetup internal sealed class RouteVisitor( private val functions: List, @@ -83,7 +80,7 @@ internal class CommandRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = CommandRoutingSetup.classSuffix + override val classNameSuffix: String = "CommandRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -96,7 +93,7 @@ internal class EventRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = EventRoutingSetup.classSuffix + override val classNameSuffix: String = "EventRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. @@ -109,7 +106,7 @@ internal class StateUpdateRouteVisitor( environment: Environment ) : RouteVisitor(functions, codeGenerator, environment) { - override val classNameSuffix: String = StateRoutingSetup.classSuffix + override val classNameSuffix: String = "StateUpdateRouting" override fun generateCode(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. From a7a12cce4d56b1612adc128e2eb8c543205db19e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 30 Jan 2025 19:21:00 +0000 Subject: [PATCH 50/96] Address deprecations Also: * Add KotlinPoet dependency to `mc-java-base`. --- mc-java-base/build.gradle.kts | 17 +++++++++++------ mc-java-routing/build.gradle.kts | 1 - 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/mc-java-base/build.gradle.kts b/mc-java-base/build.gradle.kts index e9536a6d0..a6218315e 100644 --- a/mc-java-base/build.gradle.kts +++ b/mc-java-base/build.gradle.kts @@ -24,9 +24,13 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +import io.spine.dependency.lib.KotlinPoet +import io.spine.dependency.local.Base import io.spine.dependency.local.Logging +import io.spine.dependency.local.ModelCompiler import io.spine.dependency.local.ProtoData import io.spine.dependency.local.Spine +import io.spine.dependency.local.TestLib import io.spine.dependency.local.ToolBase import io.spine.dependency.local.Validation @@ -41,29 +45,30 @@ dependencies { val apiDeps = arrayOf( Logging.lib, - Spine.modelCompiler, + ModelCompiler.lib, ProtoData.java, Validation.config, - ToolBase.pluginBase + ToolBase.pluginBase, + KotlinPoet.lib, ) apiDeps.forEach { api(it) { excludeSpineBase() } } - api(Spine.base) + api(Base.lib) arrayOf( - Spine.base, + Base.lib, gradleTestKit() /* for creating a Gradle project. */, - Spine.testlib, + TestLib.lib, ProtoData.testlib /* `PipelineSetup` API. */ ).forEach { // Expose using API level for the submodules. testFixturesApi(it) } - testImplementation(Spine.testlib) + testImplementation(TestLib.lib) testImplementation(gradleTestKit()) testImplementation(ToolBase.pluginTestlib) } diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index f7d3ce9a5..f3d74dd4a 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -45,7 +45,6 @@ dependencies { compileOnlyApi(AutoService.annotations) implementation(kotlin("stdlib")) implementation(Ksp.symbolProcessingApi) - implementation(KotlinPoet.lib) implementation(KotlinPoet.ksp) implementation(CoreJava.server) From f1020863add19d960c7ab83f62a74a4369ef0315 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 30 Jan 2025 19:25:41 +0000 Subject: [PATCH 51/96] Expand parameter properties --- .../kotlin/io/spine/tools/mc/java/routing/RouteFun.kt | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt index 57d67c8ed..0890e9bc9 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -32,9 +32,13 @@ import com.google.devtools.ksp.symbol.KSType internal sealed class RouteFun( val fn: KSFunctionDeclaration, val declaringClass: EntityClass, - protected val parameters: Pair, - protected val returnType: KSType -) + parameters: Pair, + val returnType: KSType +) { + val messageParameter: KSType = parameters.first + val contextParameter: KSType? = parameters.second + val acceptsContext: Boolean = contextParameter != null +} internal class CommandRouteFun( fn: KSFunctionDeclaration, From 2eea1c30bb6e3e2870235a4469a0516cd5b8e6fa Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 30 Jan 2025 20:56:00 +0000 Subject: [PATCH 52/96] Annotate generated routing class --- .../routing/tests/EventRoutingSetupITest.kt | 1 - mc-java-routing/build.gradle.kts | 1 + .../tools/mc/java/routing/EntityClass.kt | 15 +++- .../tools/mc/java/routing/Environment.kt | 13 ++++ .../tools/mc/java/routing/RouteVisitor.kt | 69 ++++++++++++++++--- .../mc/java/routing/RouteCompilationTest.kt | 2 + 6 files changed, 86 insertions(+), 15 deletions(-) diff --git a/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt b/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt index a7ed54b7a..a874a6d67 100644 --- a/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt +++ b/mc-java-routing-tests/src/test/kotlin/io/spine/tools/mc/java/routing/tests/EventRoutingSetupITest.kt @@ -54,7 +54,6 @@ internal class EventRoutingSetupITest { name = n1 } ) - context.receivesEvent( deviceMoved { device = lamp diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index f3d74dd4a..535f30b81 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -48,6 +48,7 @@ dependencies { implementation(KotlinPoet.ksp) implementation(CoreJava.server) + testImplementation(AutoService.annotations) testImplementation(Kotest.assertions) testImplementation(KotlinCompileTesting.libKsp) testImplementation(Logging.testLib) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt index b2f1994b4..385ad9892 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt @@ -29,6 +29,8 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.symbol.ClassKind.CLASS import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSType +import com.google.devtools.ksp.symbol.KSTypeArgument +import com.google.devtools.ksp.symbol.KSTypeReference internal class EntityClass( private val decl: KSClassDeclaration, @@ -40,7 +42,7 @@ internal class EntityClass( val type: KSType by lazy { decl.asStarProjectedType() } - val idClass: KSType by lazy { + val idClassTypeArgument: KSTypeArgument by lazy { val asEntity = decl.superTypes.find { entityInterface.isAssignableFrom(it.resolve()) } @@ -48,8 +50,15 @@ internal class EntityClass( "The class `${decl.qualifiedName!!.asString()}`" + " must implement ${entityInterface.declaration.qualified()}`." } - val firstTypeArgument = asEntity.element!!.typeArguments.first() - firstTypeArgument.type!!.resolve() + asEntity.element!!.typeArguments.first() + } + + val idClassReference: KSTypeReference by lazy { + idClassTypeArgument.type!! + } + + val idClass: KSType by lazy { + idClassReference.resolve() } fun superClass(): KSType { diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index c87396413..d46c95d1b 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -28,10 +28,14 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver +import com.google.devtools.ksp.symbol.KSType import io.spine.server.aggregate.Aggregate import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection +import io.spine.server.route.CommandRoutingSetup +import io.spine.server.route.EventRoutingSetup +import io.spine.server.route.StateRoutingSetup /** * Provides instances required for resolving types or reporting errors or warnings. @@ -45,4 +49,13 @@ internal class Environment( val projectionClass by lazy { Projection::class.java.toType(resolver) } val processManagerClass by lazy { ProcessManager::class.java.toType(resolver) } val setClass by lazy { Set::class.java.toType(resolver) } + + val commandRoutingSetup = ClassType(CommandRoutingSetup::class.java) + val eventRoutingSetup = ClassType(EventRoutingSetup::class.java) + val stateRoutingSetup = ClassType(StateRoutingSetup::class.java) + + inner class ClassType(val cls: Class) { + val type: KSType by lazy { cls.toType(resolver) } + } } + diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index f5d773f09..a65cced5a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -26,18 +26,25 @@ package io.spine.tools.mc.java.routing +import com.google.auto.service.AutoService import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile import com.google.devtools.ksp.symbol.KSFunctionDeclaration +import com.google.devtools.ksp.symbol.KSTypeArgument import com.google.devtools.ksp.symbol.KSVisitorVoid +import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper +import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.ksp.toTypeName import com.squareup.kotlinpoet.ksp.writeTo +import io.spine.tools.mc.java.routing.Environment.ClassType internal sealed class RouteVisitor( + protected val setupType: ClassType, private val functions: List, protected val codeGenerator: CodeGenerator, protected val environment: Environment, @@ -45,25 +52,46 @@ internal sealed class RouteVisitor( private lateinit var packageName: String private lateinit var originalFile: KSFile - private lateinit var routingClass: TypeSpec.Builder + protected lateinit var routingClass: TypeSpec.Builder protected abstract val classNameSuffix: String + val idClassTypeArgument: KSTypeArgument by lazy { + val fn = functions.first() + fn.declaringClass.idClassTypeArgument + } + override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { originalFile = classDeclaration.containingFile!! packageName = originalFile.packageName.asString() val className = classDeclaration.simpleName.asString() + classNameSuffix - routingClass = TypeSpec.classBuilder(className) - .addModifiers(KModifier.INTERNAL) + createClass(className) functions.forEach { it.fn.accept(this, Unit) } } - protected abstract fun generateCode(function: KSFunctionDeclaration) + @OverridingMethodsMustInvokeSuper + protected open fun createClass(className: String) { + val annotation = AnnotationSpec.builder(AutoService::class) + .addMember("%T::class", setupType.cls) + .build() + + routingClass = TypeSpec.classBuilder(className) + // Must be `public` because created reflectively via `AutoService` + .addModifiers(KModifier.PUBLIC) + .addAnnotation(annotation) + + val superInterface = setupType.type + .replace(listOf(idClassTypeArgument)) + .toTypeName() + routingClass.addSuperinterface(superInterface) + } override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { - generateCode(function) + addRoute(function) } + protected abstract fun addRoute(function: KSFunctionDeclaration) + fun writeFile() { val cls = routingClass.build() val code = FileSpec.builder(packageName, cls.name!!) @@ -78,11 +106,16 @@ internal class CommandRouteVisitor( functions: List, codeGenerator: CodeGenerator, environment: Environment -) : RouteVisitor(functions, codeGenerator, environment) { +) : RouteVisitor( + environment.commandRoutingSetup, + functions, + codeGenerator, + environment +) { override val classNameSuffix: String = "CommandRouting" - override fun generateCode(function: KSFunctionDeclaration) { + override fun addRoute(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } @@ -91,11 +124,20 @@ internal class EventRouteVisitor( functions: List, codeGenerator: CodeGenerator, environment: Environment -) : RouteVisitor(functions, codeGenerator, environment) { +) : RouteVisitor( + environment.eventRoutingSetup, + functions, + codeGenerator, + environment +) { override val classNameSuffix: String = "EventRouting" - override fun generateCode(function: KSFunctionDeclaration) { + override fun createClass(className: String): Unit = environment.run { + super.createClass(className) + } + + override fun addRoute(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } @@ -104,11 +146,16 @@ internal class StateUpdateRouteVisitor( functions: List, codeGenerator: CodeGenerator, environment: Environment -) : RouteVisitor(functions, codeGenerator, environment) { +) : RouteVisitor( + environment.stateRoutingSetup, + functions, + codeGenerator, + environment +) { override val classNameSuffix: String = "StateUpdateRouting" - override fun generateCode(function: KSFunctionDeclaration) { + override fun addRoute(function: KSFunctionDeclaration) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt index 1ad93e8da..4f458dfb6 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt @@ -26,6 +26,7 @@ package io.spine.tools.mc.java.routing +import com.google.auto.service.AutoService import com.google.protobuf.MessageOrBuilder import com.tschuchort.compiletesting.KotlinCompilation import com.tschuchort.compiletesting.symbolProcessorProviders @@ -67,6 +68,7 @@ sealed class RouteCompilationTest { compilation = KotlinCompilation() val dependencyJars = setOf( + AutoService::class.java, MessageOrBuilder::class.java, // Protobuf CommandMessage::class.java, // Base ValidatingBuilder::class.java, // Validation runtime From b74530f5edf2c5a71eaff578528951188aceff4f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 30 Jan 2025 20:56:17 +0000 Subject: [PATCH 53/96] Bump ToolBase -> `2.0.0-SNAPSHOT.250` --- buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt index 8609d8aec..f3da450cc 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object ToolBase { const val group = Spine.toolsGroup - const val version = "2.0.0-SNAPSHOT.240" + const val version = "2.0.0-SNAPSHOT.250" const val lib = "$group:spine-tool-base:$version" const val pluginBase = "$group:spine-plugin-base:$version" From 287e42feb0380b1be6e235bee83b2bccf106133c Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 31 Jan 2025 19:02:11 +0000 Subject: [PATCH 54/96] Remove unused code --- .../spine/tools/mc/java/field/Accessor.java | 17 +--- .../spine/tools/mc/java/field/Accessors.java | 84 ------------------- 2 files changed, 2 insertions(+), 99 deletions(-) delete mode 100644 mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessors.java diff --git a/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessor.java b/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessor.java index 004d79df2..da2588458 100644 --- a/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessor.java +++ b/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessor.java @@ -1,11 +1,11 @@ /* - * Copyright 2022, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -28,7 +28,6 @@ import com.google.common.base.Objects; import com.google.errorprone.annotations.Immutable; -import io.spine.tools.java.code.field.FieldName; import java.io.Serializable; @@ -70,18 +69,6 @@ public static Accessor prefixAndPostfix(String prefix, String suffix) { return new Accessor(prefix, suffix); } - /** - * Formats an accessor method name based on this template and the given field name. - * - * @param field - * the name of the field to access - * @return the method name - */ - public String format(FieldName field) { - var name = String.format(template(), field.capitalize()); - return name; - } - private String template() { return prefix + "%s" + postfix; } diff --git a/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessors.java b/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessors.java deleted file mode 100644 index 85e1add46..000000000 --- a/mc-java-base/src/main/java/io/spine/tools/mc/java/field/Accessors.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright 2022, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.tools.mc.java.field; - -import com.google.common.collect.ImmutableSet; -import io.spine.annotation.Internal; -import io.spine.tools.java.code.field.FieldName; - -import java.util.Collection; - -import static com.google.common.collect.ImmutableSet.toImmutableSet; - -/** - * Property accessor methods generated by the Protobuf compiler for a field. - * - *

Each Protobuf field results in a number of accessor methods. The count and naming of - * the methods depends on the field type. - */ -@Internal -public final class Accessors { - - private final FieldName propertyName; - private final FieldType type; - - private Accessors(FieldName propertyName, FieldType type) { - this.propertyName = propertyName; - this.type = type; - } - - /** - * Creates an instance of {@code GeneratedAccessors} for the given field. - * - * @param name - * the name of the field associated with the accessors - * @param type - * the type of the field associated with the accessors - * @return new instance - */ - public static Accessors forField(io.spine.code.proto.FieldName name, FieldType type) { - var javaFieldName = FieldName.from(name); - return new Accessors(javaFieldName, type); - } - - /** - * Obtains all the names of the accessor methods. - * - *

The accessor methods may have different parameters. Some of the obtained names may - * reference several method overloads. - */ - public ImmutableSet names() { - var names = names(type.accessors()); - return names; - } - - private ImmutableSet names(Collection accessors) { - return accessors.stream() - .map(accessor -> accessor.format(propertyName)) - .collect(toImmutableSet()); - } -} From e6610d04232cc765e4caf9e45619a20c472b501f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 31 Jan 2025 19:02:35 +0000 Subject: [PATCH 55/96] Bump JUnit --- .../src/main/kotlin/io/spine/dependency/test/JUnit.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt index 2ef5b6abf..c651ce8d3 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -29,14 +29,14 @@ package io.spine.dependency.test // https://junit.org/junit5/ @Suppress("unused", "ConstPropertyName") object JUnit { - const val version = "5.10.0" + const val version = "5.11.4" private const val legacyVersion = "4.13.1" // https://github.com/apiguardian-team/apiguardian private const val apiGuardianVersion = "1.1.2" // https://github.com/junit-pioneer/junit-pioneer - private const val pioneerVersion = "2.0.1" + private const val pioneerVersion = "2.3.0" const val legacy = "junit:junit:$legacyVersion" @@ -54,7 +54,7 @@ object JUnit { object Platform { // https://junit.org/junit5/ - const val version = "1.10.0" + const val version = "1.11.4" internal const val group = "org.junit.platform" const val commons = "$group:junit-platform-commons:$version" const val launcher = "$group:junit-platform-launcher:$version" From 6f37a5a7100a3f3fc1c06412145a3da1fcdb292e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 31 Jan 2025 19:03:41 +0000 Subject: [PATCH 56/96] Improve method name --- .../mc/java/annotation/FieldAnnotator.kt | 3 +- .../tools/mc/java/GeneratedAnnotation.kt | 41 +++++++++++++++---- .../tools/mc/java/field/AddFieldClass.kt | 4 +- .../java/comparable/action/AddComparator.kt | 4 +- .../mc/java/comparable/action/AddCompareTo.kt | 4 +- .../mc/java/entity/column/AddColumnClass.kt | 4 +- .../tools/mc/java/entity/query/QueryMethod.kt | 4 +- .../mc/java/entity/query/QuerySupportClass.kt | 4 +- .../java/marker/EveryIsOptionRendererSpec.kt | 2 +- .../mc/java/marker/EveryIsOptionRenderer.kt | 4 +- .../tools/mc/java/routing/EntityClass.kt | 2 +- .../tools/mc/java/routing/Environment.kt | 28 ++++++++----- .../io/spine/tools/mc/java/routing/Exts.kt | 14 +++++-- .../tools/mc/java/routing/RouteVisitor.kt | 41 ++++++++++++++++--- .../java/signal/rejection/RThrowableCode.kt | 9 ++-- .../mc/java/uuid/AddFactoryMethodsSpec.kt | 2 +- .../tools/mc/java/uuid/AddFactoryMethods.kt | 6 +-- 17 files changed, 122 insertions(+), 54 deletions(-) diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt index d520215e9..1f8be1cb2 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,7 +28,6 @@ package io.spine.tools.mc.java.annotation import io.spine.protodata.ast.FieldName import io.spine.protodata.ast.MessageType -import io.spine.protodata.java.ClassName import io.spine.protodata.java.MessageOrBuilderConvention import io.spine.protodata.java.MessageOrEnumConvention import io.spine.tools.java.reference diff --git a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt index 5b88b26bf..c88ff4893 100644 --- a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt +++ b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -27,9 +27,12 @@ package io.spine.tools.mc.java import com.intellij.psi.PsiAnnotation +import com.squareup.javapoet.AnnotationSpec as JAnnotationSpec +import com.squareup.javapoet.CodeBlock +import com.squareup.kotlinpoet.AnnotationSpec as KAnnotationSpec import io.spine.annotation.Generated import io.spine.tools.java.reference -import io.spine.tools.mc.java.GeneratedAnnotation.create +import io.spine.tools.mc.java.GeneratedAnnotation.forPsi import io.spine.tools.mc.java.VersionHolder.version import io.spine.tools.psi.java.Environment.elementFactory import org.intellij.lang.annotations.Language @@ -43,21 +46,20 @@ import org.intellij.lang.annotations.Language * one renderer to others. * * @see Generated - * @see create + * @see forPsi * @see VersionHolder */ public object GeneratedAnnotation { + private val defaultValue = "by Spine Model Compiler (version: ${version.value})" + /** - * Creates a new [PsiAnnotation] with [javax.annotation.Generated] referencing the current - * version of Spine Model Compiler. + * Creates a new [PsiAnnotation] with the [Generated] annotation. * * @param value The string to be put into the annotation `value` parameter. * The default value refers to the current version of Spine Model Compiler. */ - public fun create( - value: String = "by Spine Model Compiler (version: ${version.value})" - ): PsiAnnotation { + public fun forPsi(value: String = defaultValue): PsiAnnotation { val reference = Generated::class.java.reference @Language("JAVA") @Suppress("EmptyClass", "DuplicateStringLiteralInspection") val annotation = elementFactory.createAnnotationFromText( @@ -67,4 +69,27 @@ public object GeneratedAnnotation { ) return annotation } + + /** + * Creates a new [PsiAnnotation] with the [Generated] annotation. + * + * @param value The string to be put into the annotation `value` parameter. + * The default value refers to the current version of Spine Model Compiler. + */ + public fun forJavaPoet(value: String = defaultValue): JAnnotationSpec = + JAnnotationSpec.builder(Generated::class.java) + .addMember("value", CodeBlock.of(value)) + .build() + + + /** + * Creates a new [PsiAnnotation] with the [Generated] annotation. + * + * @param value The string to be put into the annotation `value` parameter. + * The default value refers to the current version of Spine Model Compiler. + */ + public fun forKotlinPoet(value: String = defaultValue): KAnnotationSpec = + KAnnotationSpec.builder(Generated::class) + .addMember("value", CodeBlock.of(value)) + .build() } diff --git a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/field/AddFieldClass.kt b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/field/AddFieldClass.kt index 0b1385683..29c089df0 100644 --- a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/field/AddFieldClass.kt +++ b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/field/AddFieldClass.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -69,7 +69,7 @@ public open class AddFieldClass( public const val NAME: String = "Field" } - override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.create() + override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.forPsi() @Language("JAVA") @Suppress("EmptyClass") override fun classJavadoc(): String = """ diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index 6d39f088e..9f02d5e0d 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ public class AddComparator( comparisonFields.forEach { comparator.comparingBy(it) } val javaField = comparator.build().toPsi() - .apply { addFirst(GeneratedAnnotation.create()) } + .apply { addFirst(GeneratedAnnotation.forPsi()) } cls.addAfter(javaField, cls.lBrace) } diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddCompareTo.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddCompareTo.kt index 0701eb42b..54ba9ad6a 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddCompareTo.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddCompareTo.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,7 +65,7 @@ public class AddCompareTo( ) method.run { addFirst(OverrideAnnotation.create()) - addFirst(GeneratedAnnotation.create()) + addFirst(GeneratedAnnotation.forPsi()) } cls.addLast(method) } diff --git a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClass.kt b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClass.kt index 9c2314061..611623a45 100644 --- a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClass.kt +++ b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClass.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -70,7 +70,7 @@ public class AddColumnClass(type: MessageType, file: SourceFile, context: private val columns: List = type.columns - override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.create() + override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.forPsi() @Language("JAVA") @Suppress("EmptyClass") override fun classJavadoc(): String = """ diff --git a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QueryMethod.kt b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QueryMethod.kt index 1486478c7..1fe0dff14 100644 --- a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QueryMethod.kt +++ b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QueryMethod.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,7 +77,7 @@ internal class QueryMethod(private val file: SourceFile) : WithLogging { """.trimIndent(), entityStateClass ) newMethod.run { - val annotation = GeneratedAnnotation.create() + val annotation = GeneratedAnnotation.forPsi() addFirst(annotation) addFirst(javadoc) } diff --git a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QuerySupportClass.kt b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QuerySupportClass.kt index e58d4145d..a56f48356 100644 --- a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QuerySupportClass.kt +++ b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/query/QuerySupportClass.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ internal abstract class QuerySupportClass( context: CodegenContext ) : CreateNestedClass(type, file, className, context) { - override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.create() + override fun createAnnotation(): PsiAnnotation = GeneratedAnnotation.forPsi() /** * The class of the entity state, same as [messageClass]. diff --git a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt index 337631107..0b9bbdd1e 100644 --- a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt +++ b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt @@ -76,7 +76,7 @@ internal class EveryIsOptionRendererSpec { @Test fun `annotated as generated by Spine Model Compiler`() { - val annotation = GeneratedAnnotation.create().text + val annotation = GeneratedAnnotation.forPsi().text code shouldContain annotation } diff --git a/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/EveryIsOptionRenderer.kt b/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/EveryIsOptionRenderer.kt index ed4c0cecd..5452939d5 100644 --- a/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/EveryIsOptionRenderer.kt +++ b/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/EveryIsOptionRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -87,7 +87,7 @@ internal class EveryIsOptionRenderer : MarkerRenderer() { private fun annotate(file: SourceFile) { val psiFile = file.psi() as PsiJavaFile - val annotation = GeneratedAnnotation.create() + val annotation = GeneratedAnnotation.forPsi() psiFile.topLevelClass.addFirst(annotation) val updatedCode = psiFile.text file.overwrite(updatedCode) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt index 385ad9892..b49195280 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt @@ -33,7 +33,7 @@ import com.google.devtools.ksp.symbol.KSTypeArgument import com.google.devtools.ksp.symbol.KSTypeReference internal class EntityClass( - private val decl: KSClassDeclaration, + val decl: KSClassDeclaration, entityInterface: KSType ) { fun accept(visitor: RouteVisitor<*>, data: Unit) { diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index d46c95d1b..350d0b13c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -33,9 +33,14 @@ import io.spine.server.aggregate.Aggregate import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection +import io.spine.server.route.CommandRouting import io.spine.server.route.CommandRoutingSetup +import io.spine.server.route.EventRouting import io.spine.server.route.EventRoutingSetup +import io.spine.server.route.MessageRouting import io.spine.server.route.StateRoutingSetup +import io.spine.server.route.StateUpdateRouting +import kotlin.reflect.KClass /** * Provides instances required for resolving types or reporting errors or warnings. @@ -44,18 +49,21 @@ internal class Environment( val resolver: Resolver, val logger: KSPLogger ) { - val entityInterface by lazy { Entity::class.java.toType(resolver) } - val aggregateClass by lazy { Aggregate::class.java.toType(resolver) } - val projectionClass by lazy { Projection::class.java.toType(resolver) } - val processManagerClass by lazy { ProcessManager::class.java.toType(resolver) } - val setClass by lazy { Set::class.java.toType(resolver) } + val entityInterface by lazy { Entity::class.toType(resolver) } + val aggregateClass by lazy { Aggregate::class.toType(resolver) } + val projectionClass by lazy { Projection::class.toType(resolver) } + val processManagerClass by lazy { ProcessManager::class.toType(resolver) } + val setClass by lazy { Set::class.toType(resolver) } - val commandRoutingSetup = ClassType(CommandRoutingSetup::class.java) - val eventRoutingSetup = ClassType(EventRoutingSetup::class.java) - val stateRoutingSetup = ClassType(StateRoutingSetup::class.java) + val commandRoutingSetup = SetupType(CommandRoutingSetup::class, CommandRouting::class) + val eventRoutingSetup = SetupType(EventRoutingSetup::class, EventRouting::class) + val stateRoutingSetup = SetupType(StateRoutingSetup::class, StateUpdateRouting::class) - inner class ClassType(val cls: Class) { - val type: KSType by lazy { cls.toType(resolver) } + inner class SetupType( + val setupClass: KClass, + val routingClass: KClass> + ) { + val type: KSType by lazy { setupClass.toType(resolver) } } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt index f8c71fef6..dc1760769 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt @@ -28,22 +28,28 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSType +import kotlin.reflect.KClass /** - * Converts this class into [com.google.devtools.ksp.symbol.KSType] using the given resolver. + * Converts this class into [KSType] using the given resolver. */ -internal fun Class<*>.toType(resolver: Resolver): KSType { - val name = resolver.getKSNameFromString(canonicalName) +internal fun KClass<*>.toType(resolver: Resolver): KSType { + val name = resolver.getKSNameFromString(qualifiedName!!) val classDecl = resolver.getClassDeclarationByName(name) // This is a reminder to add corresponding JAR to `KotlinCompilation` in tests. check(classDecl != null) { - "Unable to find the declaration of `$canonicalName`." + + "Unable to find the declaration of `$qualifiedName!!`." + " Make sure the class is in the compilation classpath." } val type = classDecl.asStarProjectedType() return type } +/** + * Converts this class into [KSType] using the given resolver. + */ +internal fun Class<*>.toType(resolver: Resolver): KSType = kotlin.toType(resolver) + /** * Transform this string into a plural form if the count is greater than one. * diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index a65cced5a..b8ef74876 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -37,14 +37,21 @@ import com.google.devtools.ksp.symbol.KSVisitorVoid import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import com.squareup.kotlinpoet.AnnotationSpec import com.squareup.kotlinpoet.FileSpec +import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy +import com.squareup.kotlinpoet.STAR import com.squareup.kotlinpoet.TypeSpec +import com.squareup.kotlinpoet.WildcardTypeName +import com.squareup.kotlinpoet.asClassName +import com.squareup.kotlinpoet.ksp.toClassName import com.squareup.kotlinpoet.ksp.toTypeName import com.squareup.kotlinpoet.ksp.writeTo -import io.spine.tools.mc.java.routing.Environment.ClassType +import io.spine.server.entity.Entity +import io.spine.tools.mc.java.routing.Environment.SetupType internal sealed class RouteVisitor( - protected val setupType: ClassType, + protected val setupType: SetupType, private val functions: List, protected val codeGenerator: CodeGenerator, protected val environment: Environment, @@ -56,9 +63,13 @@ internal sealed class RouteVisitor( protected abstract val classNameSuffix: String - val idClassTypeArgument: KSTypeArgument by lazy { + val entityClass: EntityClass by lazy { val fn = functions.first() - fn.declaringClass.idClassTypeArgument + fn.declaringClass + } + + val idClassTypeArgument: KSTypeArgument by lazy { + entityClass.idClassTypeArgument } override fun visitClassDeclaration(classDeclaration: KSClassDeclaration, data: Unit) { @@ -72,7 +83,7 @@ internal sealed class RouteVisitor( @OverridingMethodsMustInvokeSuper protected open fun createClass(className: String) { val annotation = AnnotationSpec.builder(AutoService::class) - .addMember("%T::class", setupType.cls) + .addMember("%T::class", setupType.setupClass) .build() routingClass = TypeSpec.classBuilder(className) @@ -84,6 +95,26 @@ internal sealed class RouteVisitor( .replace(listOf(idClassTypeArgument)) .toTypeName() routingClass.addSuperinterface(superInterface) + addEntityClassFunction() + } + + protected fun addEntityClassFunction() { + val entityType = Entity::class.asClassName().parameterizedBy( + idClassTypeArgument.type!!.toTypeName(), + STAR + ) + val classOfEntityInterface = Class::class.asClassName().parameterizedBy( + WildcardTypeName.producerOf(entityType) + ) + + // Define the method that overrides the interface method + val funSpec = FunSpec.builder("entityClass") + .addModifiers(KModifier.OVERRIDE) + .returns(classOfEntityInterface) + .addCode("= %T::class.java\n", entityClass.type.toClassName()) + .build() + + routingClass.addFunction(funSpec) } override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { diff --git a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableCode.kt b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableCode.kt index 87f0546e9..156c486d5 100644 --- a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableCode.kt +++ b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableCode.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,10 +35,9 @@ import io.spine.protodata.ast.MessageType import io.spine.protodata.java.MessageOrEnumConvention import io.spine.protodata.type.TypeSystem import io.spine.tools.java.classSpec -import io.spine.tools.java.code.GeneratedBy -import io.spine.tools.java.code.field.FieldName import io.spine.tools.java.constructorSpec import io.spine.tools.java.methodSpec +import io.spine.tools.mc.java.GeneratedAnnotation import io.spine.tools.mc.java.signal.rejection.Javadoc.forConstructorOfThrowable import io.spine.tools.mc.java.signal.rejection.Javadoc.forThrowableOf import javax.lang.model.element.Modifier.FINAL @@ -81,7 +80,7 @@ internal class RThrowableCode( fun toPoet(): TypeSpec = classSpec(simpleClassName) { addJavadoc(forThrowableOf(rejection)) - addAnnotation(GeneratedBy.spineModelCompiler()) + addAnnotation(GeneratedAnnotation.forJavaPoet()) addModifiers(PUBLIC) superclass(RejectionThrowable::class.java) addField(serialVersionUID()) @@ -126,7 +125,7 @@ private val messageThrown = NoArgMethod("messageThrown") private fun serialVersionUID(): FieldSpec { return FieldSpec.builder( Long::class.javaPrimitiveType, - FieldName.serialVersionUID().value(), PRIVATE, STATIC, FINAL) + "serialVersionUID", PRIVATE, STATIC, FINAL) .initializer("0L") .build() } diff --git a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt index a04c496a9..71d00cef5 100644 --- a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt +++ b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt @@ -39,7 +39,7 @@ import org.junit.jupiter.api.io.TempDir @DisplayName("`AddFactoryMethods` should") internal class AddFactoryMethodsSpec { - private val annotationText = GeneratedAnnotation.create().text + private val annotationText = GeneratedAnnotation.forPsi().text companion object : UuidPluginTestSetup( AddFactoryMethods::class.java, diff --git a/mc-java-uuid/src/main/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethods.kt b/mc-java-uuid/src/main/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethods.kt index db14599c4..ee0dc6061 100644 --- a/mc-java-uuid/src/main/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethods.kt +++ b/mc-java-uuid/src/main/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethods.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -96,7 +96,7 @@ private class MethodGenerate(private val cls: PsiClass) { """.trimIndent(), cls ) method.run { - val annotation = GeneratedAnnotation.create() + val annotation = GeneratedAnnotation.forPsi() addFirst(annotation) addFirst(javadoc) } @@ -138,7 +138,7 @@ private class MethodOf(private val cls: PsiClass) { """.trimIndent(), cls ) method.run { - val annotation = GeneratedAnnotation.create() + val annotation = GeneratedAnnotation.forPsi() addFirst(annotation) addFirst(javadoc) } From 2cd9de5c4bec39c1e701c8a0dede803b8bf9c462 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 31 Jan 2025 19:03:56 +0000 Subject: [PATCH 57/96] Rollback ToolBase -> `2.0.0-SNAPSHOT.240` --- .../src/main/kotlin/io/spine/dependency/local/ToolBase.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt index f3da450cc..2265c073e 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object ToolBase { const val group = Spine.toolsGroup - const val version = "2.0.0-SNAPSHOT.250" + const val version = "2.0.0-SNAPSHOT.240" const val lib = "$group:spine-tool-base:$version" const val pluginBase = "$group:spine-plugin-base:$version" From b7a47facc4f90b9c611f3080a2a6b225ad4bbe1f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 31 Jan 2025 20:17:32 +0000 Subject: [PATCH 58/96] Draft generating `setup` function --- .../spine/given/home/HomeAutomationContext.kt | 2 +- .../tools/mc/java/routing/RouteVisitor.kt | 40 +++++++++++++++++-- 2 files changed, 37 insertions(+), 5 deletions(-) diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt index 635f7a81f..036f7b425 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt @@ -109,7 +109,7 @@ internal class RoomProjectionRepository : ProjectionRepository { override fun entityClass(): Class> = RoomProjection::class.java diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index b8ef74876..71e1b7a42 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -36,9 +36,11 @@ import com.google.devtools.ksp.symbol.KSTypeArgument import com.google.devtools.ksp.symbol.KSVisitorVoid import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper import com.squareup.kotlinpoet.AnnotationSpec +import com.squareup.kotlinpoet.CodeBlock import com.squareup.kotlinpoet.FileSpec import com.squareup.kotlinpoet.FunSpec import com.squareup.kotlinpoet.KModifier +import com.squareup.kotlinpoet.ParameterSpec import com.squareup.kotlinpoet.ParameterizedTypeName.Companion.parameterizedBy import com.squareup.kotlinpoet.STAR import com.squareup.kotlinpoet.TypeSpec @@ -59,10 +61,13 @@ internal sealed class RouteVisitor( private lateinit var packageName: String private lateinit var originalFile: KSFile - protected lateinit var routingClass: TypeSpec.Builder protected abstract val classNameSuffix: String + protected lateinit var routingClass: TypeSpec.Builder + protected lateinit var setupFun: FunSpec.Builder + protected lateinit var routingRunBlock: CodeBlock.Builder + val entityClass: EntityClass by lazy { val fn = functions.first() fn.declaringClass @@ -77,7 +82,7 @@ internal sealed class RouteVisitor( packageName = originalFile.packageName.asString() val className = classDeclaration.simpleName.asString() + classNameSuffix createClass(className) - functions.forEach { it.fn.accept(this, Unit) } + handleFunctions() } @OverridingMethodsMustInvokeSuper @@ -98,6 +103,9 @@ internal sealed class RouteVisitor( addEntityClassFunction() } + /** + * Adds the method that overrides [io.spine.server.route.RoutingSetup.entityClass]. + */ protected fun addEntityClassFunction() { val entityType = Entity::class.asClassName().parameterizedBy( idClassTypeArgument.type!!.toTypeName(), @@ -107,16 +115,40 @@ internal sealed class RouteVisitor( WildcardTypeName.producerOf(entityType) ) - // Define the method that overrides the interface method val funSpec = FunSpec.builder("entityClass") .addModifiers(KModifier.OVERRIDE) .returns(classOfEntityInterface) - .addCode("= %T::class.java\n", entityClass.type.toClassName()) + .addCode("return %T::class.java\n", entityClass.type.toClassName()) .build() routingClass.addFunction(funSpec) } + private fun handleFunctions() { + openSetupFunction() + functions.forEach { it.fn.accept(this, Unit) } + closeSetupFunction() + } + + private fun openSetupFunction() { + val paramName = "routing" + val paramType = setupType.routingClass.asClassName() + .parameterizedBy(idClassTypeArgument.type!!.toTypeName()) + val param = ParameterSpec.builder(paramName, paramType) + setupFun = FunSpec.builder("setup") + .addModifiers(KModifier.OVERRIDE) + .addParameter(param.build()) + + routingRunBlock = CodeBlock.builder() + .add("%N.run {\n", paramName) + } + + private fun closeSetupFunction() { + routingRunBlock.add("}\n") + setupFun.addCode(routingRunBlock.build()) + routingClass.addFunction(setupFun.build()) + } + override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { addRoute(function) } From 3c24463b237a6c0961f7465457f2b691c76246ec Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 14:12:00 +0000 Subject: [PATCH 59/96] Bump `AutoServiceKsp` -> `1.2.0` --- buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt index 5365d7adb..6c222b97c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -50,11 +50,6 @@ object AutoValue { // https://github.com/ZacSweers/auto-service-ksp object AutoServiceKsp { - /** - * The latest version compatible with Kotlin 1.8.22. - * - * @see io.spine.dependency.build.Ksp.version - */ - private const val version = "1.1.0" + private const val version = "1.2.0" const val processor = "dev.zacsweers.autoservice:auto-service-ksp:$version" } From 1f3d4acd29409d57ea23c1edd47054eade19c80f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 14:45:25 +0000 Subject: [PATCH 60/96] Pull the registry up Also: * Make properties private. --- .../io/spine/server/route/RoutingSetup.kt | 56 ------------- .../server/route/RoutingSetupRegistry.kt | 84 +++++++++++++++++++ .../tools/mc/java/routing/RouteProcessor.kt | 2 +- .../tools/mc/java/routing/RouteVisitor.kt | 2 +- 4 files changed, 86 insertions(+), 58 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt index 94c64d845..6644ea1aa 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt @@ -34,7 +34,6 @@ import io.spine.core.CommandContext import io.spine.core.EventContext import io.spine.server.entity.Entity import io.spine.type.KnownMessage -import java.util.ServiceLoader public interface RoutingSetup< I : Any, @@ -47,61 +46,6 @@ public interface RoutingSetup< public fun setup(routing: U) } -internal typealias RSetup = RoutingSetup<*, *, *, *, *> - -internal object RoutingSetupRegistry { - - private val entries: Set - - init { - val setupClasses = setOf( - CommandRoutingSetup::class, - EventRoutingSetup::class, - StateRoutingSetup::class - ) - val allServices = setupClasses - .map { it.java } - .flatMap { ServiceLoader.load(it) } - val grouped = allServices.groupBy { it.entityClass() } - - entries = grouped.map { (cls, setups) -> Entry(cls, setups) }.toSet() - } - - fun find( - entityClass: Class>, - setupClass: Class - ): RSetup? { - val entry = entries.find { it.entityClass == entityClass } - return entry?.find(setupClass) - } - - private data class Entry( - val entityClass: Class>, - private val setups: List - ) { - init { - // Check the consistency of grouping. - setups.forEach { - require(it.entityClass() == entityClass) { - val setupClass = it::class.qualifiedName - val servedBySetup = it.entityClass().simpleName - "The `entityClass` (`${entityClass.simpleName}`) of the entry" + - " must match the property of the setup (`$setupClass`)." + - " Encountered: `$servedBySetup`." - } - } - } - - fun find( - setupClass: Class - ): RSetup? { - val found = setups.find { setupClass.isAssignableFrom(it.javaClass) } - @Suppress("UNCHECKED_CAST") // The cast is protected by the initial check - return found - } - } -} - public interface CommandRoutingSetup : RoutingSetup> { diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt new file mode 100644 index 000000000..0e3a3a85d --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt @@ -0,0 +1,84 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.server.route + +import io.spine.server.entity.Entity +import java.util.* + +private typealias RSetup = RoutingSetup<*, *, *, *, *> + +internal object RoutingSetupRegistry { + + private val entries: Set + + init { + val setupInterfaces = setOf( + CommandRoutingSetup::class, + EventRoutingSetup::class, + StateRoutingSetup::class + ) + val allServices = setupInterfaces + .map { it.java } + .flatMap { ServiceLoader.load(it) } + val grouped = allServices.groupBy { it.entityClass() } + + entries = grouped.map { (cls, setups) -> Entry(cls, setups) }.toSet() + } + + fun find( + entityClass: Class>, + setupInterface: Class + ): RSetup? { + val entry = entries.find { it.entityClass == entityClass } + return entry?.find(setupInterface) + } + + private data class Entry( + val entityClass: Class>, + private val setups: List + ) { + init { + // Check the consistency of grouping. + setups.forEach { setup -> + require(setup.entityClass() == entityClass) { + val setupClass = setup::class.qualifiedName + val servedBySetup = setup.entityClass().simpleName + "The `entityClass` (`${entityClass.simpleName}`) of the entry" + + " must match the property of the setup (`$setupClass`)." + + " Encountered: `$servedBySetup`." + } + } + } + + fun find( + setupClass: Class + ): RSetup? { + val found = setups.find { setupClass.isAssignableFrom(it.javaClass) } + return found + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index bad4b33e6..245a9f67c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -37,7 +37,7 @@ import io.spine.server.route.Route internal class RouteProcessor( private val codeGenerator: CodeGenerator, - internal val logger: KSPLogger + private val logger: KSPLogger ) : SymbolProcessor { private lateinit var environment: Environment diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 71e1b7a42..698518501 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -73,7 +73,7 @@ internal sealed class RouteVisitor( fn.declaringClass } - val idClassTypeArgument: KSTypeArgument by lazy { + private val idClassTypeArgument: KSTypeArgument by lazy { entityClass.idClassTypeArgument } From 7c54dd0509d309ae2a5de7bb51a4a36cdb069361 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 16:48:36 +0000 Subject: [PATCH 61/96] Compare `RouteFun` by message parameters Also: * Add `CodeGenerator` to `Environment`. --- .../tools/mc/java/routing/Environment.kt | 4 +- .../spine/tools/mc/java/routing/KSTypeExts.kt | 9 +++ .../tools/mc/java/routing/RouteProcessor.kt | 55 +++++++++++++++++-- .../tools/mc/java/routing/RouteVisitor.kt | 12 +--- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt index 350d0b13c..48adb5210 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt @@ -26,6 +26,7 @@ package io.spine.tools.mc.java.routing +import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSType @@ -47,7 +48,8 @@ import kotlin.reflect.KClass */ internal class Environment( val resolver: Resolver, - val logger: KSPLogger + val logger: KSPLogger, + val codeGenerator: CodeGenerator ) { val entityInterface by lazy { Entity::class.toType(resolver) } val aggregateClass by lazy { Aggregate::class.toType(resolver) } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt index 7cb808e9b..1c814877c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt @@ -26,8 +26,17 @@ package io.spine.tools.mc.java.routing +import com.google.devtools.ksp.symbol.ClassKind.INTERFACE +import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSType +/** + * Tells if this type represents an interface. + */ +internal val KSType.isInterface: Boolean + get() = (declaration is KSClassDeclaration) + && (declaration as KSClassDeclaration).classKind == INTERFACE + /** * Obtains a simple name of the type surrounded with back ticks. */ diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index 245a9f67c..c5e46be18 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -43,7 +43,7 @@ internal class RouteProcessor( private lateinit var environment: Environment override fun process(resolver: Resolver): List { - this.environment = Environment(resolver, logger) + this.environment = Environment(resolver, logger, codeGenerator) val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } @@ -61,7 +61,7 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val crv = CommandRouteVisitor(functions, codeGenerator, environment) + val crv = CommandRouteVisitor(functions, environment) declaringClass.accept(crv, Unit) crv.writeFile() } @@ -71,7 +71,7 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val erv = EventRouteVisitor(functions, codeGenerator, environment) + val erv = EventRouteVisitor(functions, environment) declaringClass.accept(erv, Unit) erv.writeFile() } @@ -81,7 +81,7 @@ internal class RouteProcessor( val routing = qualified.filterIsInstance() val grouped = routing.groupByClasses() grouped.forEach { (declaringClass, functions) -> - val erv = StateUpdateRouteVisitor(functions, codeGenerator, environment) + val erv = StateUpdateRouteVisitor(functions, environment) declaringClass.accept(erv, Unit) erv.writeFile() } @@ -90,3 +90,50 @@ internal class RouteProcessor( private fun List.groupByClasses(): Map> = groupBy { it.declaringClass } + .mapValues { (_, list) -> + RouteFunComparator.sort(list) + } + +/** + * Compares two [RouteFun] instances by their [messageParameter][RouteFun.messageParameter] + * properties, putting more abstract type further in the sorting order. + */ +private class RouteFunComparator : Comparator { + + @Suppress("ReturnCount") + override fun compare(o1: RouteFun, o2: RouteFun): Int { + val m1 = o1.messageParameter + val m2 = o2.messageParameter + + if (m1 == m2) { + return 0 + } + // An interface should come after a class in the sorting. + if (m1.isInterface && !m2.isInterface) { + return 1 + } + if (!m1.isInterface && m2.isInterface) { + return -1 + } + // Both are either classes or interfaces. + // The one that is more abstract goes further in sorting. + if (m1.isAssignableFrom(m2)) { + return 1 + } + if (m2.isAssignableFrom(m1)) { + return -1 + } + val n1 = m1.declaration.qualifiedName?.asString() + val n2 = m2.declaration.qualifiedName?.asString() + return compareValues(n1, n2) + } + + companion object { + + fun sort(list: List): List { + val comparator = RouteFunComparator() + return list.sortedWith(comparator) + } + } +} + diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 698518501..858d95c1d 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -27,7 +27,6 @@ package io.spine.tools.mc.java.routing import com.google.auto.service.AutoService -import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile @@ -55,7 +54,6 @@ import io.spine.tools.mc.java.routing.Environment.SetupType internal sealed class RouteVisitor( protected val setupType: SetupType, private val functions: List, - protected val codeGenerator: CodeGenerator, protected val environment: Environment, ) : KSVisitorVoid() { @@ -161,21 +159,18 @@ internal sealed class RouteVisitor( .addType(cls) .build() val deps = Dependencies(true, originalFile) - code.writeTo(codeGenerator, deps) + code.writeTo(environment.codeGenerator, deps) } } internal class CommandRouteVisitor( functions: List, - codeGenerator: CodeGenerator, environment: Environment ) : RouteVisitor( environment.commandRoutingSetup, functions, - codeGenerator, environment ) { - override val classNameSuffix: String = "CommandRouting" override fun addRoute(function: KSFunctionDeclaration) { @@ -185,15 +180,12 @@ internal class CommandRouteVisitor( internal class EventRouteVisitor( functions: List, - codeGenerator: CodeGenerator, environment: Environment ) : RouteVisitor( environment.eventRoutingSetup, functions, - codeGenerator, environment ) { - override val classNameSuffix: String = "EventRouting" override fun createClass(className: String): Unit = environment.run { @@ -207,12 +199,10 @@ internal class EventRouteVisitor( internal class StateUpdateRouteVisitor( functions: List, - codeGenerator: CodeGenerator, environment: Environment ) : RouteVisitor( environment.stateRoutingSetup, functions, - codeGenerator, environment ) { From 3fccf27c7f4d91e3b82cc7ce51cd6bec06aef593 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 20:00:02 +0000 Subject: [PATCH 62/96] Bump CoreJava -> `2.0.0-SNAPSHOT.193` --- .../src/main/kotlin/io/spine/dependency/local/CoreJava.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt index b7b23e2e4..60899e2dd 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object CoreJava { const val group = Spine.group - const val version = "2.0.0-SNAPSHOT.192" + const val version = "2.0.0-SNAPSHOT.193" const val coreArtifact = "spine-core" const val clientArtifact = "spine-client" From 1c05224469377772ecf59859d7230977ca7c58b5 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 20:01:30 +0000 Subject: [PATCH 63/96] Generate event routes --- .../spine/given/home/HomeAutomationContext.kt | 8 +-- .../spine/tools/mc/java/routing/RouteFun.kt | 8 ++- .../tools/mc/java/routing/RouteVisitor.kt | 51 +++++++++++++------ 3 files changed, 46 insertions(+), 21 deletions(-) diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt index 036f7b425..128da4193 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt @@ -51,17 +51,17 @@ fun homeAutomation(): BoundedContext = BoundedContext.singleTenant("HomeAutomati public class RoomProjection : Projection() { @Subscribe - fun on(e: RoomAdded) = alter { + internal fun on(e: RoomAdded) = alter { name = e.name } @Subscribe - fun on(e: RoomRenamed) = alter { + internal fun on(e: RoomRenamed) = alter { name = e.name } @Subscribe - fun on(e: DeviceMoved) = alter { + internal fun on(e: DeviceMoved) = alter { if (id == e.prevRoom) { val toRemove = deviceBuilderList.find { b -> b.uuid == e.device.uuid } if (toRemove != null) { @@ -116,7 +116,7 @@ public class RoomProjectionEventRoutingX : EventRoutingSetup { override fun setup(routing: EventRouting) { routing.run { - route { e, _ -> RoomProjection.routeMoved(e) } + route { e -> RoomProjection.routeMoved(e) } unicast { e -> RoomProjection.route(e) } } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt index 0890e9bc9..f91122526 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -28,16 +28,22 @@ package io.spine.tools.mc.java.routing import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType +import com.squareup.kotlinpoet.ClassName +import com.squareup.kotlinpoet.ksp.toClassName internal sealed class RouteFun( - val fn: KSFunctionDeclaration, + val decl: KSFunctionDeclaration, val declaringClass: EntityClass, parameters: Pair, val returnType: KSType ) { val messageParameter: KSType = parameters.first + val messageClass: ClassName = messageParameter.toClassName() val contextParameter: KSType? = parameters.second + val contextClass: ClassName? = contextParameter?.toClassName() val acceptsContext: Boolean = contextParameter != null + + val isUnicast: Boolean = returnType.declaration.typeParameters.isEmpty() } internal class CommandRouteFun( diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 858d95c1d..bfa29c8c5 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -30,7 +30,6 @@ import com.google.auto.service.AutoService import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile -import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSTypeArgument import com.google.devtools.ksp.symbol.KSVisitorVoid import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper @@ -80,7 +79,7 @@ internal sealed class RouteVisitor( packageName = originalFile.packageName.asString() val className = classDeclaration.simpleName.asString() + classNameSuffix createClass(className) - handleFunctions() + handleRouteFunctions() } @OverridingMethodsMustInvokeSuper @@ -122,9 +121,9 @@ internal sealed class RouteVisitor( routingClass.addFunction(funSpec) } - private fun handleFunctions() { + private fun handleRouteFunctions() { openSetupFunction() - functions.forEach { it.fn.accept(this, Unit) } + functions.forEach { addRoute(it) } closeSetupFunction() } @@ -138,21 +137,17 @@ internal sealed class RouteVisitor( .addParameter(param.build()) routingRunBlock = CodeBlock.builder() - .add("%N.run {\n", paramName) + .beginControlFlow("%N.run", paramName) } + protected abstract fun addRoute(fn: F) + private fun closeSetupFunction() { - routingRunBlock.add("}\n") + routingRunBlock.endControlFlow() setupFun.addCode(routingRunBlock.build()) routingClass.addFunction(setupFun.build()) } - override fun visitFunctionDeclaration(function: KSFunctionDeclaration, data: Unit) { - addRoute(function) - } - - protected abstract fun addRoute(function: KSFunctionDeclaration) - fun writeFile() { val cls = routingClass.build() val code = FileSpec.builder(packageName, cls.name!!) @@ -173,7 +168,7 @@ internal class CommandRouteVisitor( ) { override val classNameSuffix: String = "CommandRouting" - override fun addRoute(function: KSFunctionDeclaration) { + override fun addRoute(fn: CommandRouteFun) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } @@ -192,8 +187,32 @@ internal class EventRouteVisitor( super.createClass(className) } - override fun addRoute(function: KSFunctionDeclaration) { - //TODO:2025-01-22:alexander.yevsyukov: Implement. + /** + * Adds the entry in the routing setup function inside the [routingRunBlock]. + * + * For a multicast route it would be something like: + * ```kotlin + * route { e, c -> MyEntity.myRouteFun(e, c) } + * ``` + * For an unicast route it would be something like: + * ```kotlin + * unicast { e, c -> MyEntity.myRoutFun(e, c) } + * ``` + * If a route function does not accept context, the lambdas would have only the `e` parameter. + */ + override fun addRoute(fn: EventRouteFun) { + val params = if (fn.acceptsContext) "e, c" else "e" + val entryFn = if (fn.isUnicast) "unicast" else "route" + + routingRunBlock.add( + "%L<%T> { %L -> %T.%L(%L) }\n", + entryFn, + fn.messageClass, + params, + entityClass.type.toClassName(), + fn.decl.simpleName.asString(), + params + ) } } @@ -208,7 +227,7 @@ internal class StateUpdateRouteVisitor( override val classNameSuffix: String = "StateUpdateRouting" - override fun addRoute(function: KSFunctionDeclaration) { + override fun addRoute(fn: StateUpdateRouteFun) { //TODO:2025-01-22:alexander.yevsyukov: Implement. } } From cee77901d6d5df7748e1b2b4336fbe2b73a76b0a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 1 Feb 2025 20:13:40 +0000 Subject: [PATCH 64/96] Use 4 spaces for indentation --- .../main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index bfa29c8c5..0aca9773c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -48,6 +48,7 @@ import com.squareup.kotlinpoet.ksp.toClassName import com.squareup.kotlinpoet.ksp.toTypeName import com.squareup.kotlinpoet.ksp.writeTo import io.spine.server.entity.Entity +import io.spine.string.Indent import io.spine.tools.mc.java.routing.Environment.SetupType internal sealed class RouteVisitor( @@ -151,6 +152,7 @@ internal sealed class RouteVisitor( fun writeFile() { val cls = routingClass.build() val code = FileSpec.builder(packageName, cls.name!!) + .indent(Indent.defaultJavaIndent.value) .addType(cls) .build() val deps = Dependencies(true, originalFile) From bbea08dcc4ccbaeb1b39be01f059b15a5ca0224b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 2 Feb 2025 16:36:30 +0000 Subject: [PATCH 65/96] Add `Generated` annotation --- .../spine/tools/mc/java/GeneratedAnnotation.kt | 9 ++++----- .../spine/given/home/HomeAutomationContext.kt | 18 ------------------ mc-java-routing/build.gradle.kts | 1 + .../tools/mc/java/routing/RouteVisitor.kt | 7 +++++-- 4 files changed, 10 insertions(+), 25 deletions(-) diff --git a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt index c88ff4893..ba3fa2ed8 100644 --- a/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt +++ b/mc-java-base/src/main/kotlin/io/spine/tools/mc/java/GeneratedAnnotation.kt @@ -27,15 +27,14 @@ package io.spine.tools.mc.java import com.intellij.psi.PsiAnnotation -import com.squareup.javapoet.AnnotationSpec as JAnnotationSpec -import com.squareup.javapoet.CodeBlock -import com.squareup.kotlinpoet.AnnotationSpec as KAnnotationSpec import io.spine.annotation.Generated import io.spine.tools.java.reference import io.spine.tools.mc.java.GeneratedAnnotation.forPsi import io.spine.tools.mc.java.VersionHolder.version import io.spine.tools.psi.java.Environment.elementFactory import org.intellij.lang.annotations.Language +import com.squareup.javapoet.AnnotationSpec as JAnnotationSpec +import com.squareup.kotlinpoet.AnnotationSpec as KAnnotationSpec /** * Creates [PsiAnnotation] for marking code elements created by McJava. @@ -78,7 +77,7 @@ public object GeneratedAnnotation { */ public fun forJavaPoet(value: String = defaultValue): JAnnotationSpec = JAnnotationSpec.builder(Generated::class.java) - .addMember("value", CodeBlock.of(value)) + .addMember("value", "\"%L\"", value) .build() @@ -90,6 +89,6 @@ public object GeneratedAnnotation { */ public fun forKotlinPoet(value: String = defaultValue): KAnnotationSpec = KAnnotationSpec.builder(Generated::class) - .addMember("value", CodeBlock.of(value)) + .addMember("\"%L\"", value) .build() } diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt index 128da4193..935796e95 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt @@ -26,7 +26,6 @@ package io.spine.given.home -import com.google.auto.service.AutoService import io.spine.core.Subscribe import io.spine.given.home.events.DeviceMoved import io.spine.given.home.events.RoomAdded @@ -34,7 +33,6 @@ import io.spine.given.home.events.RoomEvent import io.spine.given.home.events.RoomRenamed import io.spine.protobuf.isDefault import io.spine.server.BoundedContext -import io.spine.server.entity.Entity import io.spine.server.entity.alter import io.spine.server.projection.Projection import io.spine.server.projection.ProjectionRepository @@ -105,19 +103,3 @@ internal class RoomProjectionRepository : ProjectionRepository { - - override fun entityClass(): Class> = RoomProjection::class.java - - override fun setup(routing: EventRouting) { - routing.run { - route { e -> RoomProjection.routeMoved(e) } - unicast { e -> RoomProjection.route(e) } - } - } -} diff --git a/mc-java-routing/build.gradle.kts b/mc-java-routing/build.gradle.kts index 535f30b81..b432ac88f 100644 --- a/mc-java-routing/build.gradle.kts +++ b/mc-java-routing/build.gradle.kts @@ -47,6 +47,7 @@ dependencies { implementation(Ksp.symbolProcessingApi) implementation(KotlinPoet.ksp) implementation(CoreJava.server) + implementation(project(":mc-java-base")) testImplementation(AutoService.annotations) testImplementation(Kotest.assertions) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 0aca9773c..475e97ed9 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -49,6 +49,7 @@ import com.squareup.kotlinpoet.ksp.toTypeName import com.squareup.kotlinpoet.ksp.writeTo import io.spine.server.entity.Entity import io.spine.string.Indent +import io.spine.tools.mc.java.GeneratedAnnotation import io.spine.tools.mc.java.routing.Environment.SetupType internal sealed class RouteVisitor( @@ -85,14 +86,16 @@ internal sealed class RouteVisitor( @OverridingMethodsMustInvokeSuper protected open fun createClass(className: String) { - val annotation = AnnotationSpec.builder(AutoService::class) + val generated = GeneratedAnnotation.forKotlinPoet() + val autoService = AnnotationSpec.builder(AutoService::class) .addMember("%T::class", setupType.setupClass) .build() routingClass = TypeSpec.classBuilder(className) // Must be `public` because created reflectively via `AutoService` .addModifiers(KModifier.PUBLIC) - .addAnnotation(annotation) + .addAnnotation(generated) + .addAnnotation(autoService) val superInterface = setupType.type .replace(listOf(idClassTypeArgument)) From dfa04561a9fc2166d748d417b25d2435ecc60b75 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 2 Feb 2025 17:08:02 +0000 Subject: [PATCH 66/96] Add KDoc for the generated setup --- .../io/spine/tools/mc/java/routing/EntityClass.kt | 2 +- .../io/spine/tools/mc/java/routing/RouteVisitor.kt | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt index b49195280..04309555c 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt @@ -53,7 +53,7 @@ internal class EntityClass( asEntity.element!!.typeArguments.first() } - val idClassReference: KSTypeReference by lazy { + private val idClassReference: KSTypeReference by lazy { idClassTypeArgument.type!! } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index 475e97ed9..afb4124d3 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -92,6 +92,7 @@ internal sealed class RouteVisitor( .build() routingClass = TypeSpec.classBuilder(className) + .addKdoc(classKDoc()) // Must be `public` because created reflectively via `AutoService` .addModifiers(KModifier.PUBLIC) .addAnnotation(generated) @@ -104,10 +105,17 @@ internal sealed class RouteVisitor( addEntityClassFunction() } + private fun classKDoc(): CodeBlock = CodeBlock.builder() + .add("Configures [%T] of the repository managing [%T] instances.\n\n", + setupType.routingClass.asClassName(), + entityClass.type.toClassName()) + .add("@see %T.apply()\n", setupType.setupClass.asClassName()) + .build() + /** * Adds the method that overrides [io.spine.server.route.RoutingSetup.entityClass]. */ - protected fun addEntityClassFunction() { + private fun addEntityClassFunction() { val entityType = Entity::class.asClassName().parameterizedBy( idClassTypeArgument.type!!.toTypeName(), STAR @@ -188,10 +196,6 @@ internal class EventRouteVisitor( ) { override val classNameSuffix: String = "EventRouting" - override fun createClass(className: String): Unit = environment.run { - super.createClass(className) - } - /** * Adds the entry in the routing setup function inside the [routingRunBlock]. * From affe0b814e630c5de4eabc0976a46a44ddc6b9e2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 2 Feb 2025 18:29:35 +0000 Subject: [PATCH 67/96] Pull visitors to the package level --- .../mc/java/routing/CommandRouteVisitor.kt | 50 +++++++ .../mc/java/routing/EventRouteVisitor.kt | 80 ++++++++++ .../spine/tools/mc/java/routing/RouteFun.kt | 7 +- .../tools/mc/java/routing/RouteProcessor.kt | 85 +---------- .../tools/mc/java/routing/RouteVisitor.kt | 138 ++++++++++-------- .../java/routing/StateUpdateRouteVisitor.kt | 51 +++++++ 6 files changed, 261 insertions(+), 150 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt new file mode 100644 index 000000000..0dac63c15 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt @@ -0,0 +1,50 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +internal class CommandRouteVisitor( + functions: List, + environment: Environment +) : RouteVisitor( + environment.commandRoutingSetup, + functions, + environment +) { + override val classNameSuffix: String = "CommandRouting" + + override fun addRoute(fn: CommandRouteFun) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } + + companion object { + fun process(qualified: List, environment: Environment) { + runVisitors(qualified) { functions -> + CommandRouteVisitor(functions, environment) + } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt new file mode 100644 index 000000000..ad9bb80fb --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt @@ -0,0 +1,80 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +import com.squareup.kotlinpoet.ksp.toClassName + +internal class EventRouteVisitor( + functions: List, + environment: Environment +) : RouteVisitor( + environment.eventRoutingSetup, + functions, + environment +) { + override val classNameSuffix: String = "EventRouting" + + /** + * Adds the entry in the routing setup function inside the [routingRunBlock]. + * + * For a multicast route it would be something like: + * ```kotlin + * route { e, c -> MyEntity.myRouteFun(e, c) } + * ``` + * For an unicast route it would be something like: + * ```kotlin + * unicast { e, c -> MyEntity.myRoutFun(e, c) } + * ``` + * If a route function does not accept context, the lambdas would have only the `e` parameter. + */ + override fun addRoute(fn: EventRouteFun) { + val params = if (fn.acceptsContext) "e, c" else "e" + val entryFn = if (fn.isUnicast) "unicast" else "route" + + routingRunBlock.add( + "%L<%T> { %L -> %T.%L(%L) }\n", + entryFn, + fn.messageClass, + params, + entityClass.type.toClassName(), + fn.decl.simpleName.asString(), + params + ) + } + + companion object { + + /** + * Processes the given route functions using [EventRouteVisitor]. + */ + internal fun process(qualified: List, environment: Environment) { + runVisitors(qualified) { functions -> + EventRouteVisitor(functions, environment) + } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt index f91122526..724679106 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt @@ -35,14 +35,11 @@ internal sealed class RouteFun( val decl: KSFunctionDeclaration, val declaringClass: EntityClass, parameters: Pair, - val returnType: KSType + returnType: KSType ) { val messageParameter: KSType = parameters.first val messageClass: ClassName = messageParameter.toClassName() - val contextParameter: KSType? = parameters.second - val contextClass: ClassName? = contextParameter?.toClassName() - val acceptsContext: Boolean = contextParameter != null - + val acceptsContext: Boolean = parameters.second != null val isUnicast: Boolean = returnType.declaration.typeParameters.isEmpty() } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt index c5e46be18..3e8136cd7 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt @@ -48,92 +48,9 @@ internal class RouteProcessor( val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } - val qualified = RouteSignature.qualify(allValid, environment) - processCommands(qualified) - processEvents(qualified) - processStateUpdates(qualified) + RouteVisitor.process(allValid, environment) val unprocessed = allAnnotated.filterNot { it.validate() }.toList() return unprocessed } - - private fun processCommands(qualified: List) { - val routing = qualified.filterIsInstance() - val grouped = routing.groupByClasses() - grouped.forEach { (declaringClass, functions) -> - val crv = CommandRouteVisitor(functions, environment) - declaringClass.accept(crv, Unit) - crv.writeFile() - } - } - - private fun processEvents(qualified: List) { - val routing = qualified.filterIsInstance() - val grouped = routing.groupByClasses() - grouped.forEach { (declaringClass, functions) -> - val erv = EventRouteVisitor(functions, environment) - declaringClass.accept(erv, Unit) - erv.writeFile() - } - } - - private fun processStateUpdates(qualified: List) { - val routing = qualified.filterIsInstance() - val grouped = routing.groupByClasses() - grouped.forEach { (declaringClass, functions) -> - val erv = StateUpdateRouteVisitor(functions, environment) - declaringClass.accept(erv, Unit) - erv.writeFile() - } - } } - -private fun List.groupByClasses(): Map> = - groupBy { it.declaringClass } - .mapValues { (_, list) -> - RouteFunComparator.sort(list) - } - -/** - * Compares two [RouteFun] instances by their [messageParameter][RouteFun.messageParameter] - * properties, putting more abstract type further in the sorting order. - */ -private class RouteFunComparator : Comparator { - - @Suppress("ReturnCount") - override fun compare(o1: RouteFun, o2: RouteFun): Int { - val m1 = o1.messageParameter - val m2 = o2.messageParameter - - if (m1 == m2) { - return 0 - } - // An interface should come after a class in the sorting. - if (m1.isInterface && !m2.isInterface) { - return 1 - } - if (!m1.isInterface && m2.isInterface) { - return -1 - } - // Both are either classes or interfaces. - // The one that is more abstract goes further in sorting. - if (m1.isAssignableFrom(m2)) { - return 1 - } - if (m2.isAssignableFrom(m1)) { - return -1 - } - val n1 = m1.declaration.qualifiedName?.asString() - val n2 = m2.declaration.qualifiedName?.asString() - return compareValues(n1, n2) - } - - companion object { - - fun sort(list: List): List { - val comparator = RouteFunComparator() - return list.sortedWith(comparator) - } - } -} - diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt index afb4124d3..1e30fb1fa 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt @@ -30,6 +30,7 @@ import com.google.auto.service.AutoService import com.google.devtools.ksp.processing.Dependencies import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFile +import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSTypeArgument import com.google.devtools.ksp.symbol.KSVisitorVoid import com.google.errorprone.annotations.OverridingMethodsMustInvokeSuper @@ -169,74 +170,89 @@ internal sealed class RouteVisitor( val deps = Dependencies(true, originalFile) code.writeTo(environment.codeGenerator, deps) } -} -internal class CommandRouteVisitor( - functions: List, - environment: Environment -) : RouteVisitor( - environment.commandRoutingSetup, - functions, - environment -) { - override val classNameSuffix: String = "CommandRouting" - - override fun addRoute(fn: CommandRouteFun) { - //TODO:2025-01-22:alexander.yevsyukov: Implement. - } -} + companion object { -internal class EventRouteVisitor( - functions: List, - environment: Environment -) : RouteVisitor( - environment.eventRoutingSetup, - functions, - environment -) { - override val classNameSuffix: String = "EventRouting" + internal fun process( + allValid: Sequence, + environment: Environment + ) { + val qualified = RouteSignature.qualify(allValid, environment) + CommandRouteVisitor.process(qualified, environment) + EventRouteVisitor.process(qualified, environment) + StateUpdateRouteVisitor.process(qualified, environment) + } - /** - * Adds the entry in the routing setup function inside the [routingRunBlock]. - * - * For a multicast route it would be something like: - * ```kotlin - * route { e, c -> MyEntity.myRouteFun(e, c) } - * ``` - * For an unicast route it would be something like: - * ```kotlin - * unicast { e, c -> MyEntity.myRoutFun(e, c) } - * ``` - * If a route function does not accept context, the lambdas would have only the `e` parameter. - */ - override fun addRoute(fn: EventRouteFun) { - val params = if (fn.acceptsContext) "e, c" else "e" - val entryFn = if (fn.isUnicast) "unicast" else "route" - - routingRunBlock.add( - "%L<%T> { %L -> %T.%L(%L) }\n", - entryFn, - fn.messageClass, - params, - entityClass.type.toClassName(), - fn.decl.simpleName.asString(), - params - ) + internal inline fun , reified F : RouteFun> runVisitors( + qualified: List, + createVisitor: (List) -> V + ) { + val routing = qualified.filterIsInstance() + val grouped = routing.groupByClasses() + grouped.forEach { (declaringClass, functions) -> + val v = createVisitor(functions) + declaringClass.accept(v, Unit) + v.writeFile() + } + } } } -internal class StateUpdateRouteVisitor( - functions: List, - environment: Environment -) : RouteVisitor( - environment.stateRoutingSetup, - functions, - environment -) { +/** + * Groups this list of route functions by the classes in which they are declared. + * + * The grouped functions are then sorted by the [first parameter type][RouteFun.messageParameter], + * putting classes first, and then less abstract interfaces, and so on down to more abstract ones. + * + * This order will be used when adding routes for each [entity class][RouteFun.declaringClass]. + * + * @see RouteFunComparator + */ +private fun List.groupByClasses(): Map> = + groupBy { it.declaringClass } + .mapValues { (_, list) -> + RouteFunComparator.sort(list) + } + +/** + * Compares two [RouteFun] instances by their [messageParameter][RouteFun.messageParameter] + * properties, putting more abstract type further in the sorting order. + */ +private class RouteFunComparator : Comparator { + + @Suppress("ReturnCount") + override fun compare(o1: RouteFun, o2: RouteFun): Int { + val m1 = o1.messageParameter + val m2 = o2.messageParameter + + if (m1 == m2) { + return 0 + } + // An interface should come after a class in the sorting. + if (m1.isInterface && !m2.isInterface) { + return 1 + } + if (!m1.isInterface && m2.isInterface) { + return -1 + } + // Both are either classes or interfaces. + // The one that is more abstract goes further in sorting. + if (m1.isAssignableFrom(m2)) { + return 1 + } + if (m2.isAssignableFrom(m1)) { + return -1 + } + val n1 = m1.declaration.qualifiedName?.asString() + val n2 = m2.declaration.qualifiedName?.asString() + return compareValues(n1, n2) + } - override val classNameSuffix: String = "StateUpdateRouting" + companion object { - override fun addRoute(fn: StateUpdateRouteFun) { - //TODO:2025-01-22:alexander.yevsyukov: Implement. + fun sort(list: List): List { + val comparator = RouteFunComparator() + return list.sortedWith(comparator) + } } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt new file mode 100644 index 000000000..b3b33b139 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt @@ -0,0 +1,51 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.tools.mc.java.routing + +internal class StateUpdateRouteVisitor( + functions: List, + environment: Environment +) : RouteVisitor( + environment.stateRoutingSetup, + functions, + environment +) { + + override val classNameSuffix: String = "StateUpdateRouting" + + override fun addRoute(fn: StateUpdateRouteFun) { + //TODO:2025-01-22:alexander.yevsyukov: Implement. + } + + companion object { + fun process(qualified: List, environment: Environment) { + runVisitors(qualified) { functions -> + StateUpdateRouteVisitor(functions, environment) + } + } + } +} From 2fe2bbf28bfadb4f83b22a982b0baab8715c5b1f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 2 Feb 2025 18:42:03 +0000 Subject: [PATCH 68/96] Introduce `processor` package Also: * Pull setup interfaces to the package level. --- .../spine/server/route/CommandRoutingSetup.kt | 46 +++++++++++++++++ .../spine/server/route/EventRoutingSetup.kt | 46 +++++++++++++++++ .../io/spine/server/route/RoutingSetup.kt | 50 ------------------- .../spine/server/route/StateRoutingSetup.kt | 46 +++++++++++++++++ .../{ => proessor}/CommandRouteSignature.kt | 2 +- .../{ => proessor}/CommandRouteVisitor.kt | 2 +- .../routing/{ => proessor}/CommonChecks.kt | 6 +-- .../routing/{ => proessor}/EntityClass.kt | 2 +- .../routing/{ => proessor}/Environment.kt | 2 +- .../{ => proessor}/EventRouteSignature.kt | 2 +- .../{ => proessor}/EventRouteVisitor.kt | 2 +- .../mc/java/routing/{ => proessor}/Exts.kt | 2 +- .../{ => proessor}/KSDeclarationExts.kt | 2 +- .../java/routing/{ => proessor}/KSTypeExts.kt | 2 +- .../java/routing/{ => proessor}/Qualifier.kt | 4 +- .../java/routing/{ => proessor}/RouteFun.kt | 2 +- .../routing/{ => proessor}/RouteProcessor.kt | 2 +- .../{ => proessor}/RouteProcessorProvider.kt | 2 +- .../routing/{ => proessor}/RouteSignature.kt | 4 +- .../routing/{ => proessor}/RouteVisitor.kt | 4 +- .../StateUpdateRouteSignature.kt | 2 +- .../{ => proessor}/StateUpdateRouteVisitor.kt | 2 +- .../mc/java/routing/JavaRouteErrorSpec.kt | 2 +- .../mc/java/routing/KotlinRouteErrorSpec.kt | 4 +- .../mc/java/routing/RouteCompilationTest.kt | 1 + 25 files changed, 165 insertions(+), 76 deletions(-) create mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt create mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/CommandRouteSignature.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/CommandRouteVisitor.kt (97%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/CommonChecks.kt (95%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/EntityClass.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/Environment.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/EventRouteSignature.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/EventRouteVisitor.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/Exts.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/KSDeclarationExts.kt (96%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/KSTypeExts.kt (97%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/Qualifier.kt (96%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/RouteFun.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/RouteProcessor.kt (97%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/RouteProcessorProvider.kt (97%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/RouteSignature.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/RouteVisitor.kt (98%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/StateUpdateRouteSignature.kt (97%) rename mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/{ => proessor}/StateUpdateRouteVisitor.kt (97%) diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt new file mode 100644 index 000000000..c8c2f64e9 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.server.route + +import io.spine.base.CommandMessage +import io.spine.core.CommandContext +import io.spine.server.entity.Entity + +public interface CommandRoutingSetup : + RoutingSetup> { + + public companion object { + + public fun apply(cls: Class>, routing: CommandRouting) { + val found = RoutingSetupRegistry.find(cls, CommandRoutingSetup::class.java) + found?.let { + @Suppress("UNCHECKED_CAST") + (it as CommandRoutingSetup).setup(routing) + } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt new file mode 100644 index 000000000..f18d82471 --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.server.route + +import io.spine.base.EventMessage +import io.spine.core.EventContext +import io.spine.server.entity.Entity + +public interface EventRoutingSetup : + RoutingSetup, EventRouting> { + + public companion object { + + public fun apply(cls: Class>, routing: EventRouting) { + val fount = RoutingSetupRegistry.find(cls, EventRoutingSetup::class.java) + fount?.let { + @Suppress("UNCHECKED_CAST") + (it as EventRoutingSetup).setup(routing) + } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt index 6644ea1aa..295b8fb62 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt @@ -26,12 +26,7 @@ package io.spine.server.route -import io.spine.base.CommandMessage -import io.spine.base.EntityState -import io.spine.base.EventMessage import io.spine.base.MessageContext -import io.spine.core.CommandContext -import io.spine.core.EventContext import io.spine.server.entity.Entity import io.spine.type.KnownMessage @@ -45,48 +40,3 @@ public interface RoutingSetup< public fun entityClass(): Class> public fun setup(routing: U) } - -public interface CommandRoutingSetup : - RoutingSetup> { - - public companion object { - - public fun apply(cls: Class>, routing: CommandRouting) { - val found = RoutingSetupRegistry.find(cls, CommandRoutingSetup::class.java) - found?.let { - @Suppress("UNCHECKED_CAST") - (it as CommandRoutingSetup).setup(routing) - } - } - } -} - -public interface EventRoutingSetup : - RoutingSetup, EventRouting> { - - public companion object { - - public fun apply(cls: Class>, routing: EventRouting) { - val fount = RoutingSetupRegistry.find(cls, EventRoutingSetup::class.java) - fount?.let { - @Suppress("UNCHECKED_CAST") - (it as EventRoutingSetup).setup(routing) - } - } - } -} - -public interface StateRoutingSetup : - RoutingSetup, EventContext, Set, StateUpdateRouting> { - - public companion object { - - public fun apply(cls: Class>, routing: StateUpdateRouting) { - val found = RoutingSetupRegistry.find(cls, StateRoutingSetup::class.java) - found?.let { - @Suppress("UNCHECKED_CAST") - (it as StateRoutingSetup).setup(routing) - } - } - } -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt new file mode 100644 index 000000000..80044d38e --- /dev/null +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt @@ -0,0 +1,46 @@ +/* + * Copyright 2025, TeamDev. All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Redistribution and use in source and/or binary forms, with or without + * modification, must retain the above copyright notice and the following + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +package io.spine.server.route + +import io.spine.base.EntityState +import io.spine.core.EventContext +import io.spine.server.entity.Entity + +public interface StateRoutingSetup : + RoutingSetup, EventContext, Set, StateUpdateRouting> { + + public companion object { + + public fun apply(cls: Class>, routing: StateUpdateRouting) { + val found = RoutingSetupRegistry.find(cls, StateRoutingSetup::class.java) + found?.let { + @Suppress("UNCHECKED_CAST") + (it as StateRoutingSetup).setup(routing) + } + } + } +} diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteSignature.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteSignature.kt index 55dabfca0..0096930db 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteSignature.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt index 0dac63c15..d6541fb14 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommandRouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor internal class CommandRouteVisitor( functions: List, diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt similarity index 95% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt index 92dc150c7..75a5b7f08 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.processing.KSPLogger import com.google.devtools.ksp.symbol.FunctionKind @@ -33,8 +33,8 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.Origin import funRef import io.spine.server.entity.Entity -import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef -import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.jvmStaticRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.routeRef import msg /** diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EntityClass.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EntityClass.kt index 04309555c..7c41e6ea9 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EntityClass.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EntityClass.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.ClassKind.CLASS import com.google.devtools.ksp.symbol.KSClassDeclaration diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt index 48adb5210..4da847982 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.KSPLogger diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteSignature.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteSignature.kt index 42312ce22..55a4eaa38 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteSignature.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt index ad9bb80fb..1958d394f 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/EventRouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.squareup.kotlinpoet.ksp.toClassName diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Exts.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Exts.kt index dc1760769..c28bff4ab 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Exts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Exts.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.processing.Resolver import com.google.devtools.ksp.symbol.KSType diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSDeclarationExts.kt similarity index 96% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSDeclarationExts.kt index 79a7b4382..30af5da6e 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSDeclarationExts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSDeclarationExts.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSDeclaration diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSTypeExts.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSTypeExts.kt index 1c814877c..df4a81490 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/KSTypeExts.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/KSTypeExts.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.ClassKind.INTERFACE import com.google.devtools.ksp.symbol.KSClassDeclaration diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Qualifier.kt similarity index 96% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Qualifier.kt index 3e71bd21a..e283bedb4 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/Qualifier.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Qualifier.kt @@ -24,10 +24,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration -import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.routeRef /** * The helper class which transforms the incoming sequence with [functions] into diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteFun.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteFun.kt index 724679106..71e0a49bb 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteFun.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteFun.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt index 3e8136cd7..c940fc739 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.processing.CodeGenerator import com.google.devtools.ksp.processing.KSPLogger diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessorProvider.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessorProvider.kt index 9ffb17697..c47fba0dd 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteProcessorProvider.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessorProvider.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.auto.service.AutoService import com.google.devtools.ksp.processing.SymbolProcessor diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteSignature.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteSignature.kt index 4865972ea..6b36f969a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteSignature.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType @@ -33,7 +33,7 @@ import funRef import io.spine.core.SignalContext import io.spine.server.route.Route import io.spine.string.simply -import io.spine.tools.mc.java.routing.RouteSignature.Companion.qualify +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.qualify import io.spine.type.KnownMessage /** diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt similarity index 98% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt index 1e30fb1fa..8ea02ebfa 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.auto.service.AutoService import com.google.devtools.ksp.processing.Dependencies @@ -51,7 +51,7 @@ import com.squareup.kotlinpoet.ksp.writeTo import io.spine.server.entity.Entity import io.spine.string.Indent import io.spine.tools.mc.java.GeneratedAnnotation -import io.spine.tools.mc.java.routing.Environment.SetupType +import io.spine.tools.mc.java.routing.proessor.Environment.SetupType internal sealed class RouteVisitor( protected val setupType: SetupType, diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteSignature.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteSignature.kt index f945c2b84..f333d2aa0 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteSignature.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteSignature.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.KSType diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteVisitor.kt similarity index 97% rename from mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt rename to mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteVisitor.kt index b3b33b139..78100869a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/StateUpdateRouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/StateUpdateRouteVisitor.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.tools.mc.java.routing +package io.spine.tools.mc.java.routing.proessor internal class StateUpdateRouteVisitor( functions: List, diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt index 9ebd346ab..7ccdb67b0 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/JavaRouteErrorSpec.kt @@ -41,7 +41,7 @@ import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection import io.spine.string.simply -import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt index 645e55a90..627408812 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt @@ -35,8 +35,8 @@ import com.tschuchort.compiletesting.KotlinCompilation.ExitCode import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain -import io.spine.tools.mc.java.routing.RouteSignature.Companion.jvmStaticRef -import io.spine.tools.mc.java.routing.RouteSignature.Companion.routeRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.jvmStaticRef +import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt index 4f458dfb6..70244b8e4 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/RouteCompilationTest.kt @@ -35,6 +35,7 @@ import io.spine.core.EventContext import io.spine.given.devices.Device import io.spine.logging.testing.ConsoleTap import io.spine.server.route.Route +import io.spine.tools.mc.java.routing.proessor.RouteProcessorProvider import io.spine.validate.ValidatingBuilder import kotlin.collections.plus import org.junit.jupiter.api.BeforeAll From 984dc8149baeaf485da7a437281660ecfec3a7b7 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sun, 2 Feb 2025 18:54:04 +0000 Subject: [PATCH 69/96] Improve property names --- .../mc/java/routing/proessor/Environment.kt | 4 ++-- .../mc/java/routing/proessor/RouteVisitor.kt | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt index 4da847982..8c9d7cf46 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt @@ -62,10 +62,10 @@ internal class Environment( val stateRoutingSetup = SetupType(StateRoutingSetup::class, StateUpdateRouting::class) inner class SetupType( - val setupClass: KClass, + val cls: KClass, val routingClass: KClass> ) { - val type: KSType by lazy { setupClass.toType(resolver) } + val type: KSType by lazy { cls.toType(resolver) } } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt index 8ea02ebfa..045f4fb67 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt @@ -54,16 +54,16 @@ import io.spine.tools.mc.java.GeneratedAnnotation import io.spine.tools.mc.java.routing.proessor.Environment.SetupType internal sealed class RouteVisitor( - protected val setupType: SetupType, + protected val setup: SetupType, private val functions: List, protected val environment: Environment, ) : KSVisitorVoid() { + protected abstract val classNameSuffix: String + private lateinit var packageName: String private lateinit var originalFile: KSFile - protected abstract val classNameSuffix: String - protected lateinit var routingClass: TypeSpec.Builder protected lateinit var setupFun: FunSpec.Builder protected lateinit var routingRunBlock: CodeBlock.Builder @@ -89,7 +89,7 @@ internal sealed class RouteVisitor( protected open fun createClass(className: String) { val generated = GeneratedAnnotation.forKotlinPoet() val autoService = AnnotationSpec.builder(AutoService::class) - .addMember("%T::class", setupType.setupClass) + .addMember("%T::class", setup.cls) .build() routingClass = TypeSpec.classBuilder(className) @@ -99,7 +99,7 @@ internal sealed class RouteVisitor( .addAnnotation(generated) .addAnnotation(autoService) - val superInterface = setupType.type + val superInterface = setup.type .replace(listOf(idClassTypeArgument)) .toTypeName() routingClass.addSuperinterface(superInterface) @@ -108,9 +108,9 @@ internal sealed class RouteVisitor( private fun classKDoc(): CodeBlock = CodeBlock.builder() .add("Configures [%T] of the repository managing [%T] instances.\n\n", - setupType.routingClass.asClassName(), + setup.routingClass.asClassName(), entityClass.type.toClassName()) - .add("@see %T.apply()\n", setupType.setupClass.asClassName()) + .add("@see %T.apply()\n", setup.cls.asClassName()) .build() /** @@ -142,7 +142,7 @@ internal sealed class RouteVisitor( private fun openSetupFunction() { val paramName = "routing" - val paramType = setupType.routingClass.asClassName() + val paramType = setup.routingClass.asClassName() .parameterizedBy(idClassTypeArgument.type!!.toTypeName()) val param = ParameterSpec.builder(paramName, paramType) setupFun = FunSpec.builder("setup") From 4cb94acc708de547f4727c7577b8e9162f6d4915 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 3 Feb 2025 15:32:42 +0000 Subject: [PATCH 70/96] Add documentation --- .../server/route/RoutingSetupRegistry.kt | 30 ++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt index 0e3a3a85d..6c7c296e3 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt @@ -29,8 +29,21 @@ package io.spine.server.route import io.spine.server.entity.Entity import java.util.* +/** + * The alias to avoid generic parameters in signatures in this file. + */ private typealias RSetup = RoutingSetup<*, *, *, *, *> +/** + * Contains mappings from an entity class to [routing setup][RoutingSetup] instances + * discovered for the class. + * + * The setup instances are created using the [ServiceLoader] which scans + * the implementations of the following interfaces: + * * [CommandRoutingSetup] + * * [EventRoutingSetup] + * * [StateRoutingSetup]. + */ internal object RoutingSetupRegistry { private val entries: Set @@ -49,6 +62,9 @@ internal object RoutingSetupRegistry { entries = grouped.map { (cls, setups) -> Entry(cls, setups) }.toSet() } + /** + * Obtains a routing setup for the given entity class, if any. + */ fun find( entityClass: Class>, setupInterface: Class @@ -62,6 +78,9 @@ internal object RoutingSetupRegistry { private val setups: List ) { init { + require(setups.isNotEmpty()) { + "No setups passed for the entity class `${entityClass.canonicalName}`." + } // Check the consistency of grouping. setups.forEach { setup -> require(setup.entityClass() == entityClass) { @@ -74,10 +93,13 @@ internal object RoutingSetupRegistry { } } - fun find( - setupClass: Class - ): RSetup? { - val found = setups.find { setupClass.isAssignableFrom(it.javaClass) } + /** + * Finds a setup with the given superclass among those found for the [entityClass]. + */ + fun find(setupClass: Class): RSetup? { + val found = setups.find { + setupClass.isAssignableFrom(it.javaClass) + } return found } } From f952250399737becc36a2e49785f86329d6157cb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 6 Feb 2025 18:53:57 +0000 Subject: [PATCH 71/96] Bump `dokka-extensions` -> `2.0.0-SNAPSHOT.6` --- buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt index 45e73dd40..41757db3f 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Dokka.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,7 +78,7 @@ object Dokka { object SpineExtensions { private const val group = "io.spine.tools" - const val version = "2.0.0-SNAPSHOT.4" + const val version = "2.0.0-SNAPSHOT.6" const val lib = "$group:spine-dokka-extensions:$version" } } From 6ac08cada810c7c3ce5d0c83385d7c0995791c93 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 6 Feb 2025 18:55:07 +0000 Subject: [PATCH 72/96] Bump Base -> `2.0.0-SNAPSHOT.240` --- buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt index 51ec08033..fc767ee2b 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,8 +33,8 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object Base { - const val version = "2.0.0-SNAPSHOT.236" - const val versionForBuildScript = "2.0.0-SNAPSHOT.232" + const val version = "2.0.0-SNAPSHOT.240" + const val versionForBuildScript = "2.0.0-SNAPSHOT.240" const val group = Spine.group const val artifact = "spine-base" const val lib = "$group:$artifact:$version" From 7541361c4d1e90bd90bba60cea3c45380b58a5d4 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 6 Feb 2025 20:18:03 +0000 Subject: [PATCH 73/96] Bump CoreJava -> `2.0.0-SNAPSHOT.200` --- buildSrc/src/main/kotlin/module.gradle.kts | 30 +++++++++++-------- .../spine/given/home/HomeAutomationContext.kt | 4 +-- .../route/{ => setup}/CommandRoutingSetup.kt | 3 +- .../route/{ => setup}/EventRoutingSetup.kt | 3 +- .../server/route/{ => setup}/RoutingSetup.kt | 13 ++++---- .../route/{ => setup}/RoutingSetupRegistry.kt | 2 +- .../route/{ => setup}/StateRoutingSetup.kt | 5 ++-- .../routing/proessor/CommandRouteVisitor.kt | 13 +++++++- .../mc/java/routing/proessor/Environment.kt | 8 ++--- .../routing/proessor/EventRouteVisitor.kt | 2 +- .../java/routing/proessor/RouteProcessor.kt | 10 +++++-- .../mc/java/routing/proessor/RouteVisitor.kt | 7 +++++ 12 files changed, 65 insertions(+), 35 deletions(-) rename mc-java-routing/src/main/kotlin/io/spine/server/route/{ => setup}/CommandRoutingSetup.kt (95%) rename mc-java-routing/src/main/kotlin/io/spine/server/route/{ => setup}/EventRoutingSetup.kt (95%) rename mc-java-routing/src/main/kotlin/io/spine/server/route/{ => setup}/RoutingSetup.kt (85%) rename mc-java-routing/src/main/kotlin/io/spine/server/route/{ => setup}/RoutingSetupRegistry.kt (99%) rename mc-java-routing/src/main/kotlin/io/spine/server/route/{ => setup}/StateRoutingSetup.kt (94%) diff --git a/buildSrc/src/main/kotlin/module.gradle.kts b/buildSrc/src/main/kotlin/module.gradle.kts index 34a3a7d48..e0ac181ec 100644 --- a/buildSrc/src/main/kotlin/module.gradle.kts +++ b/buildSrc/src/main/kotlin/module.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,9 +38,14 @@ import io.spine.dependency.lib.KotlinX import io.spine.dependency.lib.Protobuf import io.spine.dependency.local.ArtifactVersion import io.spine.dependency.local.Base +import io.spine.dependency.local.CoreJava import io.spine.dependency.local.Logging import io.spine.dependency.local.ProtoData +import io.spine.dependency.local.Reflect import io.spine.dependency.local.Spine +import io.spine.dependency.local.TestLib +import io.spine.dependency.local.Time +import io.spine.dependency.local.ToolBase import io.spine.dependency.local.Validation import io.spine.dependency.test.JUnit import io.spine.dependency.test.Truth @@ -131,9 +136,8 @@ fun Module.forceConfigurations() { // Exclude in favor of `spine-validation-java-runtime`. exclude("io.spine", "spine-validate") resolutionStrategy { - @Suppress("DEPRECATION") // `Kotlin.stdLibJdk7` needs to be forced. force( - Kotlin.stdLibJdk7, + Kotlin.stdLib, KotlinX.Coroutines.core, KotlinX.Coroutines.jdk8, KotlinPoet.ksp, @@ -146,16 +150,16 @@ fun Module.forceConfigurations() { Jackson.Junior.objects, Caffeine.lib, - Spine.reflect, - Spine.base, - Spine.time, - Spine.client, - Spine.server, - Spine.testlib, - Spine.toolBase, - Spine.pluginBase, - Spine.psiJava, - Spine.psiJavaBundle, + Reflect.lib, + Base.lib, + Time.lib, + CoreJava.core, + CoreJava.client, + CoreJava.server, + TestLib.lib, + ToolBase.lib, + ToolBase.pluginBase, + ToolBase.psiJava, Logging.lib, Logging.libJvm, Logging.middleware, diff --git a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt index 935796e95..9f79dffdb 100644 --- a/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt +++ b/mc-java-routing-tests/src/testFixtures/kotlin/io/spine/given/home/HomeAutomationContext.kt @@ -37,9 +37,9 @@ import io.spine.server.entity.alter import io.spine.server.projection.Projection import io.spine.server.projection.ProjectionRepository import io.spine.server.route.EventRouting -import io.spine.server.route.EventRoutingSetup +import io.spine.server.route.setup.EventRoutingSetup import io.spine.server.route.Route -import io.spine.server.route.StateRoutingSetup +import io.spine.server.route.setup.StateRoutingSetup import io.spine.server.route.StateUpdateRouting fun homeAutomation(): BoundedContext = BoundedContext.singleTenant("HomeAutomation") diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt similarity index 95% rename from mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt rename to mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt index c8c2f64e9..4bd16da32 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/CommandRoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt @@ -24,11 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.server.route +package io.spine.server.route.setup import io.spine.base.CommandMessage import io.spine.core.CommandContext import io.spine.server.entity.Entity +import io.spine.server.route.CommandRouting public interface CommandRoutingSetup : RoutingSetup> { diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt similarity index 95% rename from mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt rename to mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt index f18d82471..1268402fd 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/EventRoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt @@ -24,11 +24,12 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.server.route +package io.spine.server.route.setup import io.spine.base.EventMessage import io.spine.core.EventContext import io.spine.server.entity.Entity +import io.spine.server.route.EventRouting public interface EventRoutingSetup : RoutingSetup, EventRouting> { diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt similarity index 85% rename from mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt rename to mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt index 295b8fb62..035a00a4a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt @@ -24,18 +24,19 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.server.route +package io.spine.server.route.setup -import io.spine.base.MessageContext +import io.spine.base.Routable +import io.spine.core.SignalContext import io.spine.server.entity.Entity -import io.spine.type.KnownMessage +import io.spine.server.route.MessageRouting public interface RoutingSetup< I : Any, - M : KnownMessage, - C : MessageContext, + M : Routable, + C : SignalContext, R : Any, - U : MessageRouting> { + U : MessageRouting> { public fun entityClass(): Class> public fun setup(routing: U) diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt similarity index 99% rename from mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt rename to mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt index 6c7c296e3..5501dfbb4 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/RoutingSetupRegistry.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt @@ -24,7 +24,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.server.route +package io.spine.server.route.setup import io.spine.server.entity.Entity import java.util.* diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt similarity index 94% rename from mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt rename to mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt index 80044d38e..fb0f47194 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/StateRoutingSetup.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt @@ -24,16 +24,17 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -package io.spine.server.route +package io.spine.server.route.setup import io.spine.base.EntityState import io.spine.core.EventContext import io.spine.server.entity.Entity +import io.spine.server.route.StateUpdateRouting public interface StateRoutingSetup : RoutingSetup, EventContext, Set, StateUpdateRouting> { - public companion object { + public companion object { public fun apply(cls: Class>, routing: StateUpdateRouting) { val found = RoutingSetupRegistry.find(cls, StateRoutingSetup::class.java) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt index d6541fb14..03c5f2020 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommandRouteVisitor.kt @@ -26,6 +26,8 @@ package io.spine.tools.mc.java.routing.proessor +import com.squareup.kotlinpoet.ksp.toClassName + internal class CommandRouteVisitor( functions: List, environment: Environment @@ -37,7 +39,16 @@ internal class CommandRouteVisitor( override val classNameSuffix: String = "CommandRouting" override fun addRoute(fn: CommandRouteFun) { - //TODO:2025-01-22:alexander.yevsyukov: Implement. + val params = if (fn.acceptsContext) "c, ctx" else "c" + routingRunBlock.add( + "%L<%T> { %L -> %T.%L(%L) }\n", + ROUTE_FUN_NAME, + fn.messageClass, + params, + entityClass.type.toClassName(), + fn.decl.simpleName.asString(), + params + ) } companion object { diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt index 8c9d7cf46..5fbbc4043 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/Environment.kt @@ -35,11 +35,11 @@ import io.spine.server.entity.Entity import io.spine.server.procman.ProcessManager import io.spine.server.projection.Projection import io.spine.server.route.CommandRouting -import io.spine.server.route.CommandRoutingSetup +import io.spine.server.route.setup.CommandRoutingSetup import io.spine.server.route.EventRouting -import io.spine.server.route.EventRoutingSetup +import io.spine.server.route.setup.EventRoutingSetup import io.spine.server.route.MessageRouting -import io.spine.server.route.StateRoutingSetup +import io.spine.server.route.setup.StateRoutingSetup import io.spine.server.route.StateUpdateRouting import kotlin.reflect.KClass @@ -63,7 +63,7 @@ internal class Environment( inner class SetupType( val cls: KClass, - val routingClass: KClass> + val routingClass: KClass> ) { val type: KSType by lazy { cls.toType(resolver) } } diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt index 1958d394f..1e06b13dc 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/EventRouteVisitor.kt @@ -53,7 +53,7 @@ internal class EventRouteVisitor( */ override fun addRoute(fn: EventRouteFun) { val params = if (fn.acceptsContext) "e, c" else "e" - val entryFn = if (fn.isUnicast) "unicast" else "route" + val entryFn = if (fn.isUnicast) "unicast" else ROUTE_FUN_NAME routingRunBlock.add( "%L<%T> { %L -> %T.%L(%L) }\n", diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt index c940fc739..aa12781f6 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteProcessor.kt @@ -35,19 +35,23 @@ import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.validate import io.spine.server.route.Route +/** + * Gathers all functions annotated with [Route] and initiates their processing + * by [RouteVisitor]s. + * + * @see RouteVisitor.process + */ internal class RouteProcessor( private val codeGenerator: CodeGenerator, private val logger: KSPLogger ) : SymbolProcessor { - private lateinit var environment: Environment - override fun process(resolver: Resolver): List { - this.environment = Environment(resolver, logger, codeGenerator) val allAnnotated = resolver.getSymbolsWithAnnotation(Route::class.qualifiedName!!) val allValid = allAnnotated.filter { it.validate() } .map { it as KSFunctionDeclaration } + val environment = Environment(resolver, logger, codeGenerator) RouteVisitor.process(allValid, environment) val unprocessed = allAnnotated.filterNot { it.validate() }.toList() diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt index 045f4fb67..da4e5a3af 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/RouteVisitor.kt @@ -173,6 +173,13 @@ internal sealed class RouteVisitor( companion object { + /** + * The name of the inline extension functions for classes extending + * [MessageRouting][io.spine.server.route.MessageRouting] which are used in + * the generated code of [RoutingSetup][io.spine.server.route.RoutingSetup] classes. + */ + internal const val ROUTE_FUN_NAME: String = "route" + internal fun process( allValid: Sequence, environment: Environment From b2b542009a2d5c740f4d187d100c0e56324b42db Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 6 Feb 2025 20:18:12 +0000 Subject: [PATCH 74/96] Bump CoreJava -> `2.0.0-SNAPSHOT.200` --- buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt index 60899e2dd..86a7d38c1 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object CoreJava { const val group = Spine.group - const val version = "2.0.0-SNAPSHOT.193" + const val version = "2.0.0-SNAPSHOT.200" const val coreArtifact = "spine-core" const val clientArtifact = "spine-client" From 9b02eb94622e7540a8c1363a6962c2caf41c88be Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 13 Feb 2025 18:56:31 +0000 Subject: [PATCH 75/96] Update `config` --- .../main/kotlin/io/spine/dependency/build/Ksp.kt | 2 +- .../kotlin/io/spine/dependency/lib/KotlinX.kt | 4 +++- .../io/spine/dependency/local/BaseTypes.kt | 4 ++-- .../kotlin/io/spine/dependency/local/CoreJava.kt | 2 +- .../kotlin/io/spine/dependency/local/Logging.kt | 2 +- .../io/spine/dependency/local/ProtoData.kt | 4 ++-- .../kotlin/io/spine/dependency/local/Spine.kt | 16 +++++++++++----- .../kotlin/io/spine/dependency/local/TestLib.kt | 2 +- .../kotlin/io/spine/dependency/local/ToolBase.kt | 2 +- .../io/spine/dependency/local/Validation.kt | 2 +- .../kotlin/io/spine/dependency/test/JUnit.kt | 6 +++--- config | 2 +- 12 files changed, 28 insertions(+), 20 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt index 3743e076b..27c8633c5 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/build/Ksp.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt index ff02a1e3d..8be6e0482 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -35,7 +35,9 @@ object KotlinX { // https://github.com/Kotlin/kotlinx.coroutines const val version = "1.9.0" + const val bom = "$group:kotlinx-coroutines-bom:$version" const val core = "$group:kotlinx-coroutines-core:$version" + const val coreJvm = "$group:kotlinx-coroutines-core-jvm:$version" const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version" const val test = "$group:kotlinx-coroutines-test:$version" } diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt index 2a639e369..988cab3a6 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -33,7 +33,7 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object BaseTypes { - const val version = "2.0.0-SNAPSHOT.130" + const val version = "2.0.0-SNAPSHOT.126" const val group = Spine.group const val artifact = "spine-base-types" const val lib = "$group:$artifact:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt index 86a7d38c1..01dad3221 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object CoreJava { const val group = Spine.group - const val version = "2.0.0-SNAPSHOT.200" + const val version = "2.0.0-SNAPSHOT.201" const val coreArtifact = "spine-core" const val clientArtifact = "spine-client" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt index fbf76f16b..b1a00ab0c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index 0a71267e3..1ffc31b3c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.91.1" + private const val fallbackVersion = "0.91.6" /** * The distinct version of ProtoData used by other build tools. @@ -82,7 +82,7 @@ object ProtoData { * transitional dependencies, this is the version used to build the project itself. */ val dogfoodingVersion: String - private const val fallbackDfVersion = "0.91.1" + private const val fallbackDfVersion = "0.91.4" /** * The artifact for the ProtoData Gradle plugin. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt index bdf6d1558..d7b6d0cde 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Spine.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -53,7 +53,7 @@ object Spine { @Deprecated(message = "Please use `Time.lib`.", ReplaceWith("Time.lib")) const val time = Time.lib - @Deprecated(message = "Please use `Time.lib`.", ReplaceWith("Time.lib")) + @Deprecated(message = "Please use `Change.lib`.", ReplaceWith("Change.lib")) const val change = Change.lib @Deprecated(message = "Please use `Text.lib`.", ReplaceWith("Text.lib")) @@ -68,13 +68,19 @@ object Spine { @Deprecated(message = "Please use `ToolBase.psiJava` instead`.") const val psiJava = "$toolsGroup:spine-psi-java:${ToolBase.version}" - @Deprecated(message = "Please use `ToolBase.psiJava` instead`.") + @Deprecated( + message = "Please use `ToolBase.psiJava` instead`.", + ReplaceWith("ToolBase.psiJava") + ) const val psiJavaBundle = "$toolsGroup:spine-psi-java-bundle:${ToolBase.version}" - @Deprecated(message = "Please use `ToolBase.lib` instead`.") + @Deprecated(message = "Please use `ToolBase.lib` instead`.", ReplaceWith("ToolBase.lib")) const val toolBase = "$toolsGroup:spine-tool-base:${ToolBase.version}" - @Deprecated(message = "Please use `ToolBase.pluginBase` instead`.") + @Deprecated( + message = "Please use `ToolBase.pluginBase` instead`.", + ReplaceWith("ToolBase.pluginBase") + ) const val pluginBase = "$toolsGroup:spine-plugin-base:${ToolBase.version}" @Deprecated( diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt index 069204392..e7e653436 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/TestLib.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt index 2265c073e..c91aabea7 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object ToolBase { const val group = Spine.toolsGroup - const val version = "2.0.0-SNAPSHOT.240" + const val version = "2.0.0-SNAPSHOT.244" const val lib = "$group:spine-tool-base:$version" const val pluginBase = "$group:spine-plugin-base:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt index 4eced5732..e702e4b64 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt @@ -36,7 +36,7 @@ object Validation { /** * The version of the Validation library artifacts. */ - const val version = "2.0.0-SNAPSHOT.187" + const val version = "2.0.0-SNAPSHOT.192" const val group = "io.spine.validation" private const val prefix = "spine-validation" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt index c651ce8d3..c410b4219 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/JUnit.kt @@ -29,14 +29,14 @@ package io.spine.dependency.test // https://junit.org/junit5/ @Suppress("unused", "ConstPropertyName") object JUnit { - const val version = "5.11.4" + const val version = "5.10.0" private const val legacyVersion = "4.13.1" // https://github.com/apiguardian-team/apiguardian private const val apiGuardianVersion = "1.1.2" // https://github.com/junit-pioneer/junit-pioneer - private const val pioneerVersion = "2.3.0" + private const val pioneerVersion = "2.0.1" const val legacy = "junit:junit:$legacyVersion" @@ -54,7 +54,7 @@ object JUnit { object Platform { // https://junit.org/junit5/ - const val version = "1.11.4" + const val version = "1.10.0" internal const val group = "org.junit.platform" const val commons = "$group:junit-platform-commons:$version" const val launcher = "$group:junit-platform-launcher:$version" diff --git a/config b/config index f6954386c..701de7c86 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit f6954386c224e9444129108f9bcf796812dd9b0c +Subproject commit 701de7c86ff1e84b05600015bc62243940c1bf58 From 44c0ee5bba2f6cced58cc58ee98581846f7b47ed Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Thu, 13 Feb 2025 18:57:32 +0000 Subject: [PATCH 76/96] Avoid no longer necessary `!!` --- build.gradle.kts | 6 +++++- .../tools/mc/java/annotation/ClassPatternAnnotator.kt | 4 ++-- .../io/spine/tools/mc/java/annotation/EnumAnnotator.kt | 6 +++--- .../io/spine/tools/mc/java/annotation/FieldAnnotator.kt | 6 +++--- .../io/spine/tools/mc/java/annotation/MessageAnnotator.kt | 8 ++++---- .../tools/mc/java/annotation/MessageOrEnumAnnotator.kt | 4 ++-- .../spine/tools/mc/java/annotation/OuterClassAnnotator.kt | 4 ++-- .../tools/mc/java/annotation/ServiceAnnotationRenderer.kt | 6 +++--- .../io/spine/tools/mc/java/entity/EntityStateRenderer.kt | 4 ++-- .../io/spine/tools/mc/java/marker/MarkerRenderer.kt | 4 ++-- .../kotlin/io/spine/tools/mc/java/signal/Renderers.kt | 4 ++-- .../tools/mc/java/signal/rejection/RThrowableRenderer.kt | 4 ++-- 12 files changed, 32 insertions(+), 28 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 0c153fc95..24376e901 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -60,6 +60,10 @@ buildscript { resolutionStrategy { force( io.spine.dependency.lib.Grpc.api, + io.spine.dependency.lib.KotlinX.Coroutines.core, + io.spine.dependency.lib.KotlinX.Coroutines.core, + io.spine.dependency.lib.KotlinX.Coroutines.jdk8, + io.spine.dependency.local.Base.libForBuildScript, io.spine.dependency.local.Reflect.lib, toolBase.lib, diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ClassPatternAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ClassPatternAnnotator.kt index 7a0af20d8..1406c8eab 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ClassPatternAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ClassPatternAnnotator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -56,7 +56,7 @@ internal class ClassPatternAnnotator : PatternAnnotator() { private fun annotate(sources: SourceFileSet, file: SourceFile) { TopClassAnnotation(annotationClass, file = file).let { - it.registerWith(context!!) + it.registerWith(context) it.renderSources(sources) } } diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/EnumAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/EnumAnnotator.kt index 968db26d9..f1d970171 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/EnumAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/EnumAnnotator.kt @@ -1,11 +1,11 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -43,7 +43,7 @@ internal class EnumAnnotator : override fun annotateType(view: EnumAnnotations, annotationClass: Class) { val enumType = convention.declarationFor(view.type).name ApiAnnotation(enumType, annotationClass).let { - it.registerWith(context!!) + it.registerWith(context) it.renderSources(sources) } } diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt index 1f8be1cb2..93a3e2da7 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/FieldAnnotator.kt @@ -43,11 +43,11 @@ internal class FieldAnnotator : ProtoAnnotator(MessageFieldAnnotations::class.java) { private val convention by lazy { - MessageOrEnumConvention(typeSystem!!) + MessageOrEnumConvention(typeSystem) } private val messageOrBuilderConvention by lazy { - MessageOrBuilderConvention(typeSystem!!) + MessageOrBuilderConvention(typeSystem) } override fun annotate(view: MessageFieldAnnotations) { @@ -60,7 +60,7 @@ internal class FieldAnnotator : view: MessageFieldAnnotations, fieldOption: FieldOptions ) { - val messageType = typeSystem!!.findMessage(view.type)!!.first + val messageType = typeSystem.findMessage(view.type)!!.first fieldOption.optionList.forEach { option -> val apiOption = ApiOption.findMatching(option) check(apiOption != null) { diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageAnnotator.kt index fcf4f10cf..dc57d7d27 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageAnnotator.kt @@ -1,11 +1,11 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -39,7 +39,7 @@ internal class MessageAnnotator : MessageOrEnumAnnotator(MessageAnnotations::class.java) { private val messageOrBuilderConvention by lazy { - MessageOrBuilderConvention(typeSystem!!) + MessageOrBuilderConvention(typeSystem) } override fun annotateType(view: MessageAnnotations, annotationClass: Class) { @@ -54,7 +54,7 @@ internal class MessageAnnotator : private fun Class.annotate(cls: ClassName) { ApiAnnotation(cls, this).let { - it.registerWith(context!!) + it.registerWith(context) it.doRender(sources) } } diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageOrEnumAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageOrEnumAnnotator.kt index be6c13e7e..262bc405a 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageOrEnumAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/MessageOrEnumAnnotator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -44,7 +44,7 @@ internal sealed class MessageOrEnumAnnotator(viewClass: Class) : TypeAnnotator(viewClass) where T : EntityState<*>, T : WithOptions { protected val convention by lazy { - MessageOrEnumConvention(typeSystem!!) + MessageOrEnumConvention(typeSystem) } override fun needsAnnotation(apiOption: ApiOption, header: ProtoFileHeader): Boolean { diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/OuterClassAnnotator.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/OuterClassAnnotator.kt index 5fabd3327..7bdaf5667 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/OuterClassAnnotator.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/OuterClassAnnotator.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -45,7 +45,7 @@ internal class OuterClassAnnotator : val packageName = view.header.javaPackage() val className = ClassName(packageName, outerClassName) ApiAnnotation(className, annotationClass).let { - it.registerWith(context!!) + it.registerWith(context) it.renderSources(sources) } } diff --git a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ServiceAnnotationRenderer.kt b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ServiceAnnotationRenderer.kt index 441a5e768..1dd6a488e 100644 --- a/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ServiceAnnotationRenderer.kt +++ b/mc-java-annotation/src/main/kotlin/io/spine/tools/mc/java/annotation/ServiceAnnotationRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -42,13 +42,13 @@ internal class ServiceAnnotationRenderer : TypeAnnotator(ServiceAnnotations::class.java) { private val convention by lazy { - GrpcServiceConvention(typeSystem!!) + GrpcServiceConvention(typeSystem) } override fun annotateType(view: ServiceAnnotations, annotationClass: Class) { val serviceClass = convention.declarationFor(view.service).name val annotation = ApiAnnotation(serviceClass, annotationClass) - annotation.registerWith(context!!) + annotation.registerWith(context) annotation.renderSources(sources) } diff --git a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/EntityStateRenderer.kt b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/EntityStateRenderer.kt index 84d391e2e..aa3aa6456 100644 --- a/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/EntityStateRenderer.kt +++ b/mc-java-entity/src/main/kotlin/io/spine/tools/mc/java/entity/EntityStateRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -51,7 +51,7 @@ public class EntityStateRenderer : override fun doRender(type: MessageType, file: SourceFile) { execute { - RenderActions(type, file, settings.actions, context!!).apply() + RenderActions(type, file, settings.actions, context).apply() } } } diff --git a/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/MarkerRenderer.kt b/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/MarkerRenderer.kt index 93368d01b..68487049a 100644 --- a/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/MarkerRenderer.kt +++ b/mc-java-marker/src/main/kotlin/io/spine/tools/mc/java/marker/MarkerRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -43,7 +43,7 @@ internal abstract class MarkerRenderer> : BaseRenderer() { */ protected fun MessageType.implementInterface(superInterface: SuperInterface) { val file = sources.javaFileOf(this) - val action = ImplementInterface(this, file, superInterface, context!!) + val action = ImplementInterface(this, file, superInterface, context) action.render() } } diff --git a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/Renderers.kt b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/Renderers.kt index d9019a49c..7b3637ae5 100644 --- a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/Renderers.kt +++ b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/Renderers.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -61,7 +61,7 @@ internal abstract class SignalRenderer : @OverridingMethodsMustInvokeSuper override fun doRender(type: MessageType, file: SourceFile) { execute { - RenderActions(type, file, typeSettings.actions, context!!).apply() + RenderActions(type, file, typeSettings.actions, context).apply() } } } diff --git a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableRenderer.kt b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableRenderer.kt index f4a5cc4b4..b7ed8d22a 100644 --- a/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableRenderer.kt +++ b/mc-java-signal/src/main/kotlin/io/spine/tools/mc/java/signal/rejection/RThrowableRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -105,7 +105,7 @@ internal class RThrowableRenderer: JavaRenderer(), WithLogging { } private fun generateRejection(protoFile: ProtobufSourceFile, rejection: MessageType) { - val rtCode = RThrowableCode(protoFile.javaPackage(), rejection, typeSystem!!) + val rtCode = RThrowableCode(protoFile.javaPackage(), rejection, typeSystem) val file = rejection.throwableJavaFile(protoFile) rtCode.writeToFile(file) From 8ff408c12b2eb845ce716d52333d48bc6418cb52 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 15 Feb 2025 16:03:11 +0000 Subject: [PATCH 77/96] Bump internal dependencies --- buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt | 4 ++-- .../src/main/kotlin/io/spine/dependency/local/ProtoData.kt | 2 +- .../src/main/kotlin/io/spine/dependency/local/ProtoTap.kt | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt index fc767ee2b..25376a38d 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt @@ -33,8 +33,8 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object Base { - const val version = "2.0.0-SNAPSHOT.240" - const val versionForBuildScript = "2.0.0-SNAPSHOT.240" + const val version = "2.0.0-SNAPSHOT.241" + const val versionForBuildScript = "2.0.0-SNAPSHOT.241" const val group = Spine.group const val artifact = "spine-base" const val lib = "$group:$artifact:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index 1ffc31b3c..c9d33ae66 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.91.6" + private const val fallbackVersion = "0.91.7" /** * The distinct version of ProtoData used by other build tools. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt index 0795460f1..8afa57849 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,7 @@ package io.spine.dependency.local ) object ProtoTap { const val group = "io.spine.tools" - const val version = "0.8.7" + const val version = "0.9.0" const val gradlePluginId = "io.spine.prototap" const val api = "$group:prototap-api:$version" const val gradlePlugin = "$group:prototap-gradle-plugin:$version" From 16756f87a6c30010fa19e0fb51e606a09b1282fb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 15 Feb 2025 17:35:15 +0000 Subject: [PATCH 78/96] Support excluding descriptors --- .../io/spine/tools/mc/java/PluginTestSetup.kt | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt b/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt index 1b0ca4eab..87385d96b 100644 --- a/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt +++ b/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt @@ -26,6 +26,7 @@ package io.spine.tools.mc.java +import com.google.protobuf.Descriptors.GenericDescriptor import com.google.protobuf.Message import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe @@ -35,13 +36,13 @@ import io.spine.protodata.params.WorkingDirectory import io.spine.protodata.plugin.Plugin import io.spine.protodata.render.SourceFile import io.spine.protodata.render.SourceFileSet -import io.spine.protodata.util.Format import io.spine.protodata.settings.SettingsDirectory import io.spine.protodata.testing.PipelineSetup import io.spine.protodata.testing.PipelineSetup.Companion.byResources import io.spine.protodata.testing.pipelineParams import io.spine.protodata.testing.withRequestFile import io.spine.protodata.testing.withSettingsDir +import io.spine.protodata.util.Format import io.spine.tools.code.Java import io.spine.tools.code.SourceSetName import io.spine.tools.mc.java.gradle.settings.CodegenSettings @@ -101,7 +102,11 @@ abstract class PluginTestSetup( * [settings] will be written to the [WorkingDirectory.settingsDirectory] before * creation of a [Pipeline][io.spine.protodata.backend.Pipeline]. */ - fun setup(projectDir: Path, settings: S): PipelineSetup { + fun setup( + projectDir: Path, + settings: S, + excludedDescriptors: List = listOf() + ): PipelineSetup { val workingDir = projectDir.resolve("build").resolve(Directories.PROTODATA_WORKING_DIR) val workingDirectory = WorkingDirectory(workingDir) val requestFile = workingDirectory.requestDirectory.file(SourceSetName("testFixtures")) @@ -119,6 +124,9 @@ abstract class PluginTestSetup( JavaCodeStyleFormatterPlugin() ), outputRoot = outputDir, + descriptorFilter = { + excludedDescriptors.find { d -> d.fullName == it.fullName } == null + } ) { writeSettings(it, settings) } @@ -134,11 +142,14 @@ abstract class PluginTestSetup( * * @see createSettings */ - fun runPipeline(projectDir: Path) { + fun runPipeline( + projectDir: Path, + excludedDescriptors: List = listOf() + ) { // Clear the cache of previously parsed files to avoid repeated code generation. SourceFile.clearCache() val settings = createSettings(projectDir) - val setup = setup(projectDir, settings) + val setup = setup(projectDir, settings, excludedDescriptors) val pipeline = setup.createPipeline() pipeline() this.sourceFileSet = pipeline.sources[0] From bb77ef0aa417e319cf13658edd51d9e7483bfe5b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 15 Feb 2025 17:43:42 +0000 Subject: [PATCH 79/96] Exclude files and types that fail the compilation --- .../mc/java/comparable/AddComparatorSpec.kt | 14 +++- .../java/comparable/action/AddComparator.kt | 70 +++++++++++++++---- 2 files changed, 70 insertions(+), 14 deletions(-) diff --git a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt index 65b5d4ace..49e6052f2 100644 --- a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt +++ b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt @@ -41,7 +41,10 @@ import io.spine.tools.mc.java.comparable.given.Account import io.spine.tools.mc.java.comparable.given.BytesProhibited import io.spine.tools.mc.java.comparable.given.Citizen import io.spine.tools.mc.java.comparable.given.Debtor +import io.spine.tools.mc.java.comparable.given.InvalidNested +import io.spine.tools.mc.java.comparable.given.Invalid import io.spine.tools.mc.java.comparable.given.MapsProhibited +import io.spine.tools.mc.java.comparable.given.Name import io.spine.tools.mc.java.comparable.given.NestedBytesProhibited import io.spine.tools.mc.java.comparable.given.NestedMapsProhibited import io.spine.tools.mc.java.comparable.given.NestedNonComparableProhibited @@ -77,7 +80,16 @@ internal class AddComparatorSpec { @JvmStatic fun setup(@TempDir projectDir: Path) { withLoggingMutedIn(AddComparator::class.java.packageName) { - runPipeline(projectDir) + runPipeline( + projectDir, + // Exclude files and message types that cause errors. + // We'll test negative cases separately. + listOf( + InvalidNested.getDescriptor(), + Invalid.getDescriptor(), + Name.getDescriptor() + ) + ) } } } diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index 9f02d5e0d..cea8daee6 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -27,17 +27,23 @@ package io.spine.tools.mc.java.comparable.action import com.google.protobuf.Empty +import com.google.protobuf.GeneratedMessageV3 import io.spine.base.FieldPath import io.spine.base.copy import io.spine.base.fieldPath import io.spine.compare.ComparatorRegistry import io.spine.option.CompareByOption +import io.spine.protobuf.defaultInstance +import io.spine.protodata.Compilation import io.spine.protodata.ast.Cardinality.CARDINALITY_SINGLE import io.spine.protodata.ast.MessageType +import io.spine.protodata.ast.Option import io.spine.protodata.ast.PrimitiveType.PT_UNKNOWN import io.spine.protodata.ast.PrimitiveType.TYPE_BYTES import io.spine.protodata.ast.cardinality import io.spine.protodata.ast.find +import io.spine.protodata.ast.qualifiedName +import io.spine.protodata.ast.unpack import io.spine.protodata.context.CodegenContext import io.spine.protodata.java.ClassName import io.spine.protodata.java.MethodCall @@ -45,13 +51,16 @@ import io.spine.protodata.java.javaClass import io.spine.protodata.java.render.DirectMessageAction import io.spine.protodata.java.toPsi import io.spine.protodata.render.SourceFile +import io.spine.protodata.type.fileOf +import io.spine.string.simply import io.spine.tools.code.Java import io.spine.tools.mc.java.GeneratedAnnotation import io.spine.tools.mc.java.base.joined import io.spine.tools.mc.java.base.resolve -import io.spine.tools.mc.java.comparable.ComparableMessage import io.spine.tools.mc.java.comparable.WellKnownComparables.isWellKnownComparable import io.spine.tools.psi.addFirst +import io.spine.type.typeName +import java.io.File /** * Builds and inserts a static `comparator` field into the messages that qualify @@ -67,14 +76,24 @@ public class AddComparator( context: CodegenContext ) : DirectMessageAction(type, file, Empty.getDefaultInstance(), context) { + /** The declaration of the [CompareByOption] option in the [type]. */ + private val option: Option by lazy { + type.option() + } + + /** The full path to the proto file declaring the [type]. */ + private val protoSource: File by lazy { + typeSystem.fileOf(type)!! + } + override fun doRender() { - val option = compareByOption(type) - val comparisonFields = option.fieldList.map(::toComparisonField) + val compareBy = option.unpack() + val comparisonFields = compareBy.fieldList.map(::toComparisonField) require(comparisonFields.isNotEmpty()) { "The `(compare_by)` option should have at least one field specified." } - val comparator = ComparatorBuilder(cls, option.descending) + val comparator = ComparatorBuilder(cls, compareBy.descending) comparisonFields.forEach { comparator.comparingBy(it) } val javaField = comparator.build().toPsi() @@ -82,20 +101,21 @@ public class AddComparator( cls.addAfter(javaField, cls.lBrace) } - /** - * Queries the [CompareByOption] option for the given message [type]. - */ - private fun compareByOption(type: MessageType) = select(ComparableMessage::class.java) - .findById(type)!! - .option - /** * Maps the field [path] to an appropriate instance of [ComparisonField], * depending on the field type. */ private fun toComparisonField(path: String): ComparisonField { - val fieldPath = fieldPath { fieldName.addAll(path.split(".")) } - val field = typeSystem.resolve(fieldPath, type) + val fieldPath = path.toFieldPath() + val field = try { + typeSystem.resolve(fieldPath, type) + } catch (e: IllegalStateException) { + Compilation.error( + protoSource, option.span.startLine, option.span.startColumn, + "Unable to find a field with the path `$path` in the type `${type.qualifiedName}`." + ) + } + val fieldType = field.type check(field.type.cardinality == CARDINALITY_SINGLE) { @@ -227,3 +247,27 @@ public class AddComparator( private val MessageType.hasCompareByOption: Boolean get() = optionList.find() != null + +/** + * Transforms this potentially dot-delimited string into [FieldPath]. + * + * If there are no dots in this string the returned [FieldPath] contains + * only this string. + */ +private fun String.toFieldPath() = fieldPath { + fieldName.addAll(this@toFieldPath.split(".")) +} + +/** + * Finds the instance of [Option] which contains the message with the given + * type [T] as its value. + * + * @throws IllegalStateException if the option with the given type is not found. + */ +private inline fun MessageType.option(): Option { + val optionUrl = T::class.java.defaultInstance.typeName.toUrl().value() + optionList.find { opt -> opt.value.typeUrl == optionUrl }?.let { return it } + ?: error( + "The message `${name.qualifiedName}` must have the `${simply()}` option." + ) +} From 461e709fcd5777fc7deb43f8348f693cec1de5e9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Sat, 15 Feb 2025 17:44:03 +0000 Subject: [PATCH 80/96] Auto-update by IDEA --- .idea/inspectionProfiles/Project_Default.xml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml index 312610353..b09173471 100644 --- a/.idea/inspectionProfiles/Project_Default.xml +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -867,7 +867,6 @@ - - \ No newline at end of file + From 9e5e64a87a5c4d7a3436bb32336e21bdb3328521 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 17 Feb 2025 19:15:17 +0000 Subject: [PATCH 81/96] Bump local dependencies --- buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt | 2 +- buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt | 2 +- buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt index 01dad3221..d6c753056 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt @@ -34,7 +34,7 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object CoreJava { const val group = Spine.group - const val version = "2.0.0-SNAPSHOT.201" + const val version = "2.0.0-SNAPSHOT.203" const val coreArtifact = "spine-core" const val clientArtifact = "spine-client" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index c9d33ae66..3029824bd 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.91.7" + private const val fallbackVersion = "0.92.2" /** * The distinct version of ProtoData used by other build tools. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt index 8afa57849..c811e58b9 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoTap.kt @@ -38,7 +38,7 @@ package io.spine.dependency.local ) object ProtoTap { const val group = "io.spine.tools" - const val version = "0.9.0" + const val version = "0.9.1" const val gradlePluginId = "io.spine.prototap" const val api = "$group:prototap-api:$version" const val gradlePlugin = "$group:prototap-gradle-plugin:$version" From 155d6b4134f52a19884d4fab8f3b808b98601977 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 17 Feb 2025 19:15:47 +0000 Subject: [PATCH 82/96] Address API changes in ProtoData --- .../tools/mc/java/comparable/action/AddComparator.kt | 3 ++- .../tools/mc/java/comparable/action/ComparatorBuilder.kt | 8 ++++---- .../spine/tools/mc/java/mgroup/GroupedMessageRenderer.kt | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index cea8daee6..de074677d 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -43,6 +43,7 @@ import io.spine.protodata.ast.PrimitiveType.TYPE_BYTES import io.spine.protodata.ast.cardinality import io.spine.protodata.ast.find import io.spine.protodata.ast.qualifiedName +import io.spine.protodata.ast.toJava import io.spine.protodata.ast.unpack import io.spine.protodata.context.CodegenContext import io.spine.protodata.java.ClassName @@ -83,7 +84,7 @@ public class AddComparator( /** The full path to the proto file declaring the [type]. */ private val protoSource: File by lazy { - typeSystem.fileOf(type)!! + type.file.toJava() } override fun doRender() { diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/ComparatorBuilder.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/ComparatorBuilder.kt index 81b1421f9..a177725e7 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/ComparatorBuilder.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/ComparatorBuilder.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -31,7 +31,7 @@ import com.intellij.psi.PsiClass import io.spine.base.FieldPath import io.spine.protodata.java.ClassName import io.spine.protodata.java.Expression -import io.spine.protodata.java.InitField +import io.spine.protodata.java.FieldDeclaration import io.spine.protodata.java.ParameterizedClassName import io.spine.protodata.java.call import io.spine.string.camelCase @@ -67,7 +67,7 @@ internal class ComparatorBuilder(cls: PsiClass, private val reversed: Boolean = /** * Builds a private static `comparator` Java field. */ - fun build(): InitField> { + fun build(): FieldDeclaration> { val comparator = ClassName(Comparator::class) var comparisons = comparator.call>("comparing", fields.first()) for (i in 1 until fields.size) { @@ -76,7 +76,7 @@ internal class ComparatorBuilder(cls: PsiClass, private val reversed: Boolean = if (reversed) { comparisons = comparisons.chain("reversed") } - return InitField( + return FieldDeclaration( modifiers = "private static final", type = ParameterizedClassName(comparator, message), name = "comparator", diff --git a/mc-java-message-group/src/main/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRenderer.kt b/mc-java-message-group/src/main/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRenderer.kt index 9ba1e1240..858b52640 100644 --- a/mc-java-message-group/src/main/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRenderer.kt +++ b/mc-java-message-group/src/main/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRenderer.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -63,7 +63,7 @@ internal class GroupedMessageRenderer : JavaRenderer(), MessageGroupPluginCompon private fun GroupedMessage.doRender(sourceFile: SourceFile) { groupList.forEach { - RenderActions(type, sourceFile, it.actions, context!!).apply() + RenderActions(type, sourceFile, it.actions, context).apply() } } From 66d36ea4556d966e134eef14dca5413dc92205de Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 17 Feb 2025 19:32:56 +0000 Subject: [PATCH 83/96] Do not require `@JvmStatic` on Kotlin route functions It's not needed because they are called from generated Kotlin code --- .../mc/java/routing/proessor/CommonChecks.kt | 10 ++--- .../mc/java/routing/KotlinRouteErrorSpec.kt | 41 +------------------ 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt index 75a5b7f08..2ff3efa6a 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt @@ -31,6 +31,8 @@ import com.google.devtools.ksp.symbol.FunctionKind import com.google.devtools.ksp.symbol.KSClassDeclaration import com.google.devtools.ksp.symbol.KSFunctionDeclaration import com.google.devtools.ksp.symbol.Origin +import com.google.devtools.ksp.symbol.Origin.JAVA +import com.google.devtools.ksp.symbol.Origin.KOTLIN import funRef import io.spine.server.entity.Entity import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.jvmStaticRef @@ -60,16 +62,14 @@ private fun Boolean.toErrorCount(): Int = if (this) 0 else 1 private fun KSFunctionDeclaration.isStatic(logger: KSPLogger): Int { val isStatic = when (origin) { - Origin.JAVA -> functionKind == FunctionKind.STATIC - Origin.KOTLIN -> parentDeclaration is KSClassDeclaration && + JAVA -> functionKind == FunctionKind.STATIC + KOTLIN -> parentDeclaration is KSClassDeclaration && (parentDeclaration as KSClassDeclaration).isCompanionObject else -> false } if (!isStatic) { logger.error(msg( - "The $funRef annotated with $routeRef must be" + - " a member of a companion object and annotated with $jvmStaticRef.", - + "The $funRef annotated with $routeRef must be a member of a companion object.", "The $funRef annotated with $routeRef must be `static`." ), this diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt index 627408812..3f9d942fb 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt @@ -76,44 +76,6 @@ internal class KotlinRouteErrorSpec : RouteCompilationTest() { } } - /** - * Error: The method must be annotated as `JvmStatic`. - */ - private val notJvmStatic = kotlinFile("NotJvmStatic", """ - package io.spine.given.devices - - import io.spine.given.devices.events.StatusReported - import io.spine.server.projection.Projection - import io.spine.server.route.Route - - class NotJvmStatic : Projection() { - - companion object { - @Route - fun route(e: StatusReported): DeviceId { - return event.getDevice() - } - } - } - """.trimIndent()) - - @Test - fun `when a function is not 'JvmStatic''`() { - compilation.apply { - sources = listOf(notJvmStatic) - } - - val result = compilation.compileSilently() - - result.exitCode shouldBe COMPILATION_ERROR - result.messages.let { - it shouldContain "`route()`" // The name of the function in error. - it shouldContain routeRef - it shouldContain "a member of a companion object and annotated with" - it shouldContain jvmStaticRef - } - } - /** * Error: The method must belong to a companion object. */ @@ -145,8 +107,7 @@ internal class KotlinRouteErrorSpec : RouteCompilationTest() { it shouldContain "`route()`" // The name of the function in error. it shouldContain routeRef // The error is the same as for not annotated as `JvmStatic`. - it shouldContain "a member of a companion object and annotated with" - it shouldContain jvmStaticRef + it shouldContain "a member of a companion object." } } From 3c499106720bb44dd9bc079c21d9c2fb19e50600 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 17 Feb 2025 19:39:30 +0000 Subject: [PATCH 84/96] Do not check for `@JvmStatic` This is not needed because the Kotlin functions will be invoked from generated Kotlin code. --- .../io/spine/tools/mc/java/routing/proessor/CommonChecks.kt | 3 +-- .../io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt | 5 +---- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt index 2ff3efa6a..4630def92 100644 --- a/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt +++ b/mc-java-routing/src/main/kotlin/io/spine/tools/mc/java/routing/proessor/CommonChecks.kt @@ -84,8 +84,7 @@ private fun KSFunctionDeclaration.declaredInAClass(logger: KSPLogger): Int { // This case is Kotlin-only because in Java a function would belong to a class. logger.error( "The $funRef annotated with $routeRef must be" + - " a member of a companion object of an entity class" + - " annotated with $jvmStaticRef.", + " a member of a companion object of an entity class.", this ) } diff --git a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt index 3f9d942fb..470b9b49d 100644 --- a/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt +++ b/mc-java-routing/src/test/kotlin/io/spine/tools/mc/java/routing/KotlinRouteErrorSpec.kt @@ -35,7 +35,6 @@ import com.tschuchort.compiletesting.KotlinCompilation.ExitCode import com.tschuchort.compiletesting.KotlinCompilation.ExitCode.COMPILATION_ERROR import io.kotest.matchers.shouldBe import io.kotest.matchers.string.shouldContain -import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.jvmStaticRef import io.spine.tools.mc.java.routing.proessor.RouteSignature.Companion.routeRef import org.jetbrains.kotlin.compiler.plugin.ExperimentalCompilerApi import org.junit.jupiter.api.DisplayName @@ -71,8 +70,7 @@ internal class KotlinRouteErrorSpec : RouteCompilationTest() { result.messages.let { it shouldContain "`route()`" // The name of the function in error. it shouldContain routeRef - it shouldContain "a member of a companion object of an entity class" - it shouldContain jvmStaticRef + it shouldContain "a member of a companion object of an entity class." } } @@ -106,7 +104,6 @@ internal class KotlinRouteErrorSpec : RouteCompilationTest() { result.messages.let { it shouldContain "`route()`" // The name of the function in error. it shouldContain routeRef - // The error is the same as for not annotated as `JvmStatic`. it shouldContain "a member of a companion object." } } From 889ae64ddc43df6e2612df8112b104865049aced Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 12:58:22 +0000 Subject: [PATCH 85/96] Bump BaseTypes -> `2.0.0-SNAPSHOT.130` --- buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt index 988cab3a6..d48cdf2c2 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/BaseTypes.kt @@ -33,7 +33,7 @@ package io.spine.dependency.local */ @Suppress("ConstPropertyName") object BaseTypes { - const val version = "2.0.0-SNAPSHOT.126" + const val version = "2.0.0-SNAPSHOT.130" const val group = Spine.group const val artifact = "spine-base-types" const val lib = "$group:$artifact:$version" From 695a159730fae40c97d8986ae0b8cd8a3c5c8f1e Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Tue, 18 Feb 2025 15:02:19 +0200 Subject: [PATCH 86/96] Fix docs Co-authored-by: Yevhenii Nadtochii --- .../kotlin/io/spine/dependency/test/KotlinCompileTesting.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt index d743985c6..4da9bcf64 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/test/KotlinCompileTesting.kt @@ -27,7 +27,7 @@ package io.spine.dependency.test /** - * A library for in-process compilation of Kotlin and Java code compilation. + * A library for in-process compilation of Kotlin and Java code. * * @see GitHub repo */ From 61f504cd4910afc7d23e3426815de16c6d54afdf Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 13:06:28 +0000 Subject: [PATCH 87/96] Use extension from ProtoData --- .../java/comparable/action/AddComparator.kt | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index de074677d..cf05dfba4 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -27,13 +27,11 @@ package io.spine.tools.mc.java.comparable.action import com.google.protobuf.Empty -import com.google.protobuf.GeneratedMessageV3 import io.spine.base.FieldPath import io.spine.base.copy import io.spine.base.fieldPath import io.spine.compare.ComparatorRegistry import io.spine.option.CompareByOption -import io.spine.protobuf.defaultInstance import io.spine.protodata.Compilation import io.spine.protodata.ast.Cardinality.CARDINALITY_SINGLE import io.spine.protodata.ast.MessageType @@ -42,7 +40,7 @@ import io.spine.protodata.ast.PrimitiveType.PT_UNKNOWN import io.spine.protodata.ast.PrimitiveType.TYPE_BYTES import io.spine.protodata.ast.cardinality import io.spine.protodata.ast.find -import io.spine.protodata.ast.qualifiedName +import io.spine.protodata.ast.option import io.spine.protodata.ast.toJava import io.spine.protodata.ast.unpack import io.spine.protodata.context.CodegenContext @@ -52,15 +50,12 @@ import io.spine.protodata.java.javaClass import io.spine.protodata.java.render.DirectMessageAction import io.spine.protodata.java.toPsi import io.spine.protodata.render.SourceFile -import io.spine.protodata.type.fileOf -import io.spine.string.simply import io.spine.tools.code.Java import io.spine.tools.mc.java.GeneratedAnnotation import io.spine.tools.mc.java.base.joined import io.spine.tools.mc.java.base.resolve import io.spine.tools.mc.java.comparable.WellKnownComparables.isWellKnownComparable import io.spine.tools.psi.addFirst -import io.spine.type.typeName import java.io.File /** @@ -258,17 +253,3 @@ private val MessageType.hasCompareByOption: Boolean private fun String.toFieldPath() = fieldPath { fieldName.addAll(this@toFieldPath.split(".")) } - -/** - * Finds the instance of [Option] which contains the message with the given - * type [T] as its value. - * - * @throws IllegalStateException if the option with the given type is not found. - */ -private inline fun MessageType.option(): Option { - val optionUrl = T::class.java.defaultInstance.typeName.toUrl().value() - optionList.find { opt -> opt.value.typeUrl == optionUrl }?.let { return it } - ?: error( - "The message `${name.qualifiedName}` must have the `${simply()}` option." - ) -} From 35f7ff605204fa10fa3b5b5422a3f014ec0bafdf Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 15:44:29 +0000 Subject: [PATCH 88/96] Remove duplicating code --- .../server/route/setup/CommandRoutingSetup.kt | 47 -------- .../server/route/setup/EventRoutingSetup.kt | 47 -------- .../spine/server/route/setup/RoutingSetup.kt | 43 ------- .../route/setup/RoutingSetupRegistry.kt | 106 ------------------ .../server/route/setup/StateRoutingSetup.kt | 47 -------- 5 files changed, 290 deletions(-) delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt delete mode 100644 mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt deleted file mode 100644 index 4bd16da32..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/CommandRoutingSetup.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.server.route.setup - -import io.spine.base.CommandMessage -import io.spine.core.CommandContext -import io.spine.server.entity.Entity -import io.spine.server.route.CommandRouting - -public interface CommandRoutingSetup : - RoutingSetup> { - - public companion object { - - public fun apply(cls: Class>, routing: CommandRouting) { - val found = RoutingSetupRegistry.find(cls, CommandRoutingSetup::class.java) - found?.let { - @Suppress("UNCHECKED_CAST") - (it as CommandRoutingSetup).setup(routing) - } - } - } -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt deleted file mode 100644 index 1268402fd..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/EventRoutingSetup.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.server.route.setup - -import io.spine.base.EventMessage -import io.spine.core.EventContext -import io.spine.server.entity.Entity -import io.spine.server.route.EventRouting - -public interface EventRoutingSetup : - RoutingSetup, EventRouting> { - - public companion object { - - public fun apply(cls: Class>, routing: EventRouting) { - val fount = RoutingSetupRegistry.find(cls, EventRoutingSetup::class.java) - fount?.let { - @Suppress("UNCHECKED_CAST") - (it as EventRoutingSetup).setup(routing) - } - } - } -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt deleted file mode 100644 index 035a00a4a..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetup.kt +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.server.route.setup - -import io.spine.base.Routable -import io.spine.core.SignalContext -import io.spine.server.entity.Entity -import io.spine.server.route.MessageRouting - -public interface RoutingSetup< - I : Any, - M : Routable, - C : SignalContext, - R : Any, - U : MessageRouting> { - - public fun entityClass(): Class> - public fun setup(routing: U) -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt deleted file mode 100644 index 5501dfbb4..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/RoutingSetupRegistry.kt +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.server.route.setup - -import io.spine.server.entity.Entity -import java.util.* - -/** - * The alias to avoid generic parameters in signatures in this file. - */ -private typealias RSetup = RoutingSetup<*, *, *, *, *> - -/** - * Contains mappings from an entity class to [routing setup][RoutingSetup] instances - * discovered for the class. - * - * The setup instances are created using the [ServiceLoader] which scans - * the implementations of the following interfaces: - * * [CommandRoutingSetup] - * * [EventRoutingSetup] - * * [StateRoutingSetup]. - */ -internal object RoutingSetupRegistry { - - private val entries: Set - - init { - val setupInterfaces = setOf( - CommandRoutingSetup::class, - EventRoutingSetup::class, - StateRoutingSetup::class - ) - val allServices = setupInterfaces - .map { it.java } - .flatMap { ServiceLoader.load(it) } - val grouped = allServices.groupBy { it.entityClass() } - - entries = grouped.map { (cls, setups) -> Entry(cls, setups) }.toSet() - } - - /** - * Obtains a routing setup for the given entity class, if any. - */ - fun find( - entityClass: Class>, - setupInterface: Class - ): RSetup? { - val entry = entries.find { it.entityClass == entityClass } - return entry?.find(setupInterface) - } - - private data class Entry( - val entityClass: Class>, - private val setups: List - ) { - init { - require(setups.isNotEmpty()) { - "No setups passed for the entity class `${entityClass.canonicalName}`." - } - // Check the consistency of grouping. - setups.forEach { setup -> - require(setup.entityClass() == entityClass) { - val setupClass = setup::class.qualifiedName - val servedBySetup = setup.entityClass().simpleName - "The `entityClass` (`${entityClass.simpleName}`) of the entry" + - " must match the property of the setup (`$setupClass`)." + - " Encountered: `$servedBySetup`." - } - } - } - - /** - * Finds a setup with the given superclass among those found for the [entityClass]. - */ - fun find(setupClass: Class): RSetup? { - val found = setups.find { - setupClass.isAssignableFrom(it.javaClass) - } - return found - } - } -} diff --git a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt b/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt deleted file mode 100644 index fb0f47194..000000000 --- a/mc-java-routing/src/main/kotlin/io/spine/server/route/setup/StateRoutingSetup.kt +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright 2025, TeamDev. All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * https://www.apache.org/licenses/LICENSE-2.0 - * - * Redistribution and use in source and/or binary forms, with or without - * modification, must retain the above copyright notice and the following - * disclaimer. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -package io.spine.server.route.setup - -import io.spine.base.EntityState -import io.spine.core.EventContext -import io.spine.server.entity.Entity -import io.spine.server.route.StateUpdateRouting - -public interface StateRoutingSetup : - RoutingSetup, EventContext, Set, StateUpdateRouting> { - - public companion object { - - public fun apply(cls: Class>, routing: StateUpdateRouting) { - val found = RoutingSetupRegistry.find(cls, StateRoutingSetup::class.java) - found?.let { - @Suppress("UNCHECKED_CAST") - (it as StateRoutingSetup).setup(routing) - } - } - } -} From 8f136e0678ce6472fea4b412717d8207b36eef1f Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 15:44:46 +0000 Subject: [PATCH 89/96] Force Coroutines version --- build.gradle.kts | 2 +- buildSrc/src/main/kotlin/module.gradle.kts | 1 + tests/build.gradle.kts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/build.gradle.kts b/build.gradle.kts index 24376e901..d0f96949b 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -60,7 +60,7 @@ buildscript { resolutionStrategy { force( io.spine.dependency.lib.Grpc.api, - io.spine.dependency.lib.KotlinX.Coroutines.core, + io.spine.dependency.lib.KotlinX.Coroutines.bom, io.spine.dependency.lib.KotlinX.Coroutines.core, io.spine.dependency.lib.KotlinX.Coroutines.jdk8, diff --git a/buildSrc/src/main/kotlin/module.gradle.kts b/buildSrc/src/main/kotlin/module.gradle.kts index e0ac181ec..1cabb0298 100644 --- a/buildSrc/src/main/kotlin/module.gradle.kts +++ b/buildSrc/src/main/kotlin/module.gradle.kts @@ -138,6 +138,7 @@ fun Module.forceConfigurations() { resolutionStrategy { force( Kotlin.stdLib, + KotlinX.Coroutines.bom, KotlinX.Coroutines.core, KotlinX.Coroutines.jdk8, KotlinPoet.ksp, diff --git a/tests/build.gradle.kts b/tests/build.gradle.kts index d356bdae6..d018ee5bf 100644 --- a/tests/build.gradle.kts +++ b/tests/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -76,6 +76,9 @@ buildscript { all { resolutionStrategy { force( + io.spine.dependency.lib.KotlinX.Coroutines.bom, + io.spine.dependency.lib.KotlinX.Coroutines.core, + io.spine.dependency.lib.KotlinX.Coroutines.jdk8, grpc.api, "io.spine:protodata:${protoData.version}", spine.reflect, From b97cf29256e976298469218da38d396737cf15ad Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 15:45:30 +0000 Subject: [PATCH 90/96] Use `Compilation.error` --- .../mc/java/comparable/action/AddComparator.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index cf05dfba4..869b97227 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -106,19 +106,20 @@ public class AddComparator( val field = try { typeSystem.resolve(fieldPath, type) } catch (e: IllegalStateException) { - Compilation.error( - protoSource, option.span.startLine, option.span.startColumn, + Compilation.error(type.file, option.span) { "Unable to find a field with the path `$path` in the type `${type.qualifiedName}`." - ) + } } val fieldType = field.type - check(field.type.cardinality == CARDINALITY_SINGLE) { - "Repeated fields or maps can't participate in comparison. " + - "The invalid field: `$field`, its type: `$fieldType`. " + - "Please, make sure the type of the passed field is compatible with " + - "the `(compare_by)` option." + if (field.type.cardinality != CARDINALITY_SINGLE) { + Compilation.error(type.file, field.span) { + "Repeated fields or maps can't participate in comparison. " + + "The invalid field: `$field`, its type: `$fieldType`. " + + "Please, make sure the type of the passed field is compatible with " + + "the `(compare_by)` option." + } } return when { From a82631918ecbe586ec9f971ac36d1d96ec3ae4ff Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:50:02 +0000 Subject: [PATCH 91/96] Temporarily disable `validation-smoke` integration test project --- tests/settings.gradle.kts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/settings.gradle.kts b/tests/settings.gradle.kts index 26f0d3f5a..51d6594dd 100644 --- a/tests/settings.gradle.kts +++ b/tests/settings.gradle.kts @@ -1,11 +1,11 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Redistribution and use in source and/or binary forms, with or without * modification, must retain the above copyright notice and the following @@ -33,7 +33,7 @@ include( "model-compiler", "rejection", "mc-java-comparable", - "validation-smoke" +// "validation-smoke" ) /* From 91665ff9d5cf9a3b78cf92613c5082fdc69e578a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:50:16 +0000 Subject: [PATCH 92/96] Bump ProtoData -> `0.92.3` --- buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index 3029824bd..02ce7edf2 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.92.2" + private const val fallbackVersion = "0.92.3" /** * The distinct version of ProtoData used by other build tools. From c9a6c1dfc1d50f24a122668d5e1e7d8c092ccb29 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:50:40 +0000 Subject: [PATCH 93/96] Add remote debug fixture --- tests/validation-smoke/build.gradle.kts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/validation-smoke/build.gradle.kts b/tests/validation-smoke/build.gradle.kts index 4ae532c72..1b5dcc90c 100644 --- a/tests/validation-smoke/build.gradle.kts +++ b/tests/validation-smoke/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, TeamDev. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -28,3 +28,5 @@ plugins { java id("io.spine.mc-java") } + +protoDataRemoteDebug(enabled = false) From b3faa4309ac2254a06b065901a4f843bc854b5f3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:50:47 +0000 Subject: [PATCH 94/96] Update config ref. --- config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config b/config index 701de7c86..d3f2e696f 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 701de7c86ff1e84b05600015bc62243940c1bf58 +Subproject commit d3f2e696f3de878d19f7c635107620becb7829f1 From 76b3fe241dfabded4e8fc55f9e20b72a72ade3a3 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:57:33 +0000 Subject: [PATCH 95/96] Remove unused property --- .../tools/mc/java/comparable/action/AddComparator.kt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt index 869b97227..44de63537 100644 --- a/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt +++ b/mc-java-comparable/src/main/kotlin/io/spine/tools/mc/java/comparable/action/AddComparator.kt @@ -41,7 +41,6 @@ import io.spine.protodata.ast.PrimitiveType.TYPE_BYTES import io.spine.protodata.ast.cardinality import io.spine.protodata.ast.find import io.spine.protodata.ast.option -import io.spine.protodata.ast.toJava import io.spine.protodata.ast.unpack import io.spine.protodata.context.CodegenContext import io.spine.protodata.java.ClassName @@ -56,7 +55,6 @@ import io.spine.tools.mc.java.base.joined import io.spine.tools.mc.java.base.resolve import io.spine.tools.mc.java.comparable.WellKnownComparables.isWellKnownComparable import io.spine.tools.psi.addFirst -import java.io.File /** * Builds and inserts a static `comparator` field into the messages that qualify @@ -77,11 +75,6 @@ public class AddComparator( type.option() } - /** The full path to the proto file declaring the [type]. */ - private val protoSource: File by lazy { - type.file.toJava() - } - override fun doRender() { val compareBy = option.unpack() val comparisonFields = compareBy.fieldList.map(::toComparisonField) @@ -101,6 +94,7 @@ public class AddComparator( * Maps the field [path] to an appropriate instance of [ComparisonField], * depending on the field type. */ + @Suppress("SwallowedException") // We transform "unknown field" into compilation error. private fun toComparisonField(path: String): ComparisonField { val fieldPath = path.toFieldPath() val field = try { From 1180823a45c6ed053228578744c6ef7160575b30 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Tue, 18 Feb 2025 18:57:45 +0000 Subject: [PATCH 96/96] Update dependency reports --- dependencies.md | 514 +++++++++++++++++++++++++++++++++++++++--------- pom.xml | 68 +++++-- 2 files changed, 473 insertions(+), 109 deletions(-) diff --git a/dependencies.md b/dependencies.md index 41233fb15..2d1966eac 100644 --- a/dependencies.md +++ b/dependencies.md @@ -138,6 +138,14 @@ * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.github.eisop. **Name** : dataflow-errorprone. **Version** : 3.34.0-eisop1. * **Project URL:** [https://eisop.github.io/](https://eisop.github.io/) * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) @@ -485,6 +493,14 @@ * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1030,7 +1046,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:06 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -1125,6 +1141,14 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -1416,6 +1440,14 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -1937,7 +1969,7 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:07 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -2032,6 +2064,14 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -2323,6 +2363,14 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -2844,7 +2892,7 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3660,7 +3708,7 @@ This report was generated on **Sun Jan 26 21:08:35 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -3755,6 +3803,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -4046,6 +4102,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -4567,7 +4631,7 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -4832,6 +4896,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -5340,7 +5412,7 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -5435,6 +5507,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -5726,6 +5806,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -6247,7 +6335,7 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -6512,6 +6600,14 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7020,7 +7116,7 @@ This report was generated on **Sun Jan 26 21:08:36 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -7115,6 +7211,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -7406,6 +7510,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -7927,7 +8039,7 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -8192,6 +8304,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -8700,7 +8820,7 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -8795,6 +8915,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -9086,6 +9214,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -9607,7 +9743,7 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -9872,6 +10008,14 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -10380,7 +10524,7 @@ This report was generated on **Sun Jan 26 21:08:37 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -10523,6 +10667,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.github.eisop. **Name** : dataflow-errorprone. **Version** : 3.34.0-eisop1. * **Project URL:** [https://eisop.github.io/](https://eisop.github.io/) * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) @@ -10862,6 +11014,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11366,7 +11526,7 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -11374,6 +11534,39 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice # Dependencies of `io.spine.tools:spine-mc-java-routing:2.0.0-SNAPSHOT.263` ## Runtime +1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-bom](https://github.com/FasterXML/jackson-bom) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-annotations. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-core. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-core](https://github.com/FasterXML/jackson-core) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.core. **Name** : jackson-databind. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson](https://github.com/FasterXML/jackson) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-yaml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformats-text](https://github.com/FasterXML/jackson-dataformats-text) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.github.ben-manes.caffeine. **Name** : caffeine. **Version** : 3.0.5. + * **Project URL:** [https://github.com/ben-manes/caffeine](https://github.com/ben-manes/caffeine) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. * **Project URL:** [http://source.android.com/](http://source.android.com/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) @@ -11382,10 +11575,6 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. - * **Project URL:** [https://github.com/google/auto/tree/main/service](https://github.com/google/auto/tree/main/service) - * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11428,6 +11617,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice 1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) +1. **Group** : com.sksamuel.aedile. **Name** : aedile-core. **Version** : 1.3.1. + * **Project URL:** [http://www.github.com/sksamuel/aedile](http://www.github.com/sksamuel/aedile) + * **License:** [The Apache 2.0 License](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. + * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11476,6 +11673,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) +1. **Group** : javax.annotation. **Name** : javax.annotation-api. **Version** : 1.3.2. + * **Project URL:** [http://jcp.org/en/jsr/detail?id=250](http://jcp.org/en/jsr/detail?id=250) + * **License:** [CDDL + GPLv2 with classpath exception](https://github.com/javaee/javax.annotation/blob/master/LICENSE) + 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) @@ -11484,6 +11685,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-api. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-jdt. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11504,11 +11713,31 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-core-jvm. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-jdk8. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.ow2.asm. **Name** : asm. **Version** : 9.6. * **Project URL:** [http://asm.ow2.io/](http://asm.ow2.io/) * **License:** [BSD-3-Clause](https://asm.ow2.io/license.html) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.yaml. **Name** : snakeyaml. **Version** : 2.1. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + ## Compile, tests, and tooling 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. * **Project URL:** [http://aopalliance.sourceforge.net](http://aopalliance.sourceforge.net) @@ -11546,6 +11775,11 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-yaml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformats-text](https://github.com/FasterXML/jackson-dataformats-text) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11636,14 +11870,6 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/error-prone-javac](https://github.com/google/error-prone-javac) * **License:** [GNU General Public License, version 2, with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html) -1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. - * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) - * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - -1. **Group** : com.google.flogger. **Name** : flogger-system-backend. **Version** : 0.7.4. - * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) - * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11666,6 +11892,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/j2objc/](https://github.com/google/j2objc/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.google.protobuf. **Name** : protobuf-gradle-plugin. **Version** : 0.9.4. + * **Project URL:** [https://github.com/google/protobuf-gradle-plugin](https://github.com/google/protobuf-gradle-plugin) + * **License:** [BSD 3-Clause](http://opensource.org/licenses/BSD-3-Clause) + 1. **Group** : com.google.protobuf. **Name** : protobuf-java. **Version** : 3.25.1. * **Project URL:** [https://developers.google.com/protocol-buffers/](https://developers.google.com/protocol-buffers/) * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) @@ -11698,6 +11928,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://checkstyle.org/](https://checkstyle.org/) * **License:** [LGPL-2.1+](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) +1. **Group** : com.sksamuel.aedile. **Name** : aedile-core. **Version** : 1.3.1. + * **Project URL:** [http://www.github.com/sksamuel/aedile](http://www.github.com/sksamuel/aedile) + * **License:** [The Apache 2.0 License](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 4.0.10. * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) @@ -11706,10 +11940,6 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 1.14.2. - * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) - * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11742,7 +11972,7 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : dev.zacsweers.autoservice. **Name** : auto-service-ksp. **Version** : 1.1.0. +1. **Group** : dev.zacsweers.autoservice. **Name** : auto-service-ksp. **Version** : 1.2.0. * **Project URL:** [https://github.com/ZacSweers/auto-service-ksp](https://github.com/ZacSweers/auto-service-ksp) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -11994,15 +12224,18 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice 1. **Group** : org.apache.httpcomponents.core5. **Name** : httpcore5-h2. **Version** : 5.1.3. * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.apache.logging.log4j. **Name** : log4j-api. **Version** : 2.20.0. + * **Project URL:** [https://www.apache.org/](https://www.apache.org/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : org.apache.logging.log4j. **Name** : log4j-core. **Version** : 2.20.0. + * **Project URL:** [https://www.apache.org/](https://www.apache.org/) + * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.apiguardian. **Name** : apiguardian-api. **Version** : 1.1.2. * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.3. - * **Project URL:** [https://checkerframework.org](https://checkerframework.org) - * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) - * **License:** [The MIT License](http://opensource.org/licenses/MIT) - 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) @@ -12268,10 +12501,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/xmlresolver/xmlresolver](https://github.com/xmlresolver/xmlresolver) * **License:** [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0) +1. **Group** : org.yaml. **Name** : snakeyaml. **Version** : 2.1. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:11 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -12279,14 +12516,6 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice # Dependencies of `io.spine.tools:spine-mc-java-routing-tests:2.0.0-SNAPSHOT.263` ## Runtime -1. **Group** : com.google.android. **Name** : annotations. **Version** : 4.1.1.4. - * **Project URL:** [http://source.android.com/](http://source.android.com/) - * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0) - -1. **Group** : com.google.api.grpc. **Name** : proto-google-common-protos. **Version** : 2.22.0. - * **Project URL:** [https://github.com/googleapis/sdk-platform-java](https://github.com/googleapis/sdk-platform-java) - * **License:** [Apache-2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. * **Project URL:** [http://findbugs.sourceforge.net/](http://findbugs.sourceforge.net/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12325,50 +12554,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice 1. **Group** : com.google.protobuf. **Name** : protobuf-kotlin. **Version** : 3.25.1. * **License:** [BSD-3-Clause](https://opensource.org/licenses/BSD-3-Clause) -1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-context. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-core. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-inprocess. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-protobuf. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-protobuf-lite. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-stub. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.grpc. **Name** : grpc-util. **Version** : 1.59.0. - * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - -1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. - * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) - * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) - 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) -1. **Group** : org.codehaus.mojo. **Name** : animal-sniffer-annotations. **Version** : 1.21. - * **License:** [MIT license](http://www.opensource.org/licenses/mit-license.php) - * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) - 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12381,11 +12570,11 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.8.22. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk7. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) -1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.8.22. +1. **Group** : org.jetbrains.kotlin. **Name** : kotlin-stdlib-jdk8. **Version** : 1.9.24. * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12431,6 +12620,11 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.fasterxml.jackson.dataformat. **Name** : jackson-dataformat-yaml. **Version** : 2.15.3. + * **Project URL:** [https://github.com/FasterXML/jackson-dataformats-text](https://github.com/FasterXML/jackson-dataformats-text) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.fasterxml.jackson.module. **Name** : jackson-module-kotlin. **Version** : 2.15.3. * **Project URL:** [https://github.com/FasterXML/jackson-module-kotlin](https://github.com/FasterXML/jackson-module-kotlin) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12513,6 +12707,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/google/error-prone-javac](https://github.com/google/error-prone-javac) * **License:** [GNU General Public License, version 2, with the Classpath Exception](http://openjdk.java.net/legal/gplv2+ce.html) +1. **Group** : com.google.flogger. **Name** : flogger. **Version** : 0.7.4. + * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) + * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.google.flogger. **Name** : flogger-system-backend. **Version** : 0.7.4. + * **Project URL:** [https://github.com/google/flogger](https://github.com/google/flogger) + * **License:** [Apache 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.google.guava. **Name** : failureaccess. **Version** : 1.0.1. * **Project URL:** [https://github.com/google/guava/](https://github.com/google/guava/) * **License:** [The Apache Software License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12567,10 +12769,18 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://checkstyle.org/](https://checkstyle.org/) * **License:** [LGPL-2.1+](http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt) +1. **Group** : com.sksamuel.aedile. **Name** : aedile-core. **Version** : 1.3.1. + * **Project URL:** [http://www.github.com/sksamuel/aedile](http://www.github.com/sksamuel/aedile) + * **License:** [The Apache 2.0 License](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : com.soywiz.korlibs.korte. **Name** : korte-jvm. **Version** : 4.0.10. * **Project URL:** [https://github.com/korlibs/korge-next](https://github.com/korlibs/korge-next) * **License:** [MIT](https://raw.githubusercontent.com/korlibs/korge-next/master/korge/LICENSE.txt) +1. **Group** : com.squareup. **Name** : javapoet. **Version** : 1.13.0. + * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) + * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12595,6 +12805,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://commons.apache.org/collections/](http://commons.apache.org/collections/) * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : dev.zacsweers.autoservice. **Name** : auto-service-ksp. **Version** : 1.2.0. + * **Project URL:** [https://github.com/ZacSweers/auto-service-ksp](https://github.com/ZacSweers/auto-service-ksp) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : info.picocli. **Name** : picocli. **Version** : 4.7.4. * **Project URL:** [https://picocli.info](https://picocli.info) * **License:** [The Apache Software License, version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12742,6 +12956,42 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) +1. **Group** : io.grpc. **Name** : protoc-gen-grpc-java. **Version** : 1.59.0. + * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) + * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-api. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-api-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-core-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-assertions-shared-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + +1. **Group** : io.kotest. **Name** : kotest-common-jvm. **Version** : 5.8.0. + * **Project URL:** [https://github.com/kotest/kotest](https://github.com/kotest/kotest) + * **License:** [Apache-2.0](https://opensource.org/licenses/Apache-2.0) + 1. **Group** : io.perfmark. **Name** : perfmark-api. **Version** : 0.26.0. * **Project URL:** [https://github.com/perfmark/perfmark](https://github.com/perfmark/perfmark) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -12767,6 +13017,7 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **License:** [Apache License v2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) * **License:** [LGPL, version 2.1](http://www.gnu.org/licenses/licenses.html) +1. **Group** : net.ltgt.gradle. **Name** : gradle-errorprone-plugin. **Version** : 3.1.0.**No license information found** 1. **Group** : net.sf.saxon. **Name** : Saxon-HE. **Version** : 12.2. * **Project URL:** [http://www.saxonica.com/](http://www.saxonica.com/) * **License:** [Mozilla Public License Version 2.0](http://www.mozilla.org/MPL/2.0/) @@ -12806,6 +13057,11 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/apiguardian-team/apiguardian](https://github.com/apiguardian-team/apiguardian) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.checkerframework. **Name** : checker-compat-qual. **Version** : 2.5.3. + * **Project URL:** [https://checkerframework.org](https://checkerframework.org) + * **License:** [GNU General Public License, version 2 (GPL2), with the classpath exception](http://www.gnu.org/software/classpath/license.html) + * **License:** [The MIT License](http://opensource.org/licenses/MIT) + 1. **Group** : org.checkerframework. **Name** : checker-qual. **Version** : 3.40.0. * **Project URL:** [https://checkerframework.org/](https://checkerframework.org/) * **License:** [The MIT License](http://opensource.org/licenses/MIT) @@ -12837,6 +13093,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **License:** [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) * **License:** [MPL 1.1](http://www.mozilla.org/MPL/MPL-1.1.html) +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-api. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + +1. **Group** : org.jboss.forge.roaster. **Name** : roaster-jdt. **Version** : 2.28.0.Final. + * **License:** [Eclipse Public License version 1.0](http://www.eclipse.org/legal/epl-v10.html) + * **License:** [Public Domain](http://repository.jboss.org/licenses/cc0-1.0.txt) + 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1. * **Project URL:** [https://github.com/JetBrains/java-annotations](https://github.com/JetBrains/java-annotations) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12865,10 +13129,18 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.dokka. **Name** : gfm-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.dokka. **Name** : javadoc-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.dokka. **Name** : jekyll-plugin. **Version** : 1.9.20. + * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.dokka. **Name** : kotlin-as-java-plugin. **Version** : 1.9.20. * **Project URL:** [https://github.com/Kotlin/dokka](https://github.com/Kotlin/dokka) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12953,6 +13225,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://kotlinlang.org/](https://kotlinlang.org/) * **License:** [The Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlinx. **Name** : atomicfu. **Version** : 0.23.1. + * **Project URL:** [https://github.com/Kotlin/kotlinx.atomicfu](https://github.com/Kotlin/kotlinx.atomicfu) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-bom. **Version** : 1.9.0. * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -12965,6 +13241,10 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-coroutines-jdk8. **Version** : 1.9.0. + * **Project URL:** [https://github.com/Kotlin/kotlinx.coroutines](https://github.com/Kotlin/kotlinx.coroutines) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : org.jetbrains.kotlinx. **Name** : kotlinx-html-jvm. **Version** : 0.8.1. * **Project URL:** [https://github.com/Kotlin/kotlinx.html](https://github.com/Kotlin/kotlinx.html) * **License:** [The Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13043,10 +13323,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [https://github.com/xmlresolver/xmlresolver](https://github.com/xmlresolver/xmlresolver) * **License:** [Apache License version 2.0](https://www.apache.org/licenses/LICENSE-2.0) +1. **Group** : org.yaml. **Name** : snakeyaml. **Version** : 2.1. + * **Project URL:** [https://bitbucket.org/snakeyaml/snakeyaml](https://bitbucket.org/snakeyaml/snakeyaml) + * **License:** [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) + The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:11 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -13141,6 +13425,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -13432,6 +13724,14 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -13953,7 +14253,7 @@ This report was generated on **Sun Jan 26 21:08:38 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:11 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -14218,6 +14518,14 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -14726,7 +15034,7 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:12 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -14821,6 +15129,14 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : io.grpc. **Name** : grpc-api. **Version** : 1.59.0. * **Project URL:** [https://github.com/grpc/grpc-java](https://github.com/grpc/grpc-java) * **License:** [Apache 2.0](https://opensource.org/licenses/Apache-2.0) @@ -15112,6 +15428,14 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -15633,7 +15957,7 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). +This report was generated on **Tue Feb 18 18:52:12 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). @@ -15898,6 +16222,14 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice * **Project URL:** [http://github.com/square/javapoet/](http://github.com/square/javapoet/) * **License:** [Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt) +1. **Group** : com.squareup. **Name** : kotlinpoet. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + +1. **Group** : com.squareup. **Name** : kotlinpoet-jvm. **Version** : 2.0.0. + * **Project URL:** [https://github.com/square/kotlinpoet](https://github.com/square/kotlinpoet) + * **License:** [The Apache Software License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) + 1. **Group** : commons-beanutils. **Name** : commons-beanutils. **Version** : 1.9.4. * **Project URL:** [https://commons.apache.org/proper/commons-beanutils/](https://commons.apache.org/proper/commons-beanutils/) * **License:** [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0.txt) @@ -16406,4 +16738,4 @@ This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Sun Jan 26 21:08:39 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file +This report was generated on **Tue Feb 18 18:52:12 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE). \ No newline at end of file diff --git a/pom.xml b/pom.xml index 02366594a..d37e83246 100644 --- a/pom.xml +++ b/pom.xml @@ -1,4 +1,30 @@ + + 4.0.0