Skip to content

Commit e47025c

Browse files
Merge pull request #179 from SpineEventEngine/fix-publishing
Fix publishing
2 parents 9e3ab10 + c7d72ed commit e47025c

File tree

5 files changed

+56
-32
lines changed

5 files changed

+56
-32
lines changed

buildSrc/src/main/kotlin/io/spine/gradle/publish/CheckVersionIncrement.kt

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,8 @@ open class CheckVersionIncrement : DefaultTask() {
7070
val versions = metadata?.versioning?.versions
7171
val versionExists = versions?.contains(version) ?: false
7272
if (versionExists) {
73-
throw GradleException("""
73+
throw GradleException(
74+
"""
7475
Version `$version` is already published to maven repository `$repoUrl`.
7576
Try incrementing the library version.
7677
All available versions are: ${versions?.joinToString(separator = ", ")}.
@@ -88,13 +89,28 @@ open class CheckVersionIncrement : DefaultTask() {
8889

8990
private fun Project.artifactPath(): String {
9091
val group = this.group as String
91-
val name = "spine-${this.name}"
92+
val name = "${artifactPrefix()}${this.name}"
9293

9394
val pathElements = ArrayList(group.split('.'))
9495
pathElements.add(name)
9596
val path = pathElements.joinToString(separator = "/")
9697
return path
9798
}
99+
100+
/**
101+
* Returns the artifact prefix used for the publishing of this project.
102+
*
103+
* All current Spine modules should be using `SpinePublishing`.
104+
* Therefore, the corresponding extension should be present in the root project.
105+
* However, just in case, we define the "standard" prefix here as well.
106+
*
107+
* This value MUST be the same as defined by the defaults in `SpinePublishing`.
108+
*/
109+
private fun Project.artifactPrefix(): String {
110+
val ext = rootProject.extensions.findByType(SpinePublishing::class.java)
111+
val result = ext?.artifactPrefix ?: SpinePublishing.DEFAULT_PREFIX
112+
return result
113+
}
98114
}
99115

100116
private data class MavenMetadata(var versioning: Versioning = Versioning()) {

buildSrc/src/main/kotlin/io/spine/gradle/publish/SpinePublishing.kt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,14 @@ fun Project.spinePublishing(block: SpinePublishing.() -> Unit) {
137137
*/
138138
open class SpinePublishing(private val project: Project) {
139139

140+
companion object {
141+
142+
/**
143+
* The default prefix added before a module name when publishing artifacts.
144+
*/
145+
const val DEFAULT_PREFIX = "spine-"
146+
}
147+
140148
private val protoJar = ProtoJar()
141149
private val testJar = TestJar()
142150
private val dokkaJar = DokkaJar()

dependencies.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22

3-
# Dependencies of `io.spine.validation:spine-validation-java:2.0.0-SNAPSHOT.182`
3+
# Dependencies of `io.spine.validation:spine-validation-java:2.0.0-SNAPSHOT.183`
44

55
## Runtime
66
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -848,12 +848,12 @@
848848

849849
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
850850

851-
This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
851+
This report was generated on **Sat Jan 04 18:59:50 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
852852

853853

854854

855855

856-
# Dependencies of `io.spine.validation:spine-validation-java-bundle:2.0.0-SNAPSHOT.182`
856+
# Dependencies of `io.spine.validation:spine-validation-java-bundle:2.0.0-SNAPSHOT.183`
857857

858858
## Runtime
859859
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 24.0.1.
@@ -1448,12 +1448,12 @@ This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-Lice
14481448

14491449
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
14501450

1451-
This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
1451+
This report was generated on **Sat Jan 04 18:59:50 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
14521452

14531453

14541454

14551455

1456-
# Dependencies of `io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.182`
1456+
# Dependencies of `io.spine.validation:spine-validation-java-runtime:2.0.0-SNAPSHOT.183`
14571457

14581458
## Runtime
14591459
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -2110,12 +2110,12 @@ This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-Lice
21102110

21112111
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
21122112

2113-
This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
2113+
This report was generated on **Sat Jan 04 18:59:50 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
21142114

21152115

21162116

21172117

2118-
# Dependencies of `io.spine.validation:spine-validation-java-tests:2.0.0-SNAPSHOT.182`
2118+
# Dependencies of `io.spine.validation:spine-validation-java-tests:2.0.0-SNAPSHOT.183`
21192119

21202120
## Runtime
21212121
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -3031,12 +3031,12 @@ This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-Lice
30313031

30323032
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
30333033

3034-
This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
3034+
This report was generated on **Sat Jan 04 18:59:50 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
30353035

30363036

30373037

30383038

3039-
# Dependencies of `io.spine.validation:spine-validation-model:2.0.0-SNAPSHOT.182`
3039+
# Dependencies of `io.spine.validation:spine-validation-model:2.0.0-SNAPSHOT.183`
30403040

30413041
## Runtime
30423042
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -3895,12 +3895,12 @@ This report was generated on **Sat Jan 04 17:50:08 WET 2025** using [Gradle-Lice
38953895

38963896
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
38973897

3898-
This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
3898+
This report was generated on **Sat Jan 04 18:59:51 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
38993899

39003900

39013901

39023902

3903-
# Dependencies of `io.spine.validation:spine-validation-proto:2.0.0-SNAPSHOT.182`
3903+
# Dependencies of `io.spine.validation:spine-validation-proto:2.0.0-SNAPSHOT.183`
39043904

39053905
## Runtime
39063906
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -4785,12 +4785,12 @@ This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-Lice
47854785

47864786
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
47874787

4788-
This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
4788+
This report was generated on **Sat Jan 04 18:59:51 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
47894789

47904790

47914791

47924792

4793-
# Dependencies of `io.spine.validation:spine-validation-consumer:2.0.0-SNAPSHOT.182`
4793+
# Dependencies of `io.spine.validation:spine-validation-consumer:2.0.0-SNAPSHOT.183`
47944794

47954795
## Runtime
47964796
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -5657,12 +5657,12 @@ This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-Lice
56575657

56585658
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
56595659

5660-
This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
5660+
This report was generated on **Sat Jan 04 18:59:51 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
56615661

56625662

56635663

56645664

5665-
# Dependencies of `io.spine.validation:spine-validation-consumer-dependency:2.0.0-SNAPSHOT.182`
5665+
# Dependencies of `io.spine.validation:spine-validation-consumer-dependency:2.0.0-SNAPSHOT.183`
56665666

56675667
## Runtime
56685668
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -6410,12 +6410,12 @@ This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-Lice
64106410

64116411
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
64126412

6413-
This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
6413+
This report was generated on **Sat Jan 04 18:59:51 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
64146414

64156415

64166416

64176417

6418-
# Dependencies of `io.spine.validation:spine-validation-extensions:2.0.0-SNAPSHOT.182`
6418+
# Dependencies of `io.spine.validation:spine-validation-extensions:2.0.0-SNAPSHOT.183`
64196419

64206420
## Runtime
64216421
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -7308,12 +7308,12 @@ This report was generated on **Sat Jan 04 17:50:09 WET 2025** using [Gradle-Lice
73087308

73097309
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
73107310

7311-
This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
7311+
This report was generated on **Sat Jan 04 18:59:52 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
73127312

73137313

73147314

73157315

7316-
# Dependencies of `io.spine.validation:spine-validation-runtime:2.0.0-SNAPSHOT.182`
7316+
# Dependencies of `io.spine.validation:spine-validation-runtime:2.0.0-SNAPSHOT.183`
73177317

73187318
## Runtime
73197319
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -8064,12 +8064,12 @@ This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-Lice
80648064

80658065
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
80668066

8067-
This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
8067+
This report was generated on **Sat Jan 04 18:59:52 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
80688068

80698069

80708070

80718071

8072-
# Dependencies of `io.spine.validation:spine-validation-validating:2.0.0-SNAPSHOT.182`
8072+
# Dependencies of `io.spine.validation:spine-validation-validating:2.0.0-SNAPSHOT.183`
80738073

80748074
## Runtime
80758075
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -8824,12 +8824,12 @@ This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-Lice
88248824

88258825
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
88268826

8827-
This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
8827+
This report was generated on **Sat Jan 04 18:59:52 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
88288828

88298829

88308830

88318831

8832-
# Dependencies of `io.spine.validation:spine-validation-vanilla:2.0.0-SNAPSHOT.182`
8832+
# Dependencies of `io.spine.validation:spine-validation-vanilla:2.0.0-SNAPSHOT.183`
88338833

88348834
## Runtime
88358835
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
@@ -9575,12 +9575,12 @@ This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-Lice
95759575

95769576
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
95779577

9578-
This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
9578+
This report was generated on **Sat Jan 04 18:59:53 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
95799579

95809580

95819581

95829582

9583-
# Dependencies of `io.spine.validation:spine-validation-configuration:2.0.0-SNAPSHOT.182`
9583+
# Dependencies of `io.spine.validation:spine-validation-configuration:2.0.0-SNAPSHOT.183`
95849584

95859585
## Runtime
95869586
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -10449,12 +10449,12 @@ This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-Lice
1044910449

1045010450
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1045110451

10452-
This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
10452+
This report was generated on **Sat Jan 04 18:59:53 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
1045310453

1045410454

1045510455

1045610456

10457-
# Dependencies of `io.spine.validation:spine-validation-context:2.0.0-SNAPSHOT.182`
10457+
# Dependencies of `io.spine.validation:spine-validation-context:2.0.0-SNAPSHOT.183`
1045810458

1045910459
## Runtime
1046010460
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3.
@@ -11323,4 +11323,4 @@ This report was generated on **Sat Jan 04 17:50:10 WET 2025** using [Gradle-Lice
1132311323

1132411324
The dependencies distributed under several licenses, are used according their commercial-use-friendly license.
1132511325

11326-
This report was generated on **Sat Jan 04 17:50:11 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
11326+
This report was generated on **Sat Jan 04 18:59:53 WET 2025** using [Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under [Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject.
1010
-->
1111
<groupId>io.spine.validation</groupId>
1212
<artifactId>validation</artifactId>
13-
<version>2.0.0-SNAPSHOT.182</version>
13+
<version>2.0.0-SNAPSHOT.183</version>
1414

1515
<inceptionYear>2015</inceptionYear>
1616

version.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,4 +29,4 @@
2929
*
3030
* For Spine-based dependencies please see [io.spine.dependency.local.Spine].
3131
*/
32-
val validationVersion by extra("2.0.0-SNAPSHOT.182")
32+
val validationVersion by extra("2.0.0-SNAPSHOT.183")

0 commit comments

Comments
 (0)