From 8f3683590dfbbcea56c0343ccb2d2e6f9972320b Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:09:32 +0000 Subject: [PATCH 01/35] Bump version -> `2.0.0-SNAPSHOT.395` --- version.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.gradle.kts b/version.gradle.kts index bae585a6c9..5254c065ee 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -29,4 +29,4 @@ * * For Spine-based dependencies please see [io.spine.dependency.local.Spine]. */ -val validationVersion by extra("2.0.0-SNAPSHOT.394") +val validationVersion by extra("2.0.0-SNAPSHOT.395") From 567e894f8135497f0132c39de7e23a34e1049d1e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:11:50 +0000 Subject: [PATCH 02/35] Update dependency reports --- dependencies.md | 64 ++++++++++++++++++++++++------------------------- pom.xml | 10 ++++---- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/dependencies.md b/dependencies.md index ef9b16989b..5db51bd769 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1139,14 +1139,14 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:38 WET 2026** 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:validation-context-tests:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1731,28 +1731,28 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:34 WET 2026** 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:validation-docs:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.395` ## Runtime ## Compile, tests, and tooling The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Thu Feb 12 20:41:43 WET 2026** using +This report was generated on **Mon Feb 16 17:09:32 WET 2026** 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:validation-gradle-plugin:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -2841,14 +2841,14 @@ This report was generated on **Thu Feb 12 20:41:43 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:38 WET 2026** 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:validation-java:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -3935,14 +3935,14 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:38 WET 2026** 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:validation-java-bundle:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. @@ -4005,14 +4005,14 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:09 WET 2026** using +This report was generated on **Mon Feb 16 17:09:33 WET 2026** 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:validation-jvm-runtime:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine:validation-jvm-runtime:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -4845,14 +4845,14 @@ This report was generated on **Fri Feb 13 15:18:09 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:38 WET 2026** 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:validation-ksp:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-ksp:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.auto.service. **Name** : auto-service-annotations. **Version** : 1.1.1. @@ -5781,14 +5781,14 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:53 WET 2026** 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:validation-consumer:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -6379,14 +6379,14 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:33 WET 2026** 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:validation-consumer-dependency:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -6897,14 +6897,14 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:35 WET 2026** 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:validation-extensions:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -7588,14 +7588,14 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:37 WET 2026** 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:validation-runtime:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8217,14 +8217,14 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:35 WET 2026** 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:validation-validating:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8889,14 +8889,14 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:11 WET 2026** using +This report was generated on **Mon Feb 16 17:09:35 WET 2026** 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:validation-validator:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -9647,14 +9647,14 @@ This report was generated on **Fri Feb 13 15:18:11 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:35 WET 2026** 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:validation-validator-dependency:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -9924,14 +9924,14 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:33 WET 2026** 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:validation-vanilla:2.0.0-SNAPSHOT.394` +# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.395` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -10282,6 +10282,6 @@ This report was generated on **Fri Feb 13 15:18:10 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 13 15:18:10 WET 2026** using +This report was generated on **Mon Feb 16 17:09:33 WET 2026** 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 7fcb99b699..81c35af93d 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 validation -2.0.0-SNAPSHOT.394 +2.0.0-SNAPSHOT.395 2015 @@ -68,7 +68,7 @@ all modules and does not describe the project structure per-subproject. io.spine spine-validation-jvm-runtime - 2.0.0-SNAPSHOT.393 + 2.0.0-SNAPSHOT.394 compile @@ -287,12 +287,12 @@ all modules and does not describe the project structure per-subproject. io.spine.tools core-jvm-gradle-plugins - 2.0.0-SNAPSHOT.052 + 2.0.0-SNAPSHOT.053 io.spine.tools core-jvm-routing - 2.0.0-SNAPSHOT.052 + 2.0.0-SNAPSHOT.053 io.spine.tools @@ -307,7 +307,7 @@ all modules and does not describe the project structure per-subproject. io.spine.tools validation-java-bundle - 2.0.0-SNAPSHOT.393 + 2.0.0-SNAPSHOT.394 net.sourceforge.pmd From 34e75186d11ecef9464a19d5de4e0a54886e444a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:12:11 +0000 Subject: [PATCH 03/35] Bump Validation and CoreJvm Compiler --- .../main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt | 4 ++-- .../src/main/kotlin/io/spine/dependency/local/Validation.kt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt index 39d0336ca4..0944be06ee 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt @@ -46,12 +46,12 @@ object CoreJvmCompiler { /** * The version used to in the build classpath. */ - const val dogfoodingVersion = "2.0.0-SNAPSHOT.052" + const val dogfoodingVersion = "2.0.0-SNAPSHOT.053" /** * The version to be used for integration tests. */ - const val version = "2.0.0-SNAPSHOT.052" + const val version = "2.0.0-SNAPSHOT.053" /** * The ID of the Gradle plugin. 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 1cad8b7403..a76093c131 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.393" + const val version = "2.0.0-SNAPSHOT.394" /** * The last version of Validation compatible with ProtoData. From 3267234c11b7c59a763d745203577e46ded55c2d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:33:48 +0000 Subject: [PATCH 04/35] Remove "Validation Workflow" section reference --- docs/content/docs/validation/01-getting-started/_index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/_index.md b/docs/content/docs/validation/01-getting-started/_index.md index 8e9279f293..a207815516 100644 --- a/docs/content/docs/validation/01-getting-started/_index.md +++ b/docs/content/docs/validation/01-getting-started/_index.md @@ -47,5 +47,5 @@ the code produced by `protoc`. ## What’s next - [Adding Validation to your build](adding-to-build.md) -- [Your First Validated Model](first-model.md) -- [Validation Workflow](workflow.md) +- [Your first validated model](first-model.md) + From 63ba34ba9c16144ee3b9c17bd9718f9209be76eb Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:34:05 +0000 Subject: [PATCH 05/35] Embed code for adding Gradle plugins --- .../validation/01-getting-started/adding-to-build.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/adding-to-build.md b/docs/content/docs/validation/01-getting-started/adding-to-build.md index 94618cb624..f852361c72 100644 --- a/docs/content/docs/validation/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/01-getting-started/adding-to-build.md @@ -15,9 +15,12 @@ Use this mode if you want to run Validation without the rest of Spine. 1) Add the Validation plugin to the build. + ```kotlin plugins { - id("io.spine.validation") version "" + `java-library` + kotlin("jvm") version "2.2.21" + id("io.spine.validation") version "2.0.0-SNAPSHOT.395" } ``` @@ -43,9 +46,12 @@ and brings in the JVM runtime dependency automatically. If your project is base on the Spine CoreJvm library, apply the CoreJvm Gradle plugin instead of adding Validation directly. CoreJvm brings in the Validation Gradle plugin for you. + ```kotlin plugins { - id("io.spine.core-jvm") version "" + `java-library` + kotlin("jvm") version "2.2.21" + id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.053" } ``` From 9dbfec5050dc2f25a1a0c6905fc6e4e385447373 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:34:45 +0000 Subject: [PATCH 06/35] Bump local versions in examples --- docs/_code/first-model-with-framework/build.gradle.kts | 2 +- docs/_code/first-model/build.gradle.kts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_code/first-model-with-framework/build.gradle.kts index 2cbfdc62c5..39da46382d 100644 --- a/docs/_code/first-model-with-framework/build.gradle.kts +++ b/docs/_code/first-model-with-framework/build.gradle.kts @@ -29,7 +29,7 @@ import java.net.URI plugins { `java-library` kotlin("jvm") version "2.2.21" - id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.052" + id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.053" } apply(from = "../code-common.gradle.kts") diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_code/first-model/build.gradle.kts index 1c1030bcce..16d05c62c4 100644 --- a/docs/_code/first-model/build.gradle.kts +++ b/docs/_code/first-model/build.gradle.kts @@ -29,7 +29,7 @@ import java.net.URI plugins { `java-library` kotlin("jvm") version "2.2.21" - id("io.spine.validation") version "2.0.0-SNAPSHOT.394" + id("io.spine.validation") version "2.0.0-SNAPSHOT.395" } apply(from = "../code-common.gradle.kts") From 8b4235efab9dcd592b4a92524c6cddfcb49c025d Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:35:44 +0000 Subject: [PATCH 07/35] Update Validation version in "First model" section --- docs/content/docs/validation/01-getting-started/first-model.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/content/docs/validation/01-getting-started/first-model.md b/docs/content/docs/validation/01-getting-started/first-model.md index ac7230f2eb..ae0f64191f 100644 --- a/docs/content/docs/validation/01-getting-started/first-model.md +++ b/docs/content/docs/validation/01-getting-started/first-model.md @@ -15,7 +15,7 @@ To use the Validation library, add the `io.spine.validation` plugin to your `bui plugins { `java-library` kotlin("jvm") version "2.2.21" - id("io.spine.validation") version "2.0.0-SNAPSHOT.394" + id("io.spine.validation") version "2.0.0-SNAPSHOT.395" } ``` From ec30a700065470aacce091b0c43977a51d1a2733 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 17:41:34 +0000 Subject: [PATCH 08/35] Make the section "Configure the project" refer to "Adding Validation to a Gradle build" --- .../validation/01-getting-started/first-model.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/first-model.md b/docs/content/docs/validation/01-getting-started/first-model.md index ae0f64191f..a71a465e94 100644 --- a/docs/content/docs/validation/01-getting-started/first-model.md +++ b/docs/content/docs/validation/01-getting-started/first-model.md @@ -8,16 +8,8 @@ The validation options come from `spine/options.proto` and include constraints l ## 1) Configure the project -To use the Validation library, add the `io.spine.validation` plugin to your `build.gradle.kts` file: - - -```kotlin -plugins { - `java-library` - kotlin("jvm") version "2.2.21" - id("io.spine.validation") version "2.0.0-SNAPSHOT.395" -} -``` +First, make sure your project is configured to use the Validation library. +See [Adding Validation to a Gradle build](adding-to-build.md) for detailed instructions. ## 2) Define a validated message From 94de0ab4abfe0ced4c96cd689555d5086b2eff04 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 18:51:07 +0000 Subject: [PATCH 09/35] Add code fragments for invalid digits case --- .../docs/firstmodel/BankCardTest.java | 2 ++ .../docs/firstmodel/BankCardKtTest.kt | 2 ++ .../01-getting-started/first-model.md | 22 ++++++++++++------- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java b/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java index 5acc4dd013..4cc90eb035 100644 --- a/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java +++ b/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java @@ -39,12 +39,14 @@ class BankCardTest { @Test @DisplayName("throw `ValidationException` if digits are invalid") void invalidDigits() { + // #docfragment "invalid-digits" assertThrows(ValidationException.class, () -> BankCard.newBuilder() .setDigits("invalid") .setOwner("ALEX SMITH") .build() ); + // #enddocfragment "invalid-digits" } @Test diff --git a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt index 1b16ca1301..62bbd167a8 100644 --- a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt +++ b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt @@ -38,12 +38,14 @@ class BankCardKtTest { @Test @DisplayName("throw `ValidationException` if digits are invalid") fun invalidDigits() { + // #docfragment "invalid-digits" assertThrows { bankCard { digits = "invalid" owner = "ALEX SMITH" } } + // #enddocfragment "invalid-digits" } @Test diff --git a/docs/content/docs/validation/01-getting-started/first-model.md b/docs/content/docs/validation/01-getting-started/first-model.md index a71a465e94..3ff75fbc0e 100644 --- a/docs/content/docs/validation/01-getting-started/first-model.md +++ b/docs/content/docs/validation/01-getting-started/first-model.md @@ -90,18 +90,24 @@ The code will be generated under the `generated` directory of your project. Validation runs on `build()` and can be triggered manually with `validate()`. + ```java -var card = BankCard.newBuilder() - .setDigits("invalid") - .setOwner("Al") - .build(); // Throws `ValidationException`. +assertThrows(ValidationException.class, () -> + BankCard.newBuilder() + .setDigits("invalid") + .setOwner("ALEX SMITH") + .build() +); ``` + ```kotlin -val card = bankCard { - digits = "invalid" - owner = "Al" -} // Throws `ValidationException`. +assertThrows { + bankCard { + digits = "invalid" + owner = "ALEX SMITH" + } +} ``` To validate without throwing, use `validate()` on a built message: From 503cc8872c402e8cd45389d8af7b7137e8ca2432 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 19:11:20 +0000 Subject: [PATCH 10/35] Add README for `fist-model-with-framework` --- docs/_code/first-model-with-framework/README.md | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 docs/_code/first-model-with-framework/README.md diff --git a/docs/_code/first-model-with-framework/README.md b/docs/_code/first-model-with-framework/README.md new file mode 100644 index 0000000000..a2fc812c35 --- /dev/null +++ b/docs/_code/first-model-with-framework/README.md @@ -0,0 +1,11 @@ +# Using Validation in a Spine-based project + +This project uses the same sources as the [`first-model`][first-model] example, +but with the Spine CoreJvm Gradle plugin applied. + +Same sources are arranged using the `src` symlink, which points to the `src` directory of +the [`first-model`][first-model] example. + +This way, you can compare the two projects and see how the Gradle configuration differs. + +[first-model]: ../first-model/ From e7873577f6892eff00983644fbed738b89afdf87 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 19:59:49 +0000 Subject: [PATCH 11/35] Add samples for using validation error message --- docs/_code/first-model/build.gradle.kts | 1 + .../docs/firstmodel/BankCardTest.java | 21 +++++++++++ .../docs/firstmodel/BankCardKtTest.kt | 35 +++++++++++++------ .../01-getting-started/first-model.md | 32 ++++++++++++++--- 4 files changed, 74 insertions(+), 15 deletions(-) diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_code/first-model/build.gradle.kts index 16d05c62c4..cb18b602fe 100644 --- a/docs/_code/first-model/build.gradle.kts +++ b/docs/_code/first-model/build.gradle.kts @@ -47,6 +47,7 @@ repositories { dependencies { testImplementation(kotlin("test")) + testImplementation("com.google.truth:truth:1.4.5") } kotlin { diff --git a/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java b/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java index 4cc90eb035..c6ff6af85f 100644 --- a/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java +++ b/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java @@ -27,9 +27,11 @@ package io.spine.validation.docs.firstmodel; import io.spine.validation.ValidationException; +import io.spine.validation.TemplateStrings; import org.junit.jupiter.api.DisplayName; import org.junit.jupiter.api.Test; +import static com.google.common.truth.Truth.assertThat; import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -96,4 +98,23 @@ void multipleWordsOwner() { .build() ); } + + @Test + @DisplayName("provide a formatted error message for an invalid card") + void formattedErrorMessage() { + // #docfragment "error-message" + var card = BankCard.newBuilder() + .setOwner("ALEX SMITH") + .setDigits("wrong number") + .buildPartial(); + var error = card.validate(); + assertThat(error).isPresent(); + + var violation = error.get().getConstraintViolation(0); + var formatted = TemplateStrings.format(violation.getMessage()); + + assertThat(formatted).contains("digits"); + assertThat(formatted).contains("wrong number"); + // #enddocfragment "error-message" + } } diff --git a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt index 62bbd167a8..39f5d6e0ee 100644 --- a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt +++ b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt @@ -27,17 +27,18 @@ package io.spine.validation.docs.firstmodel import io.spine.validation.ValidationException +import io.spine.validation.format import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test import org.junit.jupiter.api.assertThrows import org.junit.jupiter.api.Assertions.assertDoesNotThrow +import com.google.common.truth.Truth.assertThat @DisplayName("`BankCard` in Kotlin should") class BankCardKtTest { @Test - @DisplayName("throw `ValidationException` if digits are invalid") - fun invalidDigits() { + fun `throw 'ValidationException' if digits are invalid`() { // #docfragment "invalid-digits" assertThrows { bankCard { @@ -49,8 +50,7 @@ class BankCardKtTest { } @Test - @DisplayName("throw `ValidationException` if owner is invalid") - fun invalidOwner() { + fun `throw 'ValidationException' if owner is invalid`() { assertThrows { bankCard { digits = "1234 5678 1234 5678" @@ -60,8 +60,7 @@ class BankCardKtTest { } @Test - @DisplayName("throw `ValidationException` if tags are not distinct") - fun duplicateTags() { + fun `throw 'ValidationException' if tags are not distinct`() { assertThrows { bankCard { digits = "1234 5678 1234 5678" @@ -73,8 +72,7 @@ class BankCardKtTest { } @Test - @DisplayName("be built if all fields are valid") - fun validCard() { + fun `be built if all fields are valid`() { assertDoesNotThrow { bankCard { digits = "1234 5678 1234 5678" @@ -86,8 +84,7 @@ class BankCardKtTest { } @Test - @DisplayName("allow multiple words in the owner name") - fun multipleWordsOwner() { + fun `allow multiple words in the owner name`() { assertDoesNotThrow { bankCard { digits = "1234 5678 1234 5678" @@ -95,4 +92,22 @@ class BankCardKtTest { } } } + + @Test + fun `provide a formatted error message for an invalid card`() { + // #docfragment "error-message" + val card = BankCard.newBuilder() + .setOwner("ALEX SMITH") + .setDigits("wrong number") + .buildPartial() // There is no Kotlin DSL for this. + val error = card.validate() + assertThat(error).isPresent() + + val violation = error.get().constraintViolationList[0] + val formatted = violation.message.format() + + assertThat(formatted).contains("digits") + assertThat(formatted).contains("wrong number") + // #enddocfragment "error-message" + } } diff --git a/docs/content/docs/validation/01-getting-started/first-model.md b/docs/content/docs/validation/01-getting-started/first-model.md index 3ff75fbc0e..eca7a43afc 100644 --- a/docs/content/docs/validation/01-getting-started/first-model.md +++ b/docs/content/docs/validation/01-getting-started/first-model.md @@ -112,15 +112,37 @@ assertThrows { To validate without throwing, use `validate()` on a built message: + ```java var card = BankCard.newBuilder() - .setDigits("invalid") - .buildPartial(); - + .setOwner("ALEX SMITH") + .setDigits("wrong number") + .buildPartial(); var error = card.validate(); -error.ifPresent(err -> System.out.println(err.getMessage())); +assertThat(error).isPresent(); + +var violation = error.get().getConstraintViolation(0); +var formatted = TemplateStrings.format(violation.getMessage()); + +assertThat(formatted).contains("digits"); +assertThat(formatted).contains("wrong number"); ``` - + + +```kotlin +val card = BankCard.newBuilder() + .setOwner("ALEX SMITH") + .setDigits("wrong number") + .buildPartial() // There is no Kotlin DSL for this. +val error = card.validate() +assertThat(error).isPresent() + +val violation = error.get().constraintViolationList[0] +val formatted = violation.message.format() + +assertThat(formatted).contains("digits") +assertThat(formatted).contains("wrong number") +``` ## What’s next From c1f681d88848bd4d86da4e1f5a60cfc96a8637e2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 20:21:58 +0000 Subject: [PATCH 12/35] Use Kotest assertions in Kotlin samples --- .../build.gradle.kts | 4 ++- docs/_code/first-model/build.gradle.kts | 1 + .../docs/firstmodel/BankCardKtTest.kt | 31 +++++++++---------- .../01-getting-started/first-model.md | 8 ++--- 4 files changed, 23 insertions(+), 21 deletions(-) diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_code/first-model-with-framework/build.gradle.kts index 39da46382d..e15039dd43 100644 --- a/docs/_code/first-model-with-framework/build.gradle.kts +++ b/docs/_code/first-model-with-framework/build.gradle.kts @@ -52,8 +52,10 @@ dependencies { // (rather than `implementation`) dependency of the runtime artifact. // Before this version, this dependency comes as the `implementation` and as such // is not visible for the Java compiler. - implementation("io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.394") + //implementation("io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.394") testImplementation(kotlin("test")) + testImplementation("com.google.truth:truth:1.4.5") + testImplementation("io.kotest:kotest-assertions-core:6.0.4") } kotlin { diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_code/first-model/build.gradle.kts index cb18b602fe..ae4aaf7717 100644 --- a/docs/_code/first-model/build.gradle.kts +++ b/docs/_code/first-model/build.gradle.kts @@ -48,6 +48,7 @@ repositories { dependencies { testImplementation(kotlin("test")) testImplementation("com.google.truth:truth:1.4.5") + testImplementation("io.kotest:kotest-assertions-core:6.0.4") } kotlin { diff --git a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt index 39f5d6e0ee..b31d105769 100644 --- a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt +++ b/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt @@ -28,19 +28,18 @@ package io.spine.validation.docs.firstmodel import io.spine.validation.ValidationException import io.spine.validation.format -import org.junit.jupiter.api.DisplayName import org.junit.jupiter.api.Test -import org.junit.jupiter.api.assertThrows -import org.junit.jupiter.api.Assertions.assertDoesNotThrow -import com.google.common.truth.Truth.assertThat +import io.kotest.assertions.throwables.shouldThrow +import io.kotest.assertions.throwables.shouldNotThrowAny +import io.kotest.matchers.optional.shouldBePresent +import io.kotest.matchers.string.shouldContain -@DisplayName("`BankCard` in Kotlin should") class BankCardKtTest { @Test - fun `throw 'ValidationException' if digits are invalid`() { + fun `throw ValidationException if digits are invalid`() { // #docfragment "invalid-digits" - assertThrows { + shouldThrow { bankCard { digits = "invalid" owner = "ALEX SMITH" @@ -50,8 +49,8 @@ class BankCardKtTest { } @Test - fun `throw 'ValidationException' if owner is invalid`() { - assertThrows { + fun `throw ValidationException if owner is invalid`() { + shouldThrow { bankCard { digits = "1234 5678 1234 5678" owner = "Al" @@ -60,8 +59,8 @@ class BankCardKtTest { } @Test - fun `throw 'ValidationException' if tags are not distinct`() { - assertThrows { + fun `throw ValidationException if tags are not distinct`() { + shouldThrow { bankCard { digits = "1234 5678 1234 5678" owner = "ALEX SMITH" @@ -73,7 +72,7 @@ class BankCardKtTest { @Test fun `be built if all fields are valid`() { - assertDoesNotThrow { + shouldNotThrowAny { bankCard { digits = "1234 5678 1234 5678" owner = "ALEX SMITH" @@ -85,7 +84,7 @@ class BankCardKtTest { @Test fun `allow multiple words in the owner name`() { - assertDoesNotThrow { + shouldNotThrowAny { bankCard { digits = "1234 5678 1234 5678" owner = "John Jacob Jingleheimer Schmidt" @@ -101,13 +100,13 @@ class BankCardKtTest { .setDigits("wrong number") .buildPartial() // There is no Kotlin DSL for this. val error = card.validate() - assertThat(error).isPresent() + error.shouldBePresent() val violation = error.get().constraintViolationList[0] val formatted = violation.message.format() - assertThat(formatted).contains("digits") - assertThat(formatted).contains("wrong number") + formatted shouldContain "digits" + formatted shouldContain "wrong number" // #enddocfragment "error-message" } } diff --git a/docs/content/docs/validation/01-getting-started/first-model.md b/docs/content/docs/validation/01-getting-started/first-model.md index eca7a43afc..4a502c5229 100644 --- a/docs/content/docs/validation/01-getting-started/first-model.md +++ b/docs/content/docs/validation/01-getting-started/first-model.md @@ -102,7 +102,7 @@ assertThrows(ValidationException.class, () -> ```kotlin -assertThrows { +shouldThrow { bankCard { digits = "invalid" owner = "ALEX SMITH" @@ -135,13 +135,13 @@ val card = BankCard.newBuilder() .setDigits("wrong number") .buildPartial() // There is no Kotlin DSL for this. val error = card.validate() -assertThat(error).isPresent() +error.shouldBePresent() val violation = error.get().constraintViolationList[0] val formatted = violation.message.format() -assertThat(formatted).contains("digits") -assertThat(formatted).contains("wrong number") +formatted shouldContain "digits" +formatted shouldContain "wrong number" ``` ## What’s next From 96d8d18e1256a60fe89da6e660b821c0600bfa23 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 20:24:17 +0000 Subject: [PATCH 13/35] Remove no longer needed dependency --- docs/_code/first-model-with-framework/build.gradle.kts | 7 ------- 1 file changed, 7 deletions(-) diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_code/first-model-with-framework/build.gradle.kts index e15039dd43..d22b24bfb4 100644 --- a/docs/_code/first-model-with-framework/build.gradle.kts +++ b/docs/_code/first-model-with-framework/build.gradle.kts @@ -46,13 +46,6 @@ repositories { } dependencies { - // Temporarily add the dependency on Validation JVM Runtime explicitly. - // We need this until CoreJvm Compiler migrates to the Validation version - // `2.0.0-SNAPSHOT.394` or later. This version exposes Spine Base as the `api` - // (rather than `implementation`) dependency of the runtime artifact. - // Before this version, this dependency comes as the `implementation` and as such - // is not visible for the Java compiler. - //implementation("io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.394") testImplementation(kotlin("test")) testImplementation("com.google.truth:truth:1.4.5") testImplementation("io.kotest:kotest-assertions-core:6.0.4") From 20428a736bb9b8b38164cd74e60bf317fd444684 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 20:32:45 +0000 Subject: [PATCH 14/35] Improve common script name --- docs/_code/{code-common.gradle.kts => common.gradle.kts} | 0 docs/_code/first-model-with-framework/build.gradle.kts | 2 +- docs/_code/first-model/build.gradle.kts | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename docs/_code/{code-common.gradle.kts => common.gradle.kts} (100%) diff --git a/docs/_code/code-common.gradle.kts b/docs/_code/common.gradle.kts similarity index 100% rename from docs/_code/code-common.gradle.kts rename to docs/_code/common.gradle.kts diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_code/first-model-with-framework/build.gradle.kts index d22b24bfb4..753d49f47b 100644 --- a/docs/_code/first-model-with-framework/build.gradle.kts +++ b/docs/_code/first-model-with-framework/build.gradle.kts @@ -32,7 +32,7 @@ plugins { id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.053" } -apply(from = "../code-common.gradle.kts") +apply(from = "../common.gradle.kts") repositories { mavenLocal() diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_code/first-model/build.gradle.kts index ae4aaf7717..0b10de3f9b 100644 --- a/docs/_code/first-model/build.gradle.kts +++ b/docs/_code/first-model/build.gradle.kts @@ -32,7 +32,7 @@ plugins { id("io.spine.validation") version "2.0.0-SNAPSHOT.395" } -apply(from = "../code-common.gradle.kts") +apply(from = "../common.gradle.kts") repositories { mavenLocal() From fed02dff5b7b4d4c0d66d151d0fdfac2771beff1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 20:35:49 +0000 Subject: [PATCH 15/35] Pull repository definition to the `common` script --- docs/_code/common.gradle.kts | 12 ++++++++++++ .../first-model-with-framework/build.gradle.kts | 13 ------------- docs/_code/first-model/build.gradle.kts | 13 ------------- 3 files changed, 12 insertions(+), 26 deletions(-) diff --git a/docs/_code/common.gradle.kts b/docs/_code/common.gradle.kts index 7750402462..8a14bba0db 100644 --- a/docs/_code/common.gradle.kts +++ b/docs/_code/common.gradle.kts @@ -23,6 +23,7 @@ * (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 java.net.URI group = "io.spine.validation.docs" @@ -31,3 +32,14 @@ group = "io.spine.validation.docs" // not to this script because it is applied from the example projects. apply(from = "../../../version.gradle.kts") version = extra["validationVersion"]!! + +repositories { + mavenLocal() + mavenCentral() + maven { + url = URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") + } + maven { + url = URI("https://europe-maven.pkg.dev/spine-event-engine/releases") + } +} diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_code/first-model-with-framework/build.gradle.kts index 753d49f47b..822f09564c 100644 --- a/docs/_code/first-model-with-framework/build.gradle.kts +++ b/docs/_code/first-model-with-framework/build.gradle.kts @@ -24,8 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.net.URI - plugins { `java-library` kotlin("jvm") version "2.2.21" @@ -34,17 +32,6 @@ plugins { apply(from = "../common.gradle.kts") -repositories { - mavenLocal() - mavenCentral() - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } -} - dependencies { testImplementation(kotlin("test")) testImplementation("com.google.truth:truth:1.4.5") diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_code/first-model/build.gradle.kts index 0b10de3f9b..ae2baadb5a 100644 --- a/docs/_code/first-model/build.gradle.kts +++ b/docs/_code/first-model/build.gradle.kts @@ -24,8 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -import java.net.URI - plugins { `java-library` kotlin("jvm") version "2.2.21" @@ -34,17 +32,6 @@ plugins { apply(from = "../common.gradle.kts") -repositories { - mavenLocal() - mavenCentral() - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } -} - dependencies { testImplementation(kotlin("test")) testImplementation("com.google.truth:truth:1.4.5") From 18c5ce4f8bba3f7bbab5ee2ac0519d66aeb50645 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 20:48:56 +0000 Subject: [PATCH 16/35] Fix code layout --- docs/_code/common.gradle.kts | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/_code/common.gradle.kts b/docs/_code/common.gradle.kts index 8a14bba0db..3feb89fcdb 100644 --- a/docs/_code/common.gradle.kts +++ b/docs/_code/common.gradle.kts @@ -23,6 +23,7 @@ * (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 java.net.URI group = "io.spine.validation.docs" From e86767b604c03ff0685981c17db1a0e90b8375fa Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 21:04:41 +0000 Subject: [PATCH 17/35] Rename `_code` to `_examples` --- docs/{_code => _examples}/common.gradle.kts | 2 +- .../first-model-with-framework/README.md | 0 .../first-model-with-framework/build.gradle.kts | 0 .../first-model-with-framework/gradle.properties | 0 .../first-model-with-framework/gradlew | 0 .../first-model-with-framework/gradlew.bat | 0 .../first-model-with-framework/settings.gradle.kts | 0 docs/{_code => _examples}/first-model-with-framework/src | 0 docs/{_code => _examples}/first-model/build.gradle.kts | 0 docs/{_code => _examples}/first-model/gradle.properties | 0 docs/{_code => _examples}/first-model/gradlew | 0 docs/{_code => _examples}/first-model/gradlew.bat | 0 docs/{_code => _examples}/first-model/settings.gradle.kts | 0 .../spine/validation/docs/first_model/bank_card.proto | 0 .../io/spine/validation/docs/firstmodel/BankCardTest.java | 0 .../io/spine/validation/docs/firstmodel/BankCardKtTest.kt | 0 docs/_script/embed-code | 2 +- docs/_settings/embed-code.yml | 4 ++-- docs/build.gradle.kts | 8 ++++---- 19 files changed, 8 insertions(+), 8 deletions(-) rename docs/{_code => _examples}/common.gradle.kts (98%) rename docs/{_code => _examples}/first-model-with-framework/README.md (100%) rename docs/{_code => _examples}/first-model-with-framework/build.gradle.kts (100%) rename docs/{_code => _examples}/first-model-with-framework/gradle.properties (100%) rename docs/{_code => _examples}/first-model-with-framework/gradlew (100%) rename docs/{_code => _examples}/first-model-with-framework/gradlew.bat (100%) rename docs/{_code => _examples}/first-model-with-framework/settings.gradle.kts (100%) rename docs/{_code => _examples}/first-model-with-framework/src (100%) rename docs/{_code => _examples}/first-model/build.gradle.kts (100%) rename docs/{_code => _examples}/first-model/gradle.properties (100%) rename docs/{_code => _examples}/first-model/gradlew (100%) rename docs/{_code => _examples}/first-model/gradlew.bat (100%) rename docs/{_code => _examples}/first-model/settings.gradle.kts (100%) rename docs/{_code => _examples}/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto (100%) rename docs/{_code => _examples}/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java (100%) rename docs/{_code => _examples}/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt (100%) diff --git a/docs/_code/common.gradle.kts b/docs/_examples/common.gradle.kts similarity index 98% rename from docs/_code/common.gradle.kts rename to docs/_examples/common.gradle.kts index 3feb89fcdb..bb55813c81 100644 --- a/docs/_code/common.gradle.kts +++ b/docs/_examples/common.gradle.kts @@ -29,7 +29,7 @@ import java.net.URI group = "io.spine.validation.docs" // Take the version from the main code project. -// The path to the version script is relevant to a directory _under_ the `_code`, +// The path to the version script is relevant to a directory _under_ the `_examples`, // not to this script because it is applied from the example projects. apply(from = "../../../version.gradle.kts") version = extra["validationVersion"]!! diff --git a/docs/_code/first-model-with-framework/README.md b/docs/_examples/first-model-with-framework/README.md similarity index 100% rename from docs/_code/first-model-with-framework/README.md rename to docs/_examples/first-model-with-framework/README.md diff --git a/docs/_code/first-model-with-framework/build.gradle.kts b/docs/_examples/first-model-with-framework/build.gradle.kts similarity index 100% rename from docs/_code/first-model-with-framework/build.gradle.kts rename to docs/_examples/first-model-with-framework/build.gradle.kts diff --git a/docs/_code/first-model-with-framework/gradle.properties b/docs/_examples/first-model-with-framework/gradle.properties similarity index 100% rename from docs/_code/first-model-with-framework/gradle.properties rename to docs/_examples/first-model-with-framework/gradle.properties diff --git a/docs/_code/first-model-with-framework/gradlew b/docs/_examples/first-model-with-framework/gradlew similarity index 100% rename from docs/_code/first-model-with-framework/gradlew rename to docs/_examples/first-model-with-framework/gradlew diff --git a/docs/_code/first-model-with-framework/gradlew.bat b/docs/_examples/first-model-with-framework/gradlew.bat similarity index 100% rename from docs/_code/first-model-with-framework/gradlew.bat rename to docs/_examples/first-model-with-framework/gradlew.bat diff --git a/docs/_code/first-model-with-framework/settings.gradle.kts b/docs/_examples/first-model-with-framework/settings.gradle.kts similarity index 100% rename from docs/_code/first-model-with-framework/settings.gradle.kts rename to docs/_examples/first-model-with-framework/settings.gradle.kts diff --git a/docs/_code/first-model-with-framework/src b/docs/_examples/first-model-with-framework/src similarity index 100% rename from docs/_code/first-model-with-framework/src rename to docs/_examples/first-model-with-framework/src diff --git a/docs/_code/first-model/build.gradle.kts b/docs/_examples/first-model/build.gradle.kts similarity index 100% rename from docs/_code/first-model/build.gradle.kts rename to docs/_examples/first-model/build.gradle.kts diff --git a/docs/_code/first-model/gradle.properties b/docs/_examples/first-model/gradle.properties similarity index 100% rename from docs/_code/first-model/gradle.properties rename to docs/_examples/first-model/gradle.properties diff --git a/docs/_code/first-model/gradlew b/docs/_examples/first-model/gradlew similarity index 100% rename from docs/_code/first-model/gradlew rename to docs/_examples/first-model/gradlew diff --git a/docs/_code/first-model/gradlew.bat b/docs/_examples/first-model/gradlew.bat similarity index 100% rename from docs/_code/first-model/gradlew.bat rename to docs/_examples/first-model/gradlew.bat diff --git a/docs/_code/first-model/settings.gradle.kts b/docs/_examples/first-model/settings.gradle.kts similarity index 100% rename from docs/_code/first-model/settings.gradle.kts rename to docs/_examples/first-model/settings.gradle.kts diff --git a/docs/_code/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto b/docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto similarity index 100% rename from docs/_code/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto rename to docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto diff --git a/docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java b/docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java similarity index 100% rename from docs/_code/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java rename to docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java diff --git a/docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt b/docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt similarity index 100% rename from docs/_code/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt rename to docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt diff --git a/docs/_script/embed-code b/docs/_script/embed-code index 2667b966d0..fdaf56a789 100755 --- a/docs/_script/embed-code +++ b/docs/_script/embed-code @@ -37,7 +37,7 @@ elif [ -f ${BASH_RC} ]; then . ${BASH_RC} fi -# Ensure `docs/_code` files are fetched. +# Ensure `docs/_examples` files are fetched. git submodule update --remote --merge --recursive # Navigate to the folder with embed-code binaries. diff --git a/docs/_settings/embed-code.yml b/docs/_settings/embed-code.yml index 3f442ea165..170b024569 100644 --- a/docs/_settings/embed-code.yml +++ b/docs/_settings/embed-code.yml @@ -1,5 +1,5 @@ -code-path: "../_code" +code-path: "../_examples" docs-path: "../content/docs/" embed-mappings: - - code-path: "../_code" + - code-path: "../_examples" docs-path: "../content/docs/" diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index dfa0e29c90..67ab2c5bb4 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -35,7 +35,7 @@ LicenseReporter.generateReportIn(project) val updateValidationPluginVersion = tasks.register("updateValidationPluginVersion") { - directory.set(file("$projectDir/_code/")) + directory.set(file("$projectDir/_examples/")) val validationVersion: String by rootProject.extra version.set(validationVersion) pluginId.set("io.spine.validation") @@ -43,7 +43,7 @@ val updateValidationPluginVersion = } val updateCoreJvmPluginVersion = tasks.register("updateCoreJvmPluginVersion") { - directory.set(file("$projectDir/_code/")) + directory.set(file("$projectDir/_examples/")) version.set(CoreJvmCompiler.version) pluginId.set("io.spine.core-jvm") kotlinVersion.set(Kotlin.version) @@ -101,14 +101,14 @@ val publishAllToMavenLocal by tasks.registering { } val buildFirstModel by tasks.registering(RunGradle::class) { - directory = "$projectDir/_code/first-model" + directory = "$projectDir/_examples/first-model" task("buildAll") dependsOn(publishAllToMavenLocal) dependsOn(updateValidationPluginVersion) } val buildFirstModelWithFramework by tasks.registering(RunGradle::class) { - directory = "$projectDir/_code/first-model-with-framework" + directory = "$projectDir/_examples/first-model-with-framework" task("buildAll") dependsOn(publishAllToMavenLocal) dependsOn(updateValidationPluginVersion) From 758d557f81b0f4725e1ce3019240dd269cf73c2a Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 16 Feb 2026 21:14:07 +0000 Subject: [PATCH 18/35] Extract variables for common settings --- docs/build.gradle.kts | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index 67ab2c5bb4..4f671d03bd 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -100,16 +100,23 @@ val publishAllToMavenLocal by tasks.registering { ) } +// The root directory for the example projects. +val examplesDir = "$projectDir/_examples" + +// The conventional name for the tasks that build "everything" for the documentation. +// E.g., the example projects these tasks do `clean build`. +val buildAll = "buildAll" + val buildFirstModel by tasks.registering(RunGradle::class) { - directory = "$projectDir/_examples/first-model" - task("buildAll") + directory = "$examplesDir/first-model" + task(buildAll) dependsOn(publishAllToMavenLocal) dependsOn(updateValidationPluginVersion) } val buildFirstModelWithFramework by tasks.registering(RunGradle::class) { - directory = "$projectDir/_examples/first-model-with-framework" - task("buildAll") + directory = "$examplesDir/first-model-with-framework" + task(buildAll) dependsOn(publishAllToMavenLocal) dependsOn(updateValidationPluginVersion) } @@ -119,7 +126,7 @@ val buildExamples by tasks.registering { dependsOn(buildFirstModel, buildFirstModelWithFramework) } -tasks.register("buildAll") { +tasks.register(buildAll) { dependsOn(publishAllToMavenLocal) dependsOn(buildExamples) } From a1724419ccaceaf5e6f2f6a95120a90e02ff0c0a Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Thu, 19 Feb 2026 21:40:23 +0000 Subject: [PATCH 19/35] Add examples submodule --- .gitmodules | 3 + docs/_examples | 1 + docs/_examples/common.gradle.kts | 46 ------- .../first-model-with-framework/README.md | 11 -- .../build.gradle.kts | 56 -------- .../gradle.properties | 1 - .../first-model-with-framework/gradlew | 1 - .../first-model-with-framework/gradlew.bat | 1 - .../settings.gradle.kts | 40 ------ docs/_examples/first-model-with-framework/src | 1 - docs/_examples/first-model/build.gradle.kts | 56 -------- docs/_examples/first-model/gradle.properties | 1 - docs/_examples/first-model/gradlew | 1 - docs/_examples/first-model/gradlew.bat | 1 - .../_examples/first-model/settings.gradle.kts | 40 ------ .../docs/first_model/bank_card.proto | 41 ------ .../docs/firstmodel/BankCardTest.java | 120 ------------------ .../docs/firstmodel/BankCardKtTest.kt | 112 ---------------- 18 files changed, 4 insertions(+), 529 deletions(-) create mode 160000 docs/_examples delete mode 100644 docs/_examples/common.gradle.kts delete mode 100644 docs/_examples/first-model-with-framework/README.md delete mode 100644 docs/_examples/first-model-with-framework/build.gradle.kts delete mode 120000 docs/_examples/first-model-with-framework/gradle.properties delete mode 120000 docs/_examples/first-model-with-framework/gradlew delete mode 120000 docs/_examples/first-model-with-framework/gradlew.bat delete mode 100644 docs/_examples/first-model-with-framework/settings.gradle.kts delete mode 120000 docs/_examples/first-model-with-framework/src delete mode 100644 docs/_examples/first-model/build.gradle.kts delete mode 120000 docs/_examples/first-model/gradle.properties delete mode 120000 docs/_examples/first-model/gradlew delete mode 120000 docs/_examples/first-model/gradlew.bat delete mode 100644 docs/_examples/first-model/settings.gradle.kts delete mode 100644 docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto delete mode 100644 docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java delete mode 100644 docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt diff --git a/.gitmodules b/.gitmodules index 94e8664d69..97a9d16eb5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "config"] path = config url = https://github.com/SpineEventEngine/config +[submodule "docs/_examples"] + path = docs/_examples + url = https://github.com/spine-examples/hello-validation diff --git a/docs/_examples b/docs/_examples new file mode 160000 index 0000000000..1a4b6be7cf --- /dev/null +++ b/docs/_examples @@ -0,0 +1 @@ +Subproject commit 1a4b6be7cfa392ff37de9888af5b0cfed38919aa diff --git a/docs/_examples/common.gradle.kts b/docs/_examples/common.gradle.kts deleted file mode 100644 index bb55813c81..0000000000 --- a/docs/_examples/common.gradle.kts +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright 2026, 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 java.net.URI - -group = "io.spine.validation.docs" - -// Take the version from the main code project. -// The path to the version script is relevant to a directory _under_ the `_examples`, -// not to this script because it is applied from the example projects. -apply(from = "../../../version.gradle.kts") -version = extra["validationVersion"]!! - -repositories { - mavenLocal() - mavenCentral() - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } -} diff --git a/docs/_examples/first-model-with-framework/README.md b/docs/_examples/first-model-with-framework/README.md deleted file mode 100644 index a2fc812c35..0000000000 --- a/docs/_examples/first-model-with-framework/README.md +++ /dev/null @@ -1,11 +0,0 @@ -# Using Validation in a Spine-based project - -This project uses the same sources as the [`first-model`][first-model] example, -but with the Spine CoreJvm Gradle plugin applied. - -Same sources are arranged using the `src` symlink, which points to the `src` directory of -the [`first-model`][first-model] example. - -This way, you can compare the two projects and see how the Gradle configuration differs. - -[first-model]: ../first-model/ diff --git a/docs/_examples/first-model-with-framework/build.gradle.kts b/docs/_examples/first-model-with-framework/build.gradle.kts deleted file mode 100644 index 822f09564c..0000000000 --- a/docs/_examples/first-model-with-framework/build.gradle.kts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2026, 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 { - `java-library` - kotlin("jvm") version "2.2.21" - id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.053" -} - -apply(from = "../common.gradle.kts") - -dependencies { - testImplementation(kotlin("test")) - testImplementation("com.google.truth:truth:1.4.5") - testImplementation("io.kotest:kotest-assertions-core:6.0.4") -} - -kotlin { - jvmToolchain(17) -} - -tasks.test { - useJUnitPlatform() -} - -tasks.register("buildAll") { - dependsOn(tasks.clean) - dependsOn(tasks.build) -} - -tasks.named("build").configure { - mustRunAfter("clean") -} diff --git a/docs/_examples/first-model-with-framework/gradle.properties b/docs/_examples/first-model-with-framework/gradle.properties deleted file mode 120000 index 591a8b3f8d..0000000000 --- a/docs/_examples/first-model-with-framework/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -../../../gradle.properties \ No newline at end of file diff --git a/docs/_examples/first-model-with-framework/gradlew b/docs/_examples/first-model-with-framework/gradlew deleted file mode 120000 index ab9334b002..0000000000 --- a/docs/_examples/first-model-with-framework/gradlew +++ /dev/null @@ -1 +0,0 @@ -../../../gradlew \ No newline at end of file diff --git a/docs/_examples/first-model-with-framework/gradlew.bat b/docs/_examples/first-model-with-framework/gradlew.bat deleted file mode 120000 index b284c30991..0000000000 --- a/docs/_examples/first-model-with-framework/gradlew.bat +++ /dev/null @@ -1 +0,0 @@ -../../../gradlew.bat \ No newline at end of file diff --git a/docs/_examples/first-model-with-framework/settings.gradle.kts b/docs/_examples/first-model-with-framework/settings.gradle.kts deleted file mode 100644 index 65f27dc6ec..0000000000 --- a/docs/_examples/first-model-with-framework/settings.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2026, 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. - */ - -rootProject.name = "first-model-with-framework" - -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } - } -} diff --git a/docs/_examples/first-model-with-framework/src b/docs/_examples/first-model-with-framework/src deleted file mode 120000 index 89e7e6d433..0000000000 --- a/docs/_examples/first-model-with-framework/src +++ /dev/null @@ -1 +0,0 @@ -../first-model/src \ No newline at end of file diff --git a/docs/_examples/first-model/build.gradle.kts b/docs/_examples/first-model/build.gradle.kts deleted file mode 100644 index ae2baadb5a..0000000000 --- a/docs/_examples/first-model/build.gradle.kts +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright 2026, 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 { - `java-library` - kotlin("jvm") version "2.2.21" - id("io.spine.validation") version "2.0.0-SNAPSHOT.395" -} - -apply(from = "../common.gradle.kts") - -dependencies { - testImplementation(kotlin("test")) - testImplementation("com.google.truth:truth:1.4.5") - testImplementation("io.kotest:kotest-assertions-core:6.0.4") -} - -kotlin { - jvmToolchain(17) -} - -tasks.test { - useJUnitPlatform() -} - -tasks.register("buildAll") { - dependsOn(tasks.clean) - dependsOn(tasks.build) -} - -tasks.named("build").configure { - mustRunAfter("clean") -} diff --git a/docs/_examples/first-model/gradle.properties b/docs/_examples/first-model/gradle.properties deleted file mode 120000 index 591a8b3f8d..0000000000 --- a/docs/_examples/first-model/gradle.properties +++ /dev/null @@ -1 +0,0 @@ -../../../gradle.properties \ No newline at end of file diff --git a/docs/_examples/first-model/gradlew b/docs/_examples/first-model/gradlew deleted file mode 120000 index ab9334b002..0000000000 --- a/docs/_examples/first-model/gradlew +++ /dev/null @@ -1 +0,0 @@ -../../../gradlew \ No newline at end of file diff --git a/docs/_examples/first-model/gradlew.bat b/docs/_examples/first-model/gradlew.bat deleted file mode 120000 index b284c30991..0000000000 --- a/docs/_examples/first-model/gradlew.bat +++ /dev/null @@ -1 +0,0 @@ -../../../gradlew.bat \ No newline at end of file diff --git a/docs/_examples/first-model/settings.gradle.kts b/docs/_examples/first-model/settings.gradle.kts deleted file mode 100644 index de70c06cde..0000000000 --- a/docs/_examples/first-model/settings.gradle.kts +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright 2026, 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. - */ - -rootProject.name = "first-model" - -pluginManagement { - repositories { - mavenLocal() - gradlePluginPortal() - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } - } -} diff --git a/docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto b/docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto deleted file mode 100644 index fa1259b8e9..0000000000 --- a/docs/_examples/first-model/src/main/proto/spine/validation/docs/first_model/bank_card.proto +++ /dev/null @@ -1,41 +0,0 @@ -syntax = "proto3"; - -package spine.validation.docs.first_model; - -import "spine/options.proto"; - -option (type_url_prefix) = "type.spine.io"; -option java_package = "io.spine.validation.docs.firstmodel"; -option java_multiple_files = true; - -// Provides bank card information with validation rules. -// -// The digits of the card are simplified for the sake of the example. -// -message BankCard { - - // The digits of the card number. - // - // Must be present and match a 16-digit card number formatted as four - // groups of four digits separated by spaces (for example, "1234 5678 1234 5678"). - // - string digits = 1 [ - (required) = true, - (pattern).regex = "^\\d{4}(?: \\d{4}){3}" - ]; - - // The name of the card owner. - // - // Must be present, contain at least 4 characters, start with a Latin letter, - // and have exactly one space between words. - // - string owner = 2 [ - (required) = true, - (pattern).regex = "^(?=.{4,})[A-Z][A-Za-z]*(?: [A-Za-z]+)+$" - ]; - - // All tags must be unique. Tags are optional. - repeated string tags = 3 [ - (distinct) = true - ]; -} diff --git a/docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java b/docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java deleted file mode 100644 index c6ff6af85f..0000000000 --- a/docs/_examples/first-model/src/test/java/io/spine/validation/docs/firstmodel/BankCardTest.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * Copyright 2026, 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.validation.docs.firstmodel; - -import io.spine.validation.ValidationException; -import io.spine.validation.TemplateStrings; -import org.junit.jupiter.api.DisplayName; -import org.junit.jupiter.api.Test; - -import static com.google.common.truth.Truth.assertThat; -import static org.junit.jupiter.api.Assertions.assertDoesNotThrow; -import static org.junit.jupiter.api.Assertions.assertThrows; - -@DisplayName("`BankCard` should") -class BankCardTest { - - @Test - @DisplayName("throw `ValidationException` if digits are invalid") - void invalidDigits() { - // #docfragment "invalid-digits" - assertThrows(ValidationException.class, () -> - BankCard.newBuilder() - .setDigits("invalid") - .setOwner("ALEX SMITH") - .build() - ); - // #enddocfragment "invalid-digits" - } - - @Test - @DisplayName("throw `ValidationException` if owner is invalid") - void invalidOwner() { - assertThrows(ValidationException.class, () -> - BankCard.newBuilder() - .setDigits("1234 5678 1234 5678") - .setOwner("Al") - .build() - ); - } - - @Test - @DisplayName("throw `ValidationException` if tags are not distinct") - void duplicateTags() { - assertThrows(ValidationException.class, () -> - BankCard.newBuilder() - .setDigits("1234 5678 1234 5678") - .setOwner("ALEX SMITH") - .addTags("personal") - .addTags("personal") - .build() - ); - } - - @Test - @DisplayName("be built if all fields are valid") - void validCard() { - assertDoesNotThrow(() -> - BankCard.newBuilder() - .setDigits("1234 5678 1234 5678") - .setOwner("ALEX SMITH") - .addTags("personal") - .addTags("travel") - .build() - ); - } - - @Test - @DisplayName("allow multiple words in the owner name") - void multipleWordsOwner() { - assertDoesNotThrow(() -> - BankCard.newBuilder() - .setDigits("1234 5678 1234 5678") - .setOwner("John Jacob Jingleheimer Schmidt") - .build() - ); - } - - @Test - @DisplayName("provide a formatted error message for an invalid card") - void formattedErrorMessage() { - // #docfragment "error-message" - var card = BankCard.newBuilder() - .setOwner("ALEX SMITH") - .setDigits("wrong number") - .buildPartial(); - var error = card.validate(); - assertThat(error).isPresent(); - - var violation = error.get().getConstraintViolation(0); - var formatted = TemplateStrings.format(violation.getMessage()); - - assertThat(formatted).contains("digits"); - assertThat(formatted).contains("wrong number"); - // #enddocfragment "error-message" - } -} diff --git a/docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt b/docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt deleted file mode 100644 index b31d105769..0000000000 --- a/docs/_examples/first-model/src/test/kotlin/io/spine/validation/docs/firstmodel/BankCardKtTest.kt +++ /dev/null @@ -1,112 +0,0 @@ -/* - * Copyright 2026, 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.validation.docs.firstmodel - -import io.spine.validation.ValidationException -import io.spine.validation.format -import org.junit.jupiter.api.Test -import io.kotest.assertions.throwables.shouldThrow -import io.kotest.assertions.throwables.shouldNotThrowAny -import io.kotest.matchers.optional.shouldBePresent -import io.kotest.matchers.string.shouldContain - -class BankCardKtTest { - - @Test - fun `throw ValidationException if digits are invalid`() { - // #docfragment "invalid-digits" - shouldThrow { - bankCard { - digits = "invalid" - owner = "ALEX SMITH" - } - } - // #enddocfragment "invalid-digits" - } - - @Test - fun `throw ValidationException if owner is invalid`() { - shouldThrow { - bankCard { - digits = "1234 5678 1234 5678" - owner = "Al" - } - } - } - - @Test - fun `throw ValidationException if tags are not distinct`() { - shouldThrow { - bankCard { - digits = "1234 5678 1234 5678" - owner = "ALEX SMITH" - tags.add("personal") - tags.add("personal") - } - } - } - - @Test - fun `be built if all fields are valid`() { - shouldNotThrowAny { - bankCard { - digits = "1234 5678 1234 5678" - owner = "ALEX SMITH" - tags.add("personal") - tags.add("travel") - } - } - } - - @Test - fun `allow multiple words in the owner name`() { - shouldNotThrowAny { - bankCard { - digits = "1234 5678 1234 5678" - owner = "John Jacob Jingleheimer Schmidt" - } - } - } - - @Test - fun `provide a formatted error message for an invalid card`() { - // #docfragment "error-message" - val card = BankCard.newBuilder() - .setOwner("ALEX SMITH") - .setDigits("wrong number") - .buildPartial() // There is no Kotlin DSL for this. - val error = card.validate() - error.shouldBePresent() - - val violation = error.get().constraintViolationList[0] - val formatted = violation.message.format() - - formatted shouldContain "digits" - formatted shouldContain "wrong number" - // #enddocfragment "error-message" - } -} From 7b860bcdb28bd559d8d1581314f606d02fa09859 Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Thu, 19 Feb 2026 22:08:39 +0000 Subject: [PATCH 20/35] Adjust the `buildExamples` task to the submodule arrangment --- docs/build.gradle.kts | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index 4f671d03bd..ef757349e8 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -107,25 +107,13 @@ val examplesDir = "$projectDir/_examples" // E.g., the example projects these tasks do `clean build`. val buildAll = "buildAll" -val buildFirstModel by tasks.registering(RunGradle::class) { - directory = "$examplesDir/first-model" +val buildExamples by tasks.registering(RunGradle::class) { + directory = examplesDir task(buildAll) dependsOn(publishAllToMavenLocal) dependsOn(updateValidationPluginVersion) } -val buildFirstModelWithFramework by tasks.registering(RunGradle::class) { - directory = "$examplesDir/first-model-with-framework" - task(buildAll) - dependsOn(publishAllToMavenLocal) - dependsOn(updateValidationPluginVersion) -} - -val buildExamples by tasks.registering { - dependsOn(updatePluginVersions) - dependsOn(buildFirstModel, buildFirstModelWithFramework) -} - tasks.register(buildAll) { dependsOn(publishAllToMavenLocal) dependsOn(buildExamples) From d22f6692e794b0f885884e9fef7f0848134cb8cb Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Thu, 19 Feb 2026 22:15:57 +0000 Subject: [PATCH 21/35] Update module ref. --- docs/_examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_examples b/docs/_examples index 1a4b6be7cf..6352150d21 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit 1a4b6be7cfa392ff37de9888af5b0cfed38919aa +Subproject commit 6352150d21f12c395f6ac1212634d40494224fe1 From 1b66bbfeab829b1ddf04820c6cebcf256ade4558 Mon Sep 17 00:00:00 2001 From: Alexander Yevsyukov Date: Thu, 19 Feb 2026 22:31:14 +0000 Subject: [PATCH 22/35] Update submodule ref. --- docs/_examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_examples b/docs/_examples index 6352150d21..c34fbfb42d 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit 6352150d21f12c395f6ac1212634d40494224fe1 +Subproject commit c34fbfb42d4eecb0bfbf0c62792bf4f5eef5eefe From d48b56916eb3eab21684a98cd013348d730bd5d2 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 16:18:15 +0000 Subject: [PATCH 23/35] Update examples module ref. --- docs/_examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_examples b/docs/_examples index c34fbfb42d..52d45dce3e 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit c34fbfb42d4eecb0bfbf0c62792bf4f5eef5eefe +Subproject commit 52d45dce3e2bd163e34bdfdfecd0be5430d34597 From 8abe88c4916fcb85ad32187ffc029439e093af86 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 16:58:34 +0000 Subject: [PATCH 24/35] Describe custom plugin repositories Also: * Add note about the `module` script plugin. --- .../01-getting-started/adding-to-build.md | 61 +++++++++++-------- 1 file changed, 36 insertions(+), 25 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/adding-to-build.md b/docs/content/docs/validation/01-getting-started/adding-to-build.md index f852361c72..e5eb53d0e7 100644 --- a/docs/content/docs/validation/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/01-getting-started/adding-to-build.md @@ -1,64 +1,75 @@ # Adding Validation to a Gradle build +## Adding Spine-specific Gradle plugin repositories + + +```kotlin +pluginManagement { + repositories { + mavenLocal() + gradlePluginPortal() + maven { + url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") + } + maven { + url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/releases") + } + } +} +``` +The repositories at https://europe-maven.pkg.dev are needed for obtaining the versions of +Spine tools and libraries that are not yet published to the Gradle Plugin Portal or Maven Central. + +## Adding Gradle plugins to the build + Spine Validation can be added to a JVM project in two different ways. Choose the setup that matches your project: - Standalone use in any Protobuf-based project. -- As part of a Spine-based project that already uses the CoreJvm toolchain. +- As part of a Spine-based project that uses the CoreJvm toolchain. Both modes integrate the Validation compiler into the build and add the runtime library. -## Mode 1: standalone via Validation Gradle plugin +### Mode 1: standalone via Validation Gradle plugin Use this mode if you want to run Validation without the rest of Spine. -1) Add the Validation plugin to the build. +Add the Validation plugin to the build. ```kotlin plugins { - `java-library` - kotlin("jvm") version "2.2.21" + module id("io.spine.validation") version "2.0.0-SNAPSHOT.395" } ``` -2) Make sure your repositories include Spine artifacts (the same repositories you use - for other Spine tools and libraries). - -3) Optional: control Validation generation explicitly. - -```kotlin -spine { - validation { - enabled.set(true) // `true` by default - } -} -``` +> ##### What is the `module` plugin? +> The plugin `module` in the snippet above refers to the name of the script plugin +> `buildSrc/src/kotlin/module.gradle.kts` which provides common configuration for +> the subprojects of the multi-module examples project. +> For more details on this, clone the [Validation examples repository][valildation-examples]. The plugin wires Validation into Spine Compiler, adds the Validation Java codegen bundle, and brings in the JVM runtime dependency automatically. -## Mode 2: Spine-based project via CoreJvm Gradle plugin +### Mode 2: Spine-based project via CoreJvm Gradle plugin -If your project is base on the Spine CoreJvm library, apply the CoreJvm Gradle plugin instead of +If your project is based on the Spine CoreJvm library, apply the CoreJvm Gradle plugin instead of adding Validation directly. CoreJvm brings in the Validation Gradle plugin for you. ```kotlin plugins { - `java-library` - kotlin("jvm") version "2.2.21" + module id("io.spine.core-jvm") version "2.0.0-SNAPSHOT.053" } ``` -Validation is available right away, and you can configure it using the same `validation` -extension if needed. - - ## Next step Continue with [Your first validated model](first-model.md). + +[valildation-examples]: https://github.com/spine-examples/hello-validation From 6a5bb916bf4b6ee77f84cc3f47da5fcca6ecb5bc Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 17:58:06 +0000 Subject: [PATCH 25/35] Update embedded code sample --- .../validation/01-getting-started/adding-to-build.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/adding-to-build.md b/docs/content/docs/validation/01-getting-started/adding-to-build.md index e5eb53d0e7..323206aec0 100644 --- a/docs/content/docs/validation/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/01-getting-started/adding-to-build.md @@ -8,12 +8,8 @@ pluginManagement { repositories { mavenLocal() gradlePluginPortal() - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - } - maven { - url = java.net.URI("https://europe-maven.pkg.dev/spine-event-engine/releases") - } + maven("https://europe-maven.pkg.dev/spine-event-engine/snapshots") + maven("https://europe-maven.pkg.dev/spine-event-engine/releases") } } ``` @@ -30,7 +26,6 @@ Choose the setup that matches your project: Both modes integrate the Validation compiler into the build and add the runtime library. - ### Mode 1: standalone via Validation Gradle plugin Use this mode if you want to run Validation without the rest of Spine. From 34390773617b2ac0a4d7c7f0201e116119e5deb1 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 18:37:51 +0000 Subject: [PATCH 26/35] Add custom repositories --- .../gradle/ValidationGradlePlugin.kt | 57 +++++++++++-------- 1 file changed, 34 insertions(+), 23 deletions(-) diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt index 4f35440b29..10669193e8 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt @@ -30,7 +30,6 @@ import com.google.protobuf.gradle.ProtobufPlugin import io.spine.tools.compiler.gradle.api.addUserClasspathDependency import io.spine.tools.compiler.gradle.api.compilerSettings import io.spine.tools.compiler.gradle.plugin.Extension -import io.spine.tools.compiler.gradle.plugin.Plugin as CompilerGradlePlugin import io.spine.tools.gradle.DslSpec import io.spine.tools.gradle.lib.LibraryPlugin import io.spine.tools.gradle.lib.spineExtension @@ -38,6 +37,9 @@ import io.spine.tools.meta.MavenArtifact import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.kotlin.dsl.apply +import org.gradle.kotlin.dsl.maven +import org.gradle.kotlin.dsl.repositories +import io.spine.tools.compiler.gradle.plugin.Plugin as CompilerGradlePlugin /** * Gradle plugin that configures the Spine Compiler to run the Validation Compiler. @@ -55,31 +57,40 @@ public class ValidationGradlePlugin : LibraryPlugin( // Apply the Compiler Gradle Plugin so that we can manipulate the compiler settings. // We do not want the user to add it manually either. project.apply() - val javaBundle = ValidationSdk.javaCodegenBundle - project.run { - addUserClasspathDependency(javaBundle) - afterEvaluate { - // Add the Validation Java Compiler only if `spine/validation/enabled` is true. - if (validationExtension.enabled.get()) { - (compilerSettings as Extension).run { - // Put the Validation Java Compiler first in the list of the plugins. - // Other plugins may rely on the validation code. - val ordered = listOf(ValidationSdk.javaCompilerPlugin) + plugins.get() - plugins.set(ordered) - } - } + project.configureValidation() + } +} + +private fun Project.configureValidation() { + repositories { + mavenLocal() + mavenCentral() + maven("https://europe-maven.pkg.dev/spine-event-engine/snapshots") + maven("https://europe-maven.pkg.dev/spine-event-engine/releases") + } + + val javaBundle = ValidationSdk.javaCodegenBundle + addUserClasspathDependency(javaBundle) + afterEvaluate { + // Add the Validation Java Compiler only if `spine/validation/enabled` is true. + if (validationExtension.enabled.get()) { + (compilerSettings as Extension).run { + // Put the Validation Java Compiler first in the list of the plugins. + // Other plugins may rely on the validation code. + val ordered = listOf(ValidationSdk.javaCompilerPlugin) + plugins.get() + plugins.set(ordered) } - // We add the dependency on runtime anyway for the following reasons: - // 1. We do not want users to change their Gradle build files when they turn on or off - // code generation for the validation code. - // - // 2. We have run-time validation rules that are going to be used in parallel with - // the generated code. This includes current and new implementation for validation - // rules for the already existing generated Protobuf code. - // - addDependency("implementation", ValidationSdk.jvmRuntime) } } + // We add the dependency on runtime anyway for the following reasons: + // 1. We do not want users to change their Gradle build files when they turn on or off + // code generation for the validation code. + // + // 2. We have run-time validation rules that are going to be used in parallel with + // the generated code. This includes current and new implementation for validation + // rules for the already existing generated Protobuf code. + // + addDependency("implementation", ValidationSdk.jvmRuntime) } /** From 103611f58fa87fd915e76a5773a68e0c463c5f17 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 18:54:09 +0000 Subject: [PATCH 27/35] Update build time --- dependencies.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dependencies.md b/dependencies.md index 5db51bd769..622435929d 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1139,7 +1139,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:38 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -1731,7 +1731,7 @@ This report was generated on **Mon Feb 16 17:09:38 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:34 WET 2026** using +This report was generated on **Fri Feb 20 18:36:34 WET 2026** 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). @@ -2841,7 +2841,7 @@ This report was generated on **Mon Feb 16 17:09:32 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:38 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -3935,7 +3935,7 @@ This report was generated on **Mon Feb 16 17:09:38 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:38 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -4005,7 +4005,7 @@ This report was generated on **Mon Feb 16 17:09:38 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:33 WET 2026** using +This report was generated on **Fri Feb 20 18:36:34 WET 2026** 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). @@ -4845,7 +4845,7 @@ This report was generated on **Mon Feb 16 17:09:33 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:38 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -5781,7 +5781,7 @@ This report was generated on **Mon Feb 16 17:09:38 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:53 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -6379,7 +6379,7 @@ This report was generated on **Mon Feb 16 17:09:53 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:33 WET 2026** using +This report was generated on **Fri Feb 20 18:36:34 WET 2026** 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). @@ -6897,7 +6897,7 @@ This report was generated on **Mon Feb 16 17:09:33 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:35 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -7588,7 +7588,7 @@ This report was generated on **Mon Feb 16 17:09:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:37 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -8217,7 +8217,7 @@ This report was generated on **Mon Feb 16 17:09:37 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:35 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -8889,7 +8889,7 @@ This report was generated on **Mon Feb 16 17:09:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:35 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -9647,7 +9647,7 @@ This report was generated on **Mon Feb 16 17:09:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:35 WET 2026** using +This report was generated on **Fri Feb 20 18:36:35 WET 2026** 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). @@ -9924,7 +9924,7 @@ This report was generated on **Mon Feb 16 17:09:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:33 WET 2026** using +This report was generated on **Fri Feb 20 18:36:34 WET 2026** 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). @@ -10282,6 +10282,6 @@ This report was generated on **Mon Feb 16 17:09:33 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:33 WET 2026** using +This report was generated on **Fri Feb 20 18:36:34 WET 2026** 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 From 7dc424df92ac3d3c220be25266b203875e8713de Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Fri, 20 Feb 2026 19:09:51 +0000 Subject: [PATCH 28/35] Update examples module ref. --- docs/_examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/_examples b/docs/_examples index 52d45dce3e..8c32da4ed2 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit 52d45dce3e2bd163e34bdfdfecd0be5430d34597 +Subproject commit 8c32da4ed2c1ea4a04e391f3517ccb6625a51fa9 From 80b1e52de453534f1d58c83c2536830687550959 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:24:47 +0000 Subject: [PATCH 29/35] Do not add repositories in `ValidationGradlePlugin` --- .../src/main/kotlin/io/spine/dependency/local/Compiler.kt | 4 ++-- .../src/main/kotlin/io/spine/dependency/local/ToolBase.kt | 4 ++-- .../tools/validation/gradle/ValidationGradlePlugin.kt | 7 ------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt index ff1ad47ec0..304cbf4a94 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Compiler.kt @@ -72,7 +72,7 @@ object Compiler : Dependency() { * The version of the Compiler dependencies. */ override val version: String - private const val fallbackVersion = "2.0.0-SNAPSHOT.038" + private const val fallbackVersion = "2.0.0-SNAPSHOT.039" /** * The distinct version of the Compiler used by other build tools. @@ -81,7 +81,7 @@ object Compiler : Dependency() { * transitive dependencies, this is the version used to build the project itself. */ val dogfoodingVersion: String - private const val fallbackDfVersion = "2.0.0-SNAPSHOT.038" + private const val fallbackDfVersion = "2.0.0-SNAPSHOT.039" /** * The artifact for the Compiler Gradle plugin. 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 1df8dd1f47..be8a3b7fa4 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt @@ -34,8 +34,8 @@ package io.spine.dependency.local @Suppress("ConstPropertyName", "unused") object ToolBase { const val group = Spine.toolsGroup - const val version = "2.0.0-SNAPSHOT.371" - const val dogfoodingVersion = "2.0.0-SNAPSHOT.371" + const val version = "2.0.0-SNAPSHOT.372" + const val dogfoodingVersion = "2.0.0-SNAPSHOT.372" const val lib = "$group:tool-base:$version" const val classicCodegen = "$group:classic-codegen:$version" diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt index 10669193e8..fda77e581f 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt @@ -62,13 +62,6 @@ public class ValidationGradlePlugin : LibraryPlugin( } private fun Project.configureValidation() { - repositories { - mavenLocal() - mavenCentral() - maven("https://europe-maven.pkg.dev/spine-event-engine/snapshots") - maven("https://europe-maven.pkg.dev/spine-event-engine/releases") - } - val javaBundle = ValidationSdk.javaCodegenBundle addUserClasspathDependency(javaBundle) afterEvaluate { From db8d55e395d1d197acd493deda67d8f100f4c96e Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:24:54 +0000 Subject: [PATCH 30/35] Update dependency reports --- dependencies.md | 32 ++++++++++++++++---------------- pom.xml | 18 +++++++++--------- 2 files changed, 25 insertions(+), 25 deletions(-) diff --git a/dependencies.md b/dependencies.md index 622435929d..6a98ebcde4 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1139,7 +1139,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -1731,7 +1731,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:34 WET 2026** using +This report was generated on **Mon Feb 23 16:15:10 WET 2026** 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). @@ -1745,7 +1745,7 @@ This report was generated on **Fri Feb 20 18:36:34 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 16 17:09:32 WET 2026** using +This report was generated on **Mon Feb 23 16:15:05 WET 2026** 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). @@ -2841,7 +2841,7 @@ This report was generated on **Mon Feb 16 17:09:32 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -3935,7 +3935,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -4005,7 +4005,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:34 WET 2026** using +This report was generated on **Mon Feb 23 16:15:05 WET 2026** 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). @@ -4845,7 +4845,7 @@ This report was generated on **Fri Feb 20 18:36:34 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -5781,7 +5781,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -6379,7 +6379,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:34 WET 2026** using +This report was generated on **Mon Feb 23 16:15:06 WET 2026** 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). @@ -6897,7 +6897,7 @@ This report was generated on **Fri Feb 20 18:36:34 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -7588,7 +7588,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -8217,7 +8217,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -8889,7 +8889,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -9647,7 +9647,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:35 WET 2026** using +This report was generated on **Mon Feb 23 16:15:07 WET 2026** 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). @@ -9924,7 +9924,7 @@ This report was generated on **Fri Feb 20 18:36:35 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:34 WET 2026** using +This report was generated on **Mon Feb 23 16:15:06 WET 2026** 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). @@ -10282,6 +10282,6 @@ This report was generated on **Fri Feb 20 18:36:34 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Feb 20 18:36:34 WET 2026** using +This report was generated on **Mon Feb 23 16:15:06 WET 2026** 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 81c35af93d..2ae9cabf35 100644 --- a/pom.xml +++ b/pom.xml @@ -74,31 +74,31 @@ all modules and does not describe the project structure per-subproject. io.spine.tools compiler-backend - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 compile io.spine.tools compiler-gradle-api - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 compile io.spine.tools compiler-gradle-plugin - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 compile io.spine.tools compiler-jvm - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 compile io.spine.tools jvm-tools - 2.0.0-SNAPSHOT.371 + 2.0.0-SNAPSHOT.372 compile @@ -176,13 +176,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools compiler-api - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 test io.spine.tools compiler-testlib - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 test @@ -277,12 +277,12 @@ all modules and does not describe the project structure per-subproject. io.spine.tools compiler-cli-all - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 io.spine.tools compiler-protoc-plugin - 2.0.0-SNAPSHOT.038 + 2.0.0-SNAPSHOT.039 io.spine.tools From 7fe07f06c4ab6caa1aa0cd0bbc48ee7c075b15a5 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:25:18 +0000 Subject: [PATCH 31/35] Optimise imports --- .../io/spine/tools/validation/gradle/ValidationGradlePlugin.kt | 2 -- 1 file changed, 2 deletions(-) diff --git a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt index fda77e581f..1ca4baca88 100644 --- a/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt +++ b/gradle-plugin/src/main/kotlin/io/spine/tools/validation/gradle/ValidationGradlePlugin.kt @@ -37,8 +37,6 @@ import io.spine.tools.meta.MavenArtifact import org.gradle.api.Project import org.gradle.api.artifacts.Dependency import org.gradle.kotlin.dsl.apply -import org.gradle.kotlin.dsl.maven -import org.gradle.kotlin.dsl.repositories import io.spine.tools.compiler.gradle.plugin.Plugin as CompilerGradlePlugin /** From d45287ddd63a224ffd0f8f514882f1cdee441678 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:47:56 +0000 Subject: [PATCH 32/35] Remove trailing empty line --- docs/content/docs/validation/01-getting-started/_index.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/content/docs/validation/01-getting-started/_index.md b/docs/content/docs/validation/01-getting-started/_index.md index a207815516..4d817a75d8 100644 --- a/docs/content/docs/validation/01-getting-started/_index.md +++ b/docs/content/docs/validation/01-getting-started/_index.md @@ -48,4 +48,3 @@ the code produced by `protoc`. - [Adding Validation to your build](adding-to-build.md) - [Your first validated model](first-model.md) - From fba8937a44f5098afb63a1e72794f3714efdc057 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:48:04 +0000 Subject: [PATCH 33/35] Update dependency reports --- dependencies.md | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/dependencies.md b/dependencies.md index 6a98ebcde4..0da6c75ab9 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1139,7 +1139,7 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:39 WET 2026** 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). @@ -1731,7 +1731,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:10 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -2841,7 +2841,7 @@ This report was generated on **Mon Feb 23 16:15:05 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -3935,7 +3935,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -4005,7 +4005,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:05 WET 2026** using +This report was generated on **Mon Feb 23 16:36:37 WET 2026** 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). @@ -4845,7 +4845,7 @@ This report was generated on **Mon Feb 23 16:15:05 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -5781,7 +5781,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -6379,7 +6379,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:06 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -6897,7 +6897,7 @@ This report was generated on **Mon Feb 23 16:15:06 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -7588,7 +7588,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -8217,7 +8217,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -8889,7 +8889,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -9647,7 +9647,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:07 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -9924,7 +9924,7 @@ This report was generated on **Mon Feb 23 16:15:07 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:06 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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). @@ -10282,6 +10282,6 @@ This report was generated on **Mon Feb 23 16:15:06 WET 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Feb 23 16:15:06 WET 2026** using +This report was generated on **Mon Feb 23 16:36:38 WET 2026** 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 From 8d5ee6b9bfbec297e0a0655ee3b18dba51431812 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 16:54:10 +0000 Subject: [PATCH 34/35] Make `buildExamples` depend on `updatePluginVersions` --- docs/build.gradle.kts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index ef757349e8..5d8c984a31 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -111,7 +111,7 @@ val buildExamples by tasks.registering(RunGradle::class) { directory = examplesDir task(buildAll) dependsOn(publishAllToMavenLocal) - dependsOn(updateValidationPluginVersion) + dependsOn(updatePluginVersions) } tasks.register(buildAll) { From d24c16cab620b22158584cd90f99bec1be5616f9 Mon Sep 17 00:00:00 2001 From: alexander-yevsyukov Date: Mon, 23 Feb 2026 17:13:45 +0000 Subject: [PATCH 35/35] Fix label spelling --- .../docs/validation/01-getting-started/adding-to-build.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/content/docs/validation/01-getting-started/adding-to-build.md b/docs/content/docs/validation/01-getting-started/adding-to-build.md index 323206aec0..fa17d4d629 100644 --- a/docs/content/docs/validation/01-getting-started/adding-to-build.md +++ b/docs/content/docs/validation/01-getting-started/adding-to-build.md @@ -44,7 +44,7 @@ plugins { > The plugin `module` in the snippet above refers to the name of the script plugin > `buildSrc/src/kotlin/module.gradle.kts` which provides common configuration for > the subprojects of the multi-module examples project. -> For more details on this, clone the [Validation examples repository][valildation-examples]. +> For more details on this, clone the [Validation examples repository][validation-examples]. The plugin wires Validation into Spine Compiler, adds the Validation Java codegen bundle, and brings in the JVM runtime dependency automatically. @@ -67,4 +67,4 @@ plugins { Continue with [Your first validated model](first-model.md). -[valildation-examples]: https://github.com/spine-examples/hello-validation +[validation-examples]: https://github.com/spine-examples/hello-validation