-
Notifications
You must be signed in to change notification settings - Fork 0
Apply new publishing #286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Apply new publishing #286
Changes from all commits
aec2c98
58866ed
86cba79
4787e27
15d1a84
421d98c
1dc11f8
3c12e18
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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. | ||||||
|
|
@@ -26,18 +26,43 @@ | |||||
|
|
||||||
| package io.spine.dependency.local | ||||||
|
|
||||||
| import io.spine.dependency.Dependency | ||||||
|
|
||||||
| /** | ||||||
| * Spine Time library. | ||||||
| * | ||||||
| * @see <a href="https://github.com/SpineEventEngine/time">spine-time</a> | ||||||
| */ | ||||||
| @Suppress("ConstPropertyName") | ||||||
| object Time { | ||||||
| const val version = "2.0.0-SNAPSHOT.232" | ||||||
| const val group = Spine.group | ||||||
| const val artifact = "spine-time" | ||||||
| const val lib = "$group:$artifact:$version" | ||||||
| const val javaExtensions = "$group:$artifact-java:$version" | ||||||
| const val kotlinExtensions = "$group:$artifact-kotlin:$version" | ||||||
| const val testLib = "${Spine.toolsGroup}:spine-time-testlib:$version" | ||||||
| @Suppress( | ||||||
| "unused" /* Some subprojects do not use all Time artifacts. */, | ||||||
| "ConstPropertyName" /* We use custom convention for artifact properties. */, | ||||||
| "MemberVisibilityCanBePrivate" /* The properties are used directly by other subprojects. */, | ||||||
| ) | ||||||
| object Time : Dependency() { | ||||||
| override val group = Spine.group | ||||||
| override val version = "2.0.0-SNAPSHOT.235" | ||||||
| private const val infix = "spine-time" | ||||||
|
|
||||||
| fun lib(version: String): String = "$group:$infix:$version" | ||||||
| val lib get() = lib(version) | ||||||
| const val libArtifact: String = infix | ||||||
|
|
||||||
| fun javaExtensions(version: String): String = "$group:$infix-java:$version" | ||||||
| val javaExtensions get() = javaExtensions(version) | ||||||
|
|
||||||
| fun kotlinExtensions(version: String): String = "$group:$infix-kotlin:$version" | ||||||
| val kotlinExtensions get() = kotlinExtensions(version) | ||||||
|
|
||||||
| fun testLib(version: String): String = "${Spine.toolsGroup}:time-testlib:$version" | ||||||
|
||||||
| fun testLib(version: String): String = "${Spine.toolsGroup}:time-testlib:$version" | |
| fun testLib(version: String): String = "${Spine.toolsGroup}:${infix}-testlib:$version" |
| 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. | ||||||
|
|
@@ -29,6 +29,7 @@ | |||||
| package io.spine.gradle.publish | ||||||
|
|
||||||
| import io.spine.gradle.repo.Repository | ||||||
| import java.util.Locale | ||||||
| import org.gradle.api.Project | ||||||
| import org.gradle.api.publish.maven.plugins.MavenPublishPlugin | ||||||
| import org.gradle.kotlin.dsl.apply | ||||||
|
|
@@ -145,16 +146,18 @@ import org.gradle.kotlin.dsl.findByType | |||||
| * @see [artifacts] | ||||||
| * @see SpinePublishing | ||||||
| */ | ||||||
| fun Project.spinePublishing(block: SpinePublishing.() -> Unit) { | ||||||
| fun Project.spinePublishing(block: SpinePublishing.() -> Unit): SpinePublishing { | ||||||
| apply<MavenPublishPlugin>() | ||||||
| val name = SpinePublishing::class.java.simpleName | ||||||
| .replaceFirstChar { it.lowercase(Locale.getDefault()) } | ||||||
|
||||||
| .replaceFirstChar { it.lowercase(Locale.getDefault()) } | |
| .replaceFirstChar { it.lowercase(Locale.ROOT) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apply toolArtifactPrefix when computing published artifact IDs
This adds toolArtifactPrefix, but the publication path still ignores it: PublicationHandler.copyProjectAttributes() continues to prepend project.spinePublishing.artifactPrefix for every module, and nothing calls SpinePublishing.artifactId(project). In a mixed project, tool modules (group == io.spine.tools) will still be published as spine-validation-* even when toolArtifactPrefix = "validation-", which breaks expected coordinates (for example, pom.xml still references io.spine.tools:validation-java-bundle).
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting the root
artifactPrefixtospine-validation-causesjvm-runtimeto generate a doubled artifact ID becausejvm-runtime/build.gradle.ktsalready doesartifactId = "$defaultPrefix$projectPrefix${project.name}"withdefaultPrefix = "spine-"; this now resolves tospine-spine-validation-jvm-runtime. That will publish runtime under an unexpected coordinate and break consumers expectingspine-validation-jvm-runtime.Useful? React with 👍 / 👎.