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
6 changes: 5 additions & 1 deletion .claude/settings.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"plansDirectory": ".claude/plans",
"permissions": {
"allow": [
"Edit(version.gradle.kts)",
Expand Down Expand Up @@ -32,8 +33,11 @@
"Bash(mkdir:*)",
"Bash(touch:*)",
"Bash(python3 .agents/skills/update-copyright/scripts/update_copyright.py:*)",
"Bash(.agents/skills/version-bumped/scripts/version-bumped.sh)",
"Bash(./config/pull)",
"Bash(./config/migrate)"
"Bash(./config/migrate)",
"Skill(pre-pr)",
"Skill(pre-pr:*)"
],
"deny": [
"Bash(git reset --hard:*)",
Expand Down
13 changes: 11 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@
.idea/modules
.idea/shelf

# `.idea/misc.xml` is intentionally NOT re-included below. It is project-local —
# it holds the per-project JDK name and IDEA's own churn (entry-point list
# indices, external-storage toggles) — so `.idea/*.xml` above keeps it ignored.
# `./config/pull` (via `migrate`) untracks any copy an earlier pull committed.

# Do not ignore the following IDEA settings
!.idea/misc.xml
!.idea/codeStyleSettings.xml
!.idea/codeStyles/
!.idea/copyright/
Expand Down Expand Up @@ -173,6 +177,12 @@ __pycache__/

# Claude working files
/.claude/worktrees/
# Ephemeral plan-mode scratch (durable task docs live in `.agents/tasks/`).
/.claude/plans/

# Personal, per-developer Claude Code settings overrides (never committed;
# the distributed `.claude/settings.json` is the shared, committed layer).
/.claude/settings.local.json

# Auto-downloaded Lychee binary used by the `check-links` skill.
/.agents/skills/check-links/.cache/
Expand All @@ -190,7 +200,6 @@ docs/_preview/resources/
# <<< shared config <<<

# >>> repo-local entries (preserved across ./config/pull) >>>
!.idea/misc.xml
!.idea/codeStyleSettings.xml
!.idea/codeStyles/
!.idea/copyright/
Expand Down
44 changes: 0 additions & 44 deletions .idea/misc.xml

This file was deleted.

52 changes: 26 additions & 26 deletions base/src/main/kotlin/io/spine/compare/ComparatorRegistry.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,18 @@ public object ComparatorRegistry {
map[clazz] = comparator
}

/**
* Registers a [comparator] for the specified type [T].
*
* The method overrides the previously set comparator, if any.
*/
public inline fun <reified T : Any> register(comparator: Comparator<T>): Unit =
register(T::class.java, comparator)

/**
* Returns a comparator for the given [clazz].
*
* @throws IllegalStateException if there is no a comparator for the given [clazz].
* @throws IllegalStateException if there is no comparator for the given [clazz].
*/
@JvmStatic
@Suppress("UNCHECKED_CAST") // Type safety is enforced by `register()` method signature.
Expand All @@ -65,19 +73,36 @@ public object ComparatorRegistry {
return map[clazz]!! as Comparator<T>
}

/**
* Returns a comparator for the specified type [T].
*
* @throws IllegalStateException if there is no comparator for the type [T].
*/
public inline fun <reified T : Any> get(): Comparator<T> = get(T::class.java)

/**
* Returns a comparator for the given [clazz], if any.
*/
@JvmStatic
@Suppress("UNCHECKED_CAST") // Type safety is enforced by `register()` method signature.
public fun <T> find(clazz: Class<T>): Comparator<T>? = map[clazz] as Comparator<T>?

/**
* Returns a comparator for the specified type [T], if any.
*/
public inline fun <reified T : Any> find(): Comparator<T>? = find(T::class.java)

/**
* Tells whether the registry has a comparator for the given [clazz].
*/
@JvmStatic
public fun contains(clazz: Class<*>): Boolean = map.containsKey(clazz)

/**
* Tells whether the registry has a comparator for the specified type [T].
*/
public inline fun <reified T : Any> contains(): Boolean = contains(T::class.java)

/**
* Returns the types for which comparators are currently registered.
*
Expand All @@ -92,28 +117,3 @@ public object ComparatorRegistry {
.forEach { it.registerIn(this) }
}
}

/**
* Tells whether the registry has a comparator for the specified type [T].
*/
public inline fun <reified T : Any> ComparatorRegistry.contains(): Boolean = contains(T::class.java)

/**
* Returns a comparator for the specified type [T], if any.
*/
public inline fun <reified T : Any> ComparatorRegistry.find(): Comparator<T>? = find(T::class.java)

/**
* Returns a comparator for the specified type [T].
*
* @throws IllegalStateException if there is no a comparator for the type [T].
*/
public inline fun <reified T : Any> ComparatorRegistry.get(): Comparator<T> = get(T::class.java)

/**
* Registers a [comparator] for the specified type [T].
*
* The method overrides the previously set comparator, if any.
*/
public inline fun <reified T> ComparatorRegistry.register(comparator: Comparator<T>): Unit =
register(T::class.java, comparator)
30 changes: 15 additions & 15 deletions base/src/main/kotlin/io/spine/string/Indent.kt
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,21 @@ public data class Indent(
*/
override fun toString(): String = value

/**
* Repeats this indentation [n] times.
*
* @throws [IllegalArgumentException] when [n] < 0.
*/
public fun repeat(n: Int): String {
Comment thread
alexander-yevsyukov marked this conversation as resolved.
require(n >= 0) { "Count `n` must be non-negative, but was $n."}
return value.repeat(n)
}

/**
* Same as [repeat].
*/
public fun atLevel(n: Int): String = repeat(n)

public companion object {

/**
Expand Down Expand Up @@ -88,18 +103,3 @@ public data class Indent(
}
}
}

/**
* Repeats this indentation [n] times.
*
* @throws [IllegalArgumentException] when [n] < 0.
*/
public fun Indent.repeat(n: Int): String {
require(size >= 0) { "Count `n` must be non-negative, but was $size."}
return value.repeat(n)
}

/**
* Same as [repeat].
*/
public fun Indent.atLevel(l: Int): String = repeat(l)
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,13 @@ package io.spine.dependency.build
// https://errorprone.info/
@Suppress("unused", "ConstPropertyName")
object ErrorProne {
// https://github.com/google/error-prone
private const val version = "2.36.0"
/**
* This is the last version which is compatible with Java 17.
*
* The version 2.43.0 requires JDK 21.
* https://github.com/google/error-prone/releases/tag/v2.43.0
*/
private const val version = "2.42.0"

const val group = "com.google.errorprone"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import io.spine.dependency.DependencyWithBom
@Suppress("unused")
object Jackson : DependencyWithBom() {
override val group = "com.fasterxml.jackson"
override val version = "2.22.0"
override val version = "2.22.1"

// https://github.com/FasterXML/jackson-annotations?tab=readme-ov-file#release-notes
const val annotationsVersion = "2.22"
Expand Down
4 changes: 2 additions & 2 deletions buildSrc/src/main/kotlin/io/spine/dependency/local/Base.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ package io.spine.dependency.local
*/
@Suppress("ConstPropertyName", "unused")
object Base {
const val version = "2.0.0-SNAPSHOT.421"
const val versionForBuildScript = "2.0.0-SNAPSHOT.421"
const val version = "2.0.0-SNAPSHOT.423"
const val versionForBuildScript = "2.0.0-SNAPSHOT.423"
const val group = Spine.group
private const val prefix = "spine"
const val libModule = "$prefix-base"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ object Compiler : Dependency() {
* The version of the Compiler dependencies.
*/
override val version: String
private const val fallbackVersion = "2.0.0-SNAPSHOT.059"
private const val fallbackVersion = "2.0.0-SNAPSHOT.061"

/**
* The distinct version of the Compiler used by other build tools.
Expand All @@ -81,7 +81,7 @@ object Compiler : Dependency() {
* transitive dependencies, this is the version used to build the project itself.
*/
val dogfoodingVersion: String
private const val fallbackDfVersion = "2.0.0-SNAPSHOT.059"
private const val fallbackDfVersion = "2.0.0-SNAPSHOT.061"

/**
* The artifact for the Compiler Gradle plugin.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ typealias CoreJava = CoreJvm
@Suppress("ConstPropertyName", "unused")
object CoreJvm {
const val group = Spine.group
const val version = "2.0.0-SNAPSHOT.381"
const val version = "2.0.0-SNAPSHOT.420"

const val coreArtifact = "spine-core"
const val clientArtifact = "spine-client"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package io.spine.dependency.local
*/
@Suppress("ConstPropertyName", "unused")
object Logging {
const val version = "2.0.0-SNAPSHOT.419"
const val version = "2.0.0-SNAPSHOT.422"
const val group = Spine.group

const val loggingArtifact = "spine-logging"
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import io.spine.dependency.Dependency
)
object Time : Dependency() {
override val group = Spine.group
override val version = "2.0.0-SNAPSHOT.242"
override val version = "2.0.0-SNAPSHOT.244"
private const val infix = "spine-time"

fun lib(version: String): String = "$group:$infix:$version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ package io.spine.dependency.local
@Suppress("ConstPropertyName", "unused")
object ToolBase {
const val group = Spine.toolsGroup
const val version = "2.0.0-SNAPSHOT.402"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.402"
const val version = "2.0.0-SNAPSHOT.403"
const val dogfoodingVersion = "2.0.0-SNAPSHOT.403"

const val lib = "$group:tool-base:$version"
const val classicCodegen = "$group:classic-codegen:$version"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ object Validation {
/**
* The version of the Validation library artifacts.
*/
const val version = "2.0.0-SNAPSHOT.446"
const val version = "2.0.0-SNAPSHOT.450"

const val group = Spine.toolsGroup
private const val prefix = "validation"
Expand Down
8 changes: 8 additions & 0 deletions buildSrc/src/main/kotlin/io/spine/dependency/test/Jacoco.kt
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,12 @@ package io.spine.dependency.test
@Suppress("ConstPropertyName")
object Jacoco {
const val version = "0.8.15"

/**
* The Maven coordinates of the standalone JaCoCo agent JAR (the `runtime`
* classifier), attached via `-javaagent:` to forked JVMs — Gradle TestKit
* workers and the Spine Compiler process — so their execution is credited
* to coverage.
*/
const val agent = "org.jacoco:org.jacoco.agent:$version:runtime"
}
Loading
Loading