Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions buildSrc/src/main/kotlin/io/spine/gradle/ProjectExtensions.kt
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
*/
Expand Down Expand Up @@ -86,8 +82,9 @@ fun <T : Task> 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() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
60 changes: 30 additions & 30 deletions dependencies.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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).
2 changes: 1 addition & 1 deletion docs/_examples
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

Expand Down
7 changes: 2 additions & 5 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -93,10 +93,7 @@ afterEvaluate {
publishing {
publications {
named<MavenPublication>("pluginMaven") {
val rootExtension = rootProject.the<SpinePublishing>()
val projectPrefix = rootExtension.artifactPrefix
artifactId = "$projectPrefix${project.name}"

artifactId = project.artifactId
addSourceAndDocJars(project)
}
}
Expand Down
Loading
Loading