diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt b/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt index deda203638..afccc24b53 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt @@ -1,5 +1,5 @@ /* - * Copyright 2025, TeamDev. All rights reserved. + * 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. @@ -36,10 +36,6 @@ import org.gradle.api.tasks.SourceSetContainer import org.gradle.kotlin.dsl.findByType import org.gradle.kotlin.dsl.getByType -/** - * This file contains extension methods and properties for the Gradle `Project`. - */ - /** * Logs the result of the function using the project logger at `INFO` level. */ @@ -86,8 +82,9 @@ fun Project.getTask(name: String): T { /** * Obtains Maven artifact ID of this [Project]. * - * The method checks if [SpinePublishing] extension is configured upon this project. If yes, - * returns [SpinePublishing.artifactId] for the project. Otherwise, a project's name is returned. + * The property getter checks if [SpinePublishing] extension is configured upon this project. + * If yes, it returns [SpinePublishing.artifactId] for the project. + * Otherwise, a project's name is returned. */ val Project.artifactId: String get() { diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt index 5b3bbe1290..8a212b7ca4 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/PublicationHandler.kt @@ -27,6 +27,7 @@ package io.spine.gradle.publish import LicenseSettings +import io.spine.gradle.artifactId import io.spine.gradle.isSnapshot import io.spine.gradle.repo.Repository import io.spine.gradle.report.pom.InceptionYear @@ -125,26 +126,27 @@ sealed class PublicationHandler( } /** - * Copies the attributes of Gradle [Project] to this [MavenPublication]. + * Copies the attributes of the [project] to this [MavenPublication]. * * The following project attributes are copied: * * [group][Project.getGroup]; * * [version][Project.getVersion]; * * [description][Project.getDescription]. * - * Also, this function adds the [artifactPrefix][SpinePublishing.artifactPrefix] to - * the [artifactId][MavenPublication.setArtifactId] of this publication, - * if the prefix is not added yet. + * The [artifactId] of the publication is copied from the project + * [extension property][io.spine.gradle.artifactId] of the same name. * - * Finally, the Apache Software License 2.0 is set as the only license - * under which the published artifact is distributed. + * The Apache Software License 2.0 is set as the only license + * under which the published artifact is distributed via [LicenseSettings] + * + * The source control management attributes are obtained from [DocumentationSettings]. + * + * @see LicenseSettings + * @see DocumentationSettings */ protected fun MavenPublication.copyProjectAttributes() { groupId = project.group.toString() - val prefix = project.spinePublishing.artifactPrefix - if (!artifactId.startsWith(prefix)) { - artifactId = prefix + artifactId - } + artifactId = project.artifactId version = project.version.toString() pom.description.set(project.description) pom.inceptionYear.set(InceptionYear.value) diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt index 37fdf5f7db..c065198e92 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt @@ -415,18 +415,23 @@ open class SpinePublishing(private val project: Project) { * @see toolArtifactPrefix */ fun artifactId(project: Project): String { - if (project.isTool) { + val result = if (project.isTool) { check(!toolArtifactPrefix.isEmpty()) { "Artifact prefix cannot be empty for tool modules. " + "Please set the `toolArtifactPrefix` property in `spinePublishing`. " + "Use `\"NONE\"` to have an empty prefix for tool modules." } val prefix = - if (toolArtifactPrefix == NONE_PREFIX) { "" } - else { toolArtifactPrefix } - return "$prefix${project.name}" + if (toolArtifactPrefix == NONE_PREFIX) { + "" + } else { + toolArtifactPrefix + } + "$prefix${project.name}" + } else { + "$artifactPrefix${project.name}" } - return "$artifactPrefix${project.name}" + return result } private val Project.isTool: Boolean diff --git a/config b/config index dfc4f6db3f..688b3c7924 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit dfc4f6db3f25e0eddbf640e148c3cb2d3a3795b1 +Subproject commit 688b3c792415f3abc532fb6e4e2b030781b6fff2 diff --git a/dependencies.md b/dependencies.md index fe0f5fafff..b4ae29fbfa 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.410` +# Dependencies of `io.spine.tools:validation-context:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1114,14 +1114,14 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:06 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-context-tests:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -1718,28 +1718,28 @@ This report was generated on **Fri Apr 03 17:45:06 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-docs:2.0.0-SNAPSHOT.411` ## Runtime ## Compile, tests, and tooling The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:01 WEST 2026** using +This report was generated on **Fri Apr 03 20:14:11 WEST 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.410` +# Dependencies of `io.spine.tools:validation-gradle-plugin:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -2791,14 +2791,14 @@ This report was generated on **Fri Apr 03 17:45:01 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:04 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-java:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -3844,14 +3844,14 @@ This report was generated on **Fri Apr 03 17:45:04 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:04 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-java-bundle:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0. @@ -3898,14 +3898,14 @@ This report was generated on **Fri Apr 03 17:45:04 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:01 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.410` +# Dependencies of `io.spine:spine-validation-jvm-runtime:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -4705,14 +4705,14 @@ This report was generated on **Fri Apr 03 17:45:01 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-consumer:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -5295,14 +5295,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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.410` +# Dependencies of `io.spine.tools:validation-consumer-dependency:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -5780,14 +5780,14 @@ This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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.410` +# Dependencies of `io.spine.tools:validation-extensions:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -6424,14 +6424,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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.410` +# Dependencies of `io.spine.tools:validation-runtime:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7016,14 +7016,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-validating:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7647,14 +7647,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:16 WEST 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.410` +# Dependencies of `io.spine.tools:validation-validator:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.20.0. @@ -8390,14 +8390,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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.410` +# Dependencies of `io.spine.tools:validation-validator-dependency:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8630,14 +8630,14 @@ This report was generated on **Fri Apr 03 17:45:03 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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.410` +# Dependencies of `io.spine.tools:validation-vanilla:2.0.0-SNAPSHOT.411` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8980,6 +8980,6 @@ This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Fri Apr 03 17:45:02 WEST 2026** using +This report was generated on **Fri Apr 03 20:20:15 WEST 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/docs/_examples b/docs/_examples index 4ce8b4d494..23bc23c580 160000 --- a/docs/_examples +++ b/docs/_examples @@ -1 +1 @@ -Subproject commit 4ce8b4d494aae795a93887cfb6e71ccc982fec1a +Subproject commit 23bc23c5805875648eb578e0a3f9fa15421645e7 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 7e5ebe8778..5e0a0360b9 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 @@ -90,7 +90,7 @@ Add the Validation plugin to the build. ```kotlin plugins { module - id("io.spine.validation") version "2.0.0-SNAPSHOT.410" + id("io.spine.validation") version "2.0.0-SNAPSHOT.411" } ``` diff --git a/gradle-plugin/build.gradle.kts b/gradle-plugin/build.gradle.kts index 4aa6ff2185..d7fa7c5308 100644 --- a/gradle-plugin/build.gradle.kts +++ b/gradle-plugin/build.gradle.kts @@ -28,7 +28,7 @@ import io.spine.dependency.lib.Protobuf import io.spine.dependency.local.Compiler import io.spine.dependency.local.ToolBase import io.spine.dependency.local.Validation -import io.spine.gradle.publish.SpinePublishing +import io.spine.gradle.artifactId import io.spine.gradle.publish.addSourceAndDocJars plugins { @@ -93,10 +93,7 @@ afterEvaluate { publishing { publications { named("pluginMaven") { - val rootExtension = rootProject.the() - val projectPrefix = rootExtension.artifactPrefix - artifactId = "$projectPrefix${project.name}" - + artifactId = project.artifactId addSourceAndDocJars(project) } } diff --git a/jvm-runtime/build.gradle.kts b/jvm-runtime/build.gradle.kts index 2c2166cc06..bc32b01216 100644 --- a/jvm-runtime/build.gradle.kts +++ b/jvm-runtime/build.gradle.kts @@ -73,18 +73,3 @@ dependencies { } forceSpineBase() - -// Change the `artifactId` to have the `spine-validation-` prefix -// instead of just `validation-` as for the rest of the tool modules. -afterEvaluate { - publishing { - publications { - named(StandardJavaPublicationHandler.PUBLICATION_NAME) { - val rootExtension = rootProject.the() - val defaultPrefix = SpinePublishing.DEFAULT_PREFIX - val projectPrefix = rootExtension.artifactPrefix - artifactId = "$defaultPrefix$projectPrefix${project.name}" - } - } - } -} diff --git a/pom.xml b/pom.xml index 248febda6b..ead17781ce 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.410 +2.0.0-SNAPSHOT.411 2015 diff --git a/version.gradle.kts b/version.gradle.kts index d8860bdb28..e17cb6129a 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.410") +val validationVersion by extra("2.0.0-SNAPSHOT.411")