diff --git a/.claude/settings.json b/.claude/settings.json
index 357650cf7..3c7da68c3 100644
--- a/.claude/settings.json
+++ b/.claude/settings.json
@@ -1,5 +1,6 @@
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
+ "plansDirectory": ".claude/plans",
"permissions": {
"allow": [
"Edit(version.gradle.kts)",
@@ -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:*)",
diff --git a/.gitignore b/.gitignore
index dfb4774d4..ed1b0baa7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -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/
@@ -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/
@@ -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/
diff --git a/.idea/kotlinc.xml b/.idea/kotlinc.xml
index 85d8f5503..5486b312c 100644
--- a/.idea/kotlinc.xml
+++ b/.idea/kotlinc.xml
@@ -3,6 +3,10 @@
+
+
+
+
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index 264f82301..000000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/buildSrc/quality/checkstyle-suppressions.xml b/buildSrc/quality/checkstyle-suppressions.xml
index a761fca35..9d169de7f 100644
--- a/buildSrc/quality/checkstyle-suppressions.xml
+++ b/buildSrc/quality/checkstyle-suppressions.xml
@@ -1,7 +1,7 @@
io.spine.toolstool-base
-2.0.0-SNAPSHOT.403
+2.0.0-SNAPSHOT.4042015
@@ -26,7 +26,7 @@ all modules and does not describe the project structure per-subproject.
com.fasterxml.jackson.dataformatjackson-dataformat-yaml
- 2.22.0
+ 2.22.1compile
@@ -176,13 +176,13 @@ all modules and does not describe the project structure per-subproject.
io.spinespine-base
- 2.0.0-SNAPSHOT.421
+ 2.0.0-SNAPSHOT.425compileio.spinespine-logging
- 2.0.0-SNAPSHOT.419
+ 2.0.0-SNAPSHOT.422compile
@@ -254,13 +254,13 @@ all modules and does not describe the project structure per-subproject.
com.google.errorproneerror_prone_annotations
- 2.36.0
+ 2.47.0providedcom.google.errorproneerror_prone_type_annotations
- 2.36.0
+ 2.42.0provided
@@ -344,7 +344,7 @@ all modules and does not describe the project structure per-subproject.
com.google.errorproneerror_prone_core
- 2.36.0
+ 2.42.0com.google.protobuf
diff --git a/gradle-root-plugin/build.gradle.kts b/gradle-root-plugin/build.gradle.kts
index e0aa71ab2..b1993e4f3 100644
--- a/gradle-root-plugin/build.gradle.kts
+++ b/gradle-root-plugin/build.gradle.kts
@@ -40,7 +40,7 @@ plugins {
enableTestKitCoverage()
// As defined in `versions.gradle.kts`.
-val versionToPublish: String by extra
+val versionToPublish = extra["versionToPublish"] as String
publishing.publications.withType().all {
groupId = "io.spine.tools"
@@ -51,12 +51,11 @@ publishing.publications.withType().all {
// Do not publish to Gradle Plugin Portal snapshot versions.
// It is prohibited by their policy: https://plugins.gradle.org/docs/publish-plugin
-val publishPlugins: Task by tasks.getting {
+val publishPlugins = tasks.getByName("publishPlugins") {
enabled = !versionToPublish.isSnapshot()
}
-@Suppress("unused")
-val publish: Task by tasks.getting {
+tasks.getByName("publish") {
dependsOn(publishPlugins)
}
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index df6a6ad76..a9db11550 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.1-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
diff --git a/gradlew b/gradlew
index b9bb139f7..249efbb03 100755
--- a/gradlew
+++ b/gradlew
@@ -20,7 +20,7 @@
##############################################################################
#
-# Gradle start up script for POSIX generated by Gradle.
+# gradlew start up script for POSIX generated by Gradle.
#
# Important for running:
#
@@ -29,7 +29,7 @@
# bash, then to run this script, type that shell name before the whole
# command line, like:
#
-# ksh Gradle
+# ksh gradlew
#
# Busybox and similar reduced shells will NOT work, because this script
# requires all of these POSIX shell features:
diff --git a/gradlew.bat b/gradlew.bat
index 24c62d56f..a51ec4f58 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -19,7 +19,7 @@
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
-@rem Gradle startup script for Windows
+@rem gradlew startup script for Windows
@rem
@rem ##########################################################################
@@ -72,7 +72,7 @@ echo location of your Java installation. 1>&2
-@rem Execute Gradle
+@rem Execute gradlew
@rem endlocal doesn't take effect until after the line is parsed and variables are expanded
@rem which allows us to clear the local environment before executing the java command
endlocal & "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* & call :exitWithErrorLevel
diff --git a/jvm-tool-plugins/build.gradle.kts b/jvm-tool-plugins/build.gradle.kts
index c69cf64a9..1e8953621 100644
--- a/jvm-tool-plugins/build.gradle.kts
+++ b/jvm-tool-plugins/build.gradle.kts
@@ -43,7 +43,7 @@ LicenseReporter.generateReportIn(project)
enableTestKitCoverage()
// As defined in `versions.gradle.kts`.
-val versionToPublish: String by extra
+val versionToPublish = extra["versionToPublish"] as String
description = "Utilities for working with JVM projects under Gradle."
@@ -62,12 +62,11 @@ publishing.publications.withType().configureEach {
// Do not publish to Gradle Plugin Portal snapshot versions.
// It is prohibited by their policy: https://plugins.gradle.org/docs/publish-plugin
-val publishPlugins: Task by tasks.getting {
+val publishPlugins = tasks.getByName("publishPlugins") {
enabled = !versionToPublish.isSnapshot()
}
-@Suppress("unused")
-val publish: Task by tasks.getting {
+tasks.getByName("publish") {
dependsOn(publishPlugins)
}
diff --git a/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/ArtifactMetaPlugin.kt b/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/ArtifactMetaPlugin.kt
index 0ba3438ea..8f863bbcb 100644
--- a/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/ArtifactMetaPlugin.kt
+++ b/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/ArtifactMetaPlugin.kt
@@ -32,8 +32,10 @@ import io.spine.tools.gradle.jvm.plugin.WriteArtifactMeta.Companion.TASK_NAME
import io.spine.tools.gradle.task.JavaTaskName.Companion.processResources
import io.spine.tools.gradle.task.JavaTaskName.Companion.sourcesJar
import io.spine.tools.gradle.task.SpineTaskGroup
+import io.spine.tools.meta.MavenArtifact
import org.gradle.api.Plugin
import org.gradle.api.Project
+import org.gradle.api.artifacts.Dependency
import org.gradle.api.plugins.JavaPluginExtension
import org.gradle.kotlin.dsl.getByType
import org.gradle.kotlin.dsl.register
@@ -161,6 +163,14 @@ public class ArtifactMetaPlugin : Plugin {
task.description =
"Writes artifact metadata under `META-INF/io.spine` of the resources"
task.outputDirectory.convention(outputDir)
+
+ // Snapshot the project state the task needs at configuration time, so that
+ // its action does not access `Task.project` during execution. See the
+ // `Task.project` deprecation: it is incompatible with the configuration cache.
+ task.artifactGroup.set(project.provider { project.group.toString() })
+ task.artifactId.set(ext.artifactId)
+ task.artifactVersion.set(project.provider { project.version.toString() })
+ task.dependencyCoordinates.set(project.provider { collectCoordinates(project, ext) })
}
tasks.named(processResources.value()).configure {
@@ -199,3 +209,46 @@ public class ArtifactMetaPlugin : Plugin {
const val WORKING_DIR = "spine/artifact-meta"
}
}
+
+/**
+ * Collects Maven coordinates of the dependencies to be written into the metadata.
+ *
+ * Reads the project configurations — honoring the exclusions configured via the
+ * [`artifactMeta`][ArtifactMetaExtension] extension — and merges the explicitly declared
+ * dependency notations. Invoked from a provider so that the project is read at
+ * configuration time (or when the task input is finalized) rather than from the task action.
+ */
+private fun collectCoordinates(project: Project, ext: ArtifactMetaExtension): Set {
+ val excludedByName = ext.excludeConfigurations.named.orNull ?: emptySet()
+ val excludedBySubstring = ext.excludeConfigurations.containing.orNull ?: emptySet()
+
+ // Collect from configurations (according to exclusions).
+ val coordinates = project.configurations
+ .asSequence()
+ .filter { it.name !in excludedByName }
+ .filter { configuration ->
+ val lower = configuration.name.lowercase()
+ excludedBySubstring.none { sub -> lower.contains(sub.lowercase()) }
+ }
+ .flatMap { it.dependencies }
+ .mapNotNull { it.toMavenArtifact()?.coordinates }
+ .toMutableSet()
+
+ // Add explicitly declared dependencies from the extension.
+ coordinates.addAll(ext.explicitDependencies.orNull ?: emptySet())
+ return coordinates
+}
+
+/**
+ * Creates a [MavenArtifact] from a Gradle [Dependency].
+ *
+ * The `null` checks filter out dependencies that do not have a `group` or a `version`
+ * attribute available, which is a safety feature for the dynamic Gradle environment.
+ * The dependencies of our interest have the required attributes.
+ */
+@Suppress("ReturnCount")
+private fun Dependency.toMavenArtifact(): MavenArtifact? {
+ val group = this.group ?: return null
+ val version = this.version ?: return null
+ return MavenArtifact(group, this.name, version)
+}
diff --git a/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/WriteArtifactMeta.kt b/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/WriteArtifactMeta.kt
index 611fbddd5..1bda0f776 100644
--- a/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/WriteArtifactMeta.kt
+++ b/jvm-tool-plugins/src/main/kotlin/io/spine/tools/gradle/jvm/plugin/WriteArtifactMeta.kt
@@ -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.
@@ -31,8 +31,10 @@ import io.spine.tools.meta.Dependencies
import io.spine.tools.meta.MavenArtifact
import io.spine.tools.meta.Module
import org.gradle.api.DefaultTask
-import org.gradle.api.artifacts.Dependency
import org.gradle.api.file.DirectoryProperty
+import org.gradle.api.provider.Property
+import org.gradle.api.provider.SetProperty
+import org.gradle.api.tasks.Input
import org.gradle.api.tasks.OutputDirectory
import org.gradle.api.tasks.TaskAction
import org.gradle.work.DisableCachingByDefault
@@ -63,19 +65,46 @@ public abstract class WriteArtifactMeta : DefaultTask() {
public abstract val outputDirectory: DirectoryProperty
/**
- * Writes the dependencies of the project to a file.
+ * The Maven group of the project being described.
+ */
+ @get:Input
+ public abstract val artifactGroup: Property
+
+ /**
+ * The artifact ID of the project being described.
+ *
+ * Defaults to the project name unless overridden via the
+ * [`artifactMeta`][ArtifactMetaExtension] extension.
+ */
+ @get:Input
+ public abstract val artifactId: Property
+
+ /**
+ * The version of the project being described.
+ */
+ @get:Input
+ public abstract val artifactVersion: Property
+
+ /**
+ * Maven coordinates of the dependencies to be written into the metadata.
+ *
+ * These are collected from the project configurations and the explicitly
+ * declared dependencies at configuration time by [ArtifactMetaPlugin], so
+ * that the task action does not access the project during execution.
+ */
+ @get:Input
+ public abstract val dependencyCoordinates: SetProperty
+
+ /**
+ * Writes the metadata of the project to a file.
*/
@TaskAction
public fun writeFile() {
outputDirectory.finalizeValue()
- val group = project.group.toString()
- val projectName = project.name
- val extension = project.extensions.findByType(ArtifactMetaExtension::class.java)
-
- // If the `artifactId` is not specified explicitly, use the project name.
- val artifactId = extension?.artifactId?.orNull ?: projectName
- val artifact = MavenArtifact(group, artifactId, project.version.toString())
+ val group = artifactGroup.get()
+ val id = artifactId.get()
+ val artifact = MavenArtifact(group, id, artifactVersion.get())
val dependencies = collectDependencies()
val artifactMeta = ArtifactMeta(artifact, dependencies)
@@ -83,7 +112,7 @@ public abstract class WriteArtifactMeta : DefaultTask() {
val outputDir = outputDirectory.get().asFile
outputDir.mkdirs()
- val module = Module(group, artifactId)
+ val module = Module(group, id)
val fileName = ArtifactMeta.resourcePath(module)
val file = outputDir.resolve(fileName)
@@ -91,37 +120,18 @@ public abstract class WriteArtifactMeta : DefaultTask() {
}
/**
- * Collects all the non-test dependencies of the project.
+ * Rebuilds the collected dependencies from their [coordinates][dependencyCoordinates],
+ * keeping one artifact per module and sorting the result.
*/
private fun collectDependencies(): Dependencies {
- val extension = project.extensions.findByType(ArtifactMetaExtension::class.java)
- val cfg = extension!!.excludeConfigurations
- val excludedByName = cfg.named.orNull ?: emptySet()
- val excludedBySubstring = cfg.containing.orNull ?: emptySet()
-
- // Collect from configurations (according to exclusions).
- val discovered = project.configurations
- .asSequence()
- .filter { cfg -> cfg.name !in excludedByName }
- .filter { cfg ->
- val lower = cfg.name.lowercase()
- !excludedBySubstring.any { sub -> lower.contains(sub.lowercase()) }
- }
- .flatMap { c -> c.dependencies }
- .mapNotNull { d -> d.toMavenArtifact() }
- .toMutableSet()
-
- // Add explicitly declared dependencies from the extension.
- val explicitNotations = extension.explicitDependencies.orNull ?: emptySet()
- explicitNotations.asSequence()
+ val artifacts = dependencyCoordinates.get()
.map { MavenArtifact.withCoordinates(it) }
- .forEach { discovered.add(it) }
// Deduplicate by module keeping the artifact with the highest sorting order.
- val deduplicated = discovered
+ val deduplicated = artifacts
.groupBy { it.module }
.values
- .mapNotNull { artifacts -> artifacts.maxWithOrNull(mavenArtifactComparator) }
+ .mapNotNull { perModule -> perModule.maxWithOrNull(mavenArtifactComparator) }
.sortedWith(mavenArtifactComparator)
return Dependencies(deduplicated)
}
@@ -143,19 +153,3 @@ private val mavenArtifactComparator: Comparator =
.thenBy { it.version }
.thenBy { it.classifier }
.thenBy { it.extension }
-
-/**
- * Creates a [MavenArtifact] from a Gradle [Dependency].
- *
- * The `null` checks performed by the function filter out dependencies that
- * do have either `group`, `name`, or `version` attribute available,
- * which is a safety feature for the dynamic Gradle environment.
- *
- * The dependencies of our interest are going to have the required attributes.
- */
-@Suppress("ReturnCount")
-private fun Dependency.toMavenArtifact(): MavenArtifact? {
- val group = this.group ?: return null
- val version = this.version ?: return null
- return MavenArtifact(group, this.name, version)
-}
diff --git a/plugin-base/src/main/java/io/spine/tools/gradle/task/TaskDependencies.java b/plugin-base/src/main/java/io/spine/tools/gradle/task/TaskDependencies.java
index 48a48563d..ca032151a 100644
--- a/plugin-base/src/main/java/io/spine/tools/gradle/task/TaskDependencies.java
+++ b/plugin-base/src/main/java/io/spine/tools/gradle/task/TaskDependencies.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2022, 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.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
@@ -23,6 +23,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+
package io.spine.tools.gradle.task;
import org.gradle.api.Task;
@@ -70,8 +71,7 @@ private static boolean dependsOn(Task task, String ontoTaskWithName) {
if (anObject instanceof String) {
contains = contains || ontoTaskWithName.equals(anObject);
}
- if (anObject instanceof Task) {
- var objectAsTask = (Task) anObject;
+ if (anObject instanceof Task objectAsTask) {
contains = contains || ontoTaskWithName.equals(objectAsTask.getName());
}
}
diff --git a/plugin-base/src/test/kotlin/io/spine/tools/gradle/project/PlugableProjectSpec.kt b/plugin-base/src/test/kotlin/io/spine/tools/gradle/project/PlugableProjectSpec.kt
index bbcd557a4..902829e05 100644
--- a/plugin-base/src/test/kotlin/io/spine/tools/gradle/project/PlugableProjectSpec.kt
+++ b/plugin-base/src/test/kotlin/io/spine/tools/gradle/project/PlugableProjectSpec.kt
@@ -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.
@@ -37,22 +37,8 @@ import io.spine.testing.logging.LoggingTest
import io.spine.tools.gradle.GradlePlugin
import io.spine.tools.gradle.PluginScript
import java.util.concurrent.atomic.AtomicBoolean
-import org.gradle.api.Action
import org.gradle.api.Project
import org.gradle.api.plugins.JavaPlugin
-import org.gradle.api.problems.Problem
-import org.gradle.api.problems.ProblemId
-import org.gradle.api.problems.ProblemReporter
-import org.gradle.api.problems.ProblemSpec
-import org.gradle.api.problems.internal.InternalProblem
-import org.gradle.api.problems.internal.InternalProblemBuilder
-import org.gradle.api.problems.internal.InternalProblemReporter
-import org.gradle.api.problems.internal.InternalProblemSpec
-import org.gradle.api.problems.internal.InternalProblems
-import org.gradle.api.problems.internal.ProblemsInfrastructure
-import org.gradle.api.problems.internal.ProblemsProgressEventEmitterHolder
-import org.gradle.internal.operations.OperationIdentifier
-import org.gradle.internal.reflect.Instantiator
import org.gradle.plugins.ide.idea.IdeaPlugin
import org.gradle.testfixtures.ProjectBuilder
import org.junit.jupiter.api.AfterEach
@@ -63,7 +49,7 @@ import org.junit.jupiter.api.Test
@DisplayName("`PlugableProject` should")
internal class PlugableProjectSpec {
-
+
private lateinit var plugableProject: PlugableProject
private lateinit var project: Project
@@ -103,7 +89,7 @@ internal class PlugableProjectSpec {
@Nested internal inner class
LogOnDuplicate :
- LoggingTest(PlugableProject::class.java, Level.Companion.DEBUG.toJavaLogging()) {
+ LoggingTest(PlugableProject::class.java, Level.DEBUG.toJavaLogging()) {
private lateinit var plugin: GradlePlugin<*>
@@ -139,10 +125,6 @@ internal class PlugableProjectSpec {
@Test
fun `apply Gradle scripts from classpath`() {
- // See: https://github.com/gradle/gradle/issues/31862#issuecomment-2687633265
- // and stub classes below.
- ProblemsProgressEventEmitterHolder.init(InternalProblemsStub())
-
val resource = Resource.file("test-script.gradle", javaClass.classLoader)
plugableProject.apply(PluginScript.declaredIn(resource))
val success = project.extensions
@@ -177,52 +159,3 @@ internal class PlugableProjectSpec {
run.get() shouldBe true
}
}
-
-/**
- * The stub class for workaround for
- * [this Gradle issue](https://github.com/gradle/gradle/issues/31862).
- *
- * @see
- * Workaround
- */
-private class InternalProblemsStub : InternalProblems {
- override fun getReporter(): ProblemReporter = notImplemented()
- override fun getInternalReporter(): InternalProblemReporter = InternalProblemReporterStub()
- override fun getInfrastructure(): ProblemsInfrastructure = notImplemented()
- override fun getProblemBuilder(): InternalProblemBuilder = notImplemented()
-}
-
-private fun notImplemented(): Nothing = TODO("Not yet implemented")
-
-/**
- * The stub class for workaround for
- * [this Gradle issue](https://github.com/gradle/gradle/issues/31862).
- *
- * @see
- * Workaround
- */
-private class InternalProblemReporterStub : InternalProblemReporter {
- override fun create(problemId: ProblemId, action: Action): Problem =
- notImplemented()
- override fun report(problem: Problem, id: OperationIdentifier) = notImplemented()
- override fun report(problemId: ProblemId, spec: Action) = notImplemented()
- override fun report(problem: Problem) = notImplemented()
- override fun report(problems: MutableCollection) = notImplemented()
-
- override fun throwing(
- exception: Throwable,
- problemId: ProblemId,
- spec: Action
- ): RuntimeException = notImplemented()
-
- override fun throwing(exception: Throwable, problem: Problem): RuntimeException =
- notImplemented()
-
- override fun throwing(
- exception: Throwable,
- problems: MutableCollection
- ): RuntimeException = notImplemented()
-
- override fun internalCreate(action: Action): InternalProblem =
- notImplemented()
-}
diff --git a/protobuf-setup-plugins/build.gradle.kts b/protobuf-setup-plugins/build.gradle.kts
index b8c0465aa..be51b8301 100644
--- a/protobuf-setup-plugins/build.gradle.kts
+++ b/protobuf-setup-plugins/build.gradle.kts
@@ -58,7 +58,7 @@ artifactMeta {
}
// As defined in `versions.gradle.kts`.
-val versionToPublish: String by extra
+val versionToPublish = extra["versionToPublish"] as String
description = "Utilities for working with Protobuf projects under Gradle."
@@ -90,12 +90,11 @@ gradlePlugin {
// Do not publish to Gradle Plugin Portal snapshot versions.
// It is prohibited by their policy: https://plugins.gradle.org/docs/publish-plugin
-val publishPlugins: Task by tasks.getting {
+val publishPlugins = tasks.getByName("publishPlugins") {
enabled = !versionToPublish.isSnapshot()
}
-@Suppress("unused")
-val publish: Task by tasks.getting {
+tasks.getByName("publish") {
dependsOn(publishPlugins)
}
diff --git a/tool-base/src/main/java/io/spine/tools/code/IndentedLine.java b/tool-base/src/main/java/io/spine/tools/code/IndentedLine.java
index 31a802df2..72da4785b 100644
--- a/tool-base/src/main/java/io/spine/tools/code/IndentedLine.java
+++ b/tool-base/src/main/java/io/spine/tools/code/IndentedLine.java
@@ -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.
@@ -94,10 +94,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (!(o instanceof IndentedLine)) {
+ if (!(o instanceof IndentedLine other)) {
return false;
}
- var other = (IndentedLine) o;
var codeEquals = code.equals(other.code);
var indentEquals = indent.equals(other.indent);
return codeEquals && indentEquals;
diff --git a/tool-base/src/main/java/io/spine/tools/code/Line.java b/tool-base/src/main/java/io/spine/tools/code/Line.java
index 63817c3df..9fadfaa50 100644
--- a/tool-base/src/main/java/io/spine/tools/code/Line.java
+++ b/tool-base/src/main/java/io/spine/tools/code/Line.java
@@ -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.
@@ -74,14 +74,7 @@ public static Line emptyLine() {
@Override
public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof Line)) {
- return false;
- }
- var other = (Line) o;
- return text.equals(other.text);
+ return this == o || o instanceof Line other && text.equals(other.text);
}
@Override
diff --git a/tool-base/src/main/java/io/spine/tools/dart/fs/ImportStatement.java b/tool-base/src/main/java/io/spine/tools/dart/fs/ImportStatement.java
index 4bf09e496..8675341d5 100644
--- a/tool-base/src/main/java/io/spine/tools/dart/fs/ImportStatement.java
+++ b/tool-base/src/main/java/io/spine/tools/dart/fs/ImportStatement.java
@@ -177,10 +177,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (!(o instanceof ImportStatement)) {
+ if (!(o instanceof ImportStatement other)) {
return false;
}
- var other = (ImportStatement) o;
return text.equals(other.text) && sourceDirectory.equals(other.sourceDirectory);
}
diff --git a/tool-base/src/main/java/io/spine/tools/fs/DirectoryPattern.java b/tool-base/src/main/java/io/spine/tools/fs/DirectoryPattern.java
index 2bdd2faad..27e916df9 100644
--- a/tool-base/src/main/java/io/spine/tools/fs/DirectoryPattern.java
+++ b/tool-base/src/main/java/io/spine/tools/fs/DirectoryPattern.java
@@ -1,11 +1,11 @@
/*
- * Copyright 2022, 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.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * https://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
@@ -192,10 +192,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (!(o instanceof DirectoryPattern)) {
+ if (!(o instanceof DirectoryPattern pattern)) {
return false;
}
- var pattern = (DirectoryPattern) o;
return includeNested == pattern.includeNested &&
directory.equals(pattern.directory);
}
diff --git a/tool-base/src/main/java/io/spine/tools/fs/ExternalModule.java b/tool-base/src/main/java/io/spine/tools/fs/ExternalModule.java
index 90109c178..272aac16d 100644
--- a/tool-base/src/main/java/io/spine/tools/fs/ExternalModule.java
+++ b/tool-base/src/main/java/io/spine/tools/fs/ExternalModule.java
@@ -154,10 +154,9 @@ public boolean equals(Object o) {
if (this == o) {
return true;
}
- if (!(o instanceof ExternalModule)) {
+ if (!(o instanceof ExternalModule module)) {
return false;
}
- var module = (ExternalModule) o;
return name.equals(module.name) &&
directories.equals(module.directories);
}
diff --git a/tool-base/src/main/java/io/spine/tools/fs/ExternalModules.java b/tool-base/src/main/java/io/spine/tools/fs/ExternalModules.java
index e083dde38..ffeb69d76 100644
--- a/tool-base/src/main/java/io/spine/tools/fs/ExternalModules.java
+++ b/tool-base/src/main/java/io/spine/tools/fs/ExternalModules.java
@@ -101,14 +101,7 @@ public ImmutableList asList() {
@Override
public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (!(o instanceof ExternalModules)) {
- return false;
- }
- var other = (ExternalModules) o;
- return modules.equals(other.modules);
+ return this == o || o instanceof ExternalModules other && modules.equals(other.modules);
}
@Override
diff --git a/version.gradle.kts b/version.gradle.kts
index 630871383..ba0d67441 100644
--- a/version.gradle.kts
+++ b/version.gradle.kts
@@ -24,4 +24,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-val versionToPublish: String by extra("2.0.0-SNAPSHOT.403")
+extra.set("versionToPublish", "2.0.0-SNAPSHOT.404")