Skip to content

Commit 87012df

Browse files
Merge pull request #170 from SpineEventEngine/required-field-errors
Required field errors
2 parents 868284c + 8e31138 commit 87012df

File tree

46 files changed

+720
-281
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+720
-281
lines changed

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
uses: actions/checkout@v4
1717

1818
- name: Validate Gradle Wrapper
19-
uses: gradle/wrapper-validation-action@v1
19+
uses: gradle/actions/wrapper-validation@v4
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
#
2+
# Periodically removes obsolete artifacts from GitHub Packages.
3+
#
4+
# Only non-release artifacts—those containing "SNAPSHOT" in their version name—are eligible
5+
# for removal. The latest non-release artifacts will be retained, with the exact number determined
6+
# by the `VERSION_COUNT_TO_KEEP` environment variable.
7+
#
8+
# Please note the following details:
9+
#
10+
# 1. An artifact cannot be deleted if it is public and has been downloaded more than 5,000 times.
11+
# In this scenario, contact GitHub support for further assistance.
12+
#
13+
# 2. This workflow only applies to artifacts published from this repository.
14+
#
15+
# 3. A maximum of 100 artifacts can be removed per run from each package;
16+
# if there are more than 100 obsolete artifacts, either manually restart the workflow
17+
# or wait for the next scheduled removal.
18+
#
19+
# 4. When artifacts with version `x.x.x-SNAPSHOT` are published, GitHub automatically appends
20+
# the current timestamp, resulting in versions like `x.x.x-SNAPSHOT.20241024.173759`.
21+
# All such artifacts are grouped into one package and treated as a single package
22+
# in GitHub Packages with the version `x.x.x-SNAPSHOT`. Consequently, it is not possible
23+
# to remove obsolete versions within a package; only the entire package can be deleted.
24+
#
25+
26+
name: Remove obsolete Maven artifacts from GitHub Packages
27+
28+
on:
29+
schedule:
30+
- cron: '0 0 * * *' # Run every day at midnight.
31+
32+
env:
33+
VERSION_COUNT_TO_KEEP: 5 # Number of most recent SNAPSHOT versions to retain.
34+
35+
jobs:
36+
retrieve-package-names:
37+
name: Retrieve the package names published from this repository
38+
runs-on: ubuntu-latest
39+
outputs:
40+
package-names: ${{ steps.request-package-names.outputs.package-names }}
41+
steps:
42+
- uses: actions/checkout@v4
43+
with:
44+
submodules: 'true'
45+
46+
- name: Retrieve the names of packages
47+
id: request-package-names
48+
shell: bash
49+
run: |
50+
repoName=$(echo ${{ github.repository }} | cut -d '/' -f2)
51+
chmod +x ./config/scripts/request-package-names.sh
52+
./config/scripts/request-package-names.sh ${{ github.token }} \
53+
$repoName ${{ github.repository_owner }} ./package-names.json
54+
echo "package-names=$(<./package-names.json)" >> $GITHUB_OUTPUT
55+
56+
delete-obsolete-artifacts:
57+
name: Remove obsolete artifacts published from this repository to GitHub Packages
58+
needs: retrieve-package-names
59+
runs-on: ubuntu-latest
60+
strategy:
61+
matrix:
62+
package-name: ${{ fromJson(needs.retrieve-package-names.outputs.package-names) }}
63+
steps:
64+
- name: Remove obsolete artifacts from '${{ matrix.package-name }}' package
65+
uses: actions/delete-package-versions@v5
66+
with:
67+
owner: ${{ github.repository_owner }}
68+
package-name: ${{ matrix.package-name }}
69+
package-type: 'maven'
70+
token: ${{ github.token }}
71+
min-versions-to-keep: ${{ env.VERSION_COUNT_TO_KEEP }}
72+
# Ignores artifacts that do not contain the word "SNAPSHOT".
73+
ignore-versions: '^(?!.+SNAPSHOT).*$'

.idea/inspectionProfiles/Project_Default.xml

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

buildSrc/src/main/kotlin/io/spine/dependency/build/ErrorProne.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
package io.spine.dependency.build
2828

29-
3029
// https://errorprone.info/
3130
@Suppress("unused", "ConstPropertyName")
3231
object ErrorProne {

buildSrc/src/main/kotlin/io/spine/dependency/lib/Auto.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ object AutoServiceKsp {
5353
/**
5454
* The latest version compatible with Kotlin 1.8.22.
5555
*
56-
* @see Ksp.version
56+
* @see io.spine.dependency.build.Ksp.version
5757
*/
5858
private const val version = "1.1.0"
5959
const val processor = "dev.zacsweers.autoservice:auto-service-ksp:$version"

buildSrc/src/main/kotlin/io/spine/dependency/lib/KotlinX.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,9 @@ object KotlinX {
3434
object Coroutines {
3535

3636
// https://github.com/Kotlin/kotlinx.coroutines
37-
const val version = "1.7.3"
37+
const val version = "1.9.0"
3838
const val core = "$group:kotlinx-coroutines-core:$version"
3939
const val jdk8 = "$group:kotlinx-coroutines-jdk8:$version"
40+
const val test = "$group:kotlinx-coroutines-test:$version"
4041
}
4142
}

buildSrc/src/main/kotlin/io/spine/dependency/lib/Log4j2.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ package io.spine.dependency.lib
2929
/**
3030
* An open-source logging framework.
3131
*
32-
* Spine uses its own [logging library][Spine.Logging], but also
32+
* Spine uses its own [logging library][io.spine.dependency.local.Logging], but also
3333
* provides a backend implementation for [Log4j2]. This is why
3434
* this dependency is needed.
3535
*

buildSrc/src/main/kotlin/io/spine/dependency/local/ArtifactVersion.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ object ArtifactVersion {
8080
*
8181
* @see <a href="https://github.com/SpineEventEngine/model-compiler">spine-model-compiler</a>
8282
*/
83+
@Suppress("unused")
8384
@Deprecated(
8485
message = "Please use `ModelCompiler.version` instead.",
8586
ReplaceWith("ModelCompiler.version")

buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJava.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ package io.spine.dependency.local
3434
@Suppress("ConstPropertyName", "unused")
3535
object CoreJava {
3636
const val group = Spine.group
37-
const val version = "2.0.0-SNAPSHOT.182"
37+
const val version = "2.0.0-SNAPSHOT.191"
3838

3939
const val coreArtifact = "spine-core"
4040
const val clientArtifact = "spine-client"

buildSrc/src/main/kotlin/io/spine/dependency/local/Logging.kt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ object Logging {
4646
const val grpcContext = "$group:spine-logging-grpc-context:$version"
4747
const val smokeTest = "$group:spine-logging-smoke-test:$version"
4848

49+
const val testLib = "${Spine.toolsGroup}:spine-logging-testlib:$version"
50+
4951
// Transitive dependencies.
5052
// Make `public` and use them to force a version in a particular repository, if needed.
5153
internal const val julBackend = "$group:spine-logging-jul-backend:$version"

buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ object McJava {
4242
/**
4343
* The version used to in the build classpath.
4444
*/
45-
const val dogfoodingVersion = "2.0.0-SNAPSHOT.258"
45+
const val dogfoodingVersion = "2.0.0-SNAPSHOT.259"
4646

4747
/**
4848
* The version to be used for integration tests.
4949
*/
50-
const val version = "2.0.0-SNAPSHOT.258"
50+
const val version = "2.0.0-SNAPSHOT.259"
5151

5252
/**
5353
* The ID of the Gradle plugin.

buildSrc/src/main/kotlin/io/spine/dependency/local/ToolBase.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ package io.spine.dependency.local
3434
@Suppress("ConstPropertyName", "unused")
3535
object ToolBase {
3636
const val group = Spine.toolsGroup
37-
const val version = "2.0.0-SNAPSHOT.234"
37+
const val version = "2.0.0-SNAPSHOT.240"
3838

3939
const val lib = "$group:spine-tool-base:$version"
4040
const val pluginBase = "$group:spine-plugin-base:$version"

buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ package io.spine.dependency.local
3131
*
3232
* See [`SpineEventEngine/validation`](https://github.com/SpineEventEngine/validation/).
3333
*/
34-
@Suppress("ConstPropertyName")
34+
@Suppress("ConstPropertyName", "unused")
3535
object Validation {
3636
/**
3737
* The version of the Validation library artifacts.
3838
*/
39-
const val version = "2.0.0-SNAPSHOT.176"
39+
const val version = "2.0.0-SNAPSHOT.178"
4040

4141
const val group = "io.spine.validation"
4242
private const val prefix = "spine-validation"

buildSrc/src/main/kotlin/io/spine/gradle/kotlin/KotlinConfig.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,12 @@ fun KotlinJvmProjectExtension.applyJvmToolchain(version: String) =
5353
*/
5454
@Suppress("unused", "MagicNumber" /* Kotlin Compiler version. */)
5555
fun KotlinCompile.setFreeCompilerArgs() {
56-
// Avoid the "unsupported flag warning" for Kotlin compilers pre 1.9.20.
56+
// Avoid the "unsupported flag warning" for Kotlin compilers pre 1.9.20 and after 2.0.0.
5757
// See: https://youtrack.jetbrains.com/issue/KT-61573
58-
val expectActualClasses =
59-
if (KotlinVersion.CURRENT.isAtLeast(1, 9, 20)) "-Xexpect-actual-classes" else ""
58+
val expectActualClasses = KotlinVersion.CURRENT.run {
59+
if (isAtLeast(1, 9, 20) && major < 2) "-Xexpect-actual-classes"
60+
else ""
61+
}
6062
kotlinOptions {
6163
freeCompilerArgs = listOf(
6264
"-Xskip-prerelease-check",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import io.spine.gradle.Repository
3333
*
3434
* There is a special treatment for this repository. Usually, fetching and publishing of artifacts
3535
* is performed via the same URL. But it is not true for CloudRepo. Fetching is performed via
36-
* public repository, and publishing via private one. Their URLs differ in `/public` infix.
36+
* the public repository, and publishing via the private one. Their URLs differ in `/public` infix.
3737
*/
3838
internal object CloudRepo {
3939

buildSrc/src/main/kotlin/jvm-module.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import io.spine.dependency.lib.Guava
3232
import io.spine.dependency.lib.JavaX
3333
import io.spine.dependency.lib.Protobuf
3434
import io.spine.dependency.local.Logging
35-
import io.spine.dependency.local.Spine
35+
import io.spine.dependency.local.Reflect
3636
import io.spine.dependency.local.TestLib
3737
import io.spine.dependency.test.JUnit
3838
import io.spine.dependency.test.Jacoco
@@ -162,7 +162,7 @@ fun Module.forceConfigurations() {
162162
JUnit.bom,
163163
JUnit.runner,
164164
Dokka.BasePlugin.lib,
165-
Spine.reflect
165+
Reflect.lib,
166166
)
167167
}
168168
}

buildSrc/src/main/kotlin/module.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ fun Module.forceConfigurations() {
161161
Logging.libJvm,
162162
Logging.middleware,
163163
CoreJava.server,
164+
CoreJava.testUtilServer,
164165
Validation.runtime,
165166

166167
Jackson.core,

config

Submodule config updated 32 files

0 commit comments

Comments
 (0)