diff --git a/.agents/skills/bump-gradle/SKILL.md b/.agents/skills/bump-gradle/SKILL.md new file mode 100644 index 000000000..e5d09269f --- /dev/null +++ b/.agents/skills/bump-gradle/SKILL.md @@ -0,0 +1,117 @@ +--- +name: bump-gradle +description: > + Update the Gradle wrapper version used by this repository. Use when asked to + upgrade Gradle, bump the Gradle wrapper, move the project to the latest + Gradle release from the official release notes, run the Gradle build, and + commit Gradle wrapper and dependency report changes separately. +--- + +# Bump Gradle + +Use the official Gradle release notes as the source of truth for both the +latest version and the wrapper update command: + +https://docs.gradle.org/current/release-notes.html#upgrade-instructions + +Always check that page at task time. Do not rely on remembered Gradle versions. + +## Checklist + +1. Work from the target repository root. + + Confirm `./gradlew` and `gradle/wrapper/gradle-wrapper.properties` exist + before changing anything. Inspect `git status --short` and preserve unrelated + user changes. If Gradle wrapper files are already modified, inspect the diff + and continue only when those edits are part of the same requested Gradle + bump; otherwise ask before overwriting or staging them. + +2. Read the latest Gradle version from the release notes. + + Open the Upgrade instructions section at the URL above. Use the version in + the release heading and the wrapper command shown there. They should agree; + if they do not, stop and report the mismatch. + +3. Run the wrapper update command. + + Substitute the version from the release notes: + + ```bash + ./gradlew wrapper --gradle-version=GRADLE_VERSION && ./gradlew wrapper + ``` + + For example, if the release notes say Gradle `9.5.1`, run: + + ```bash + ./gradlew wrapper --gradle-version=9.5.1 && ./gradlew wrapper + ``` + +4. Run the build. + + ```bash + ./gradlew clean build + ``` + + If the wrapper update or build fails, do not commit partial changes. Report + the failing command and the relevant error output. + +5. Commit only Gradle-related files. + + Inspect `git status --short` and `git diff --name-only`. Stage only files + created or updated by the Gradle wrapper bump, normally: + + ```text + gradle/wrapper/gradle-wrapper.properties + gradle/wrapper/gradle-wrapper.jar + gradlew + gradlew.bat + ``` + + Include other Gradle-owned files only when they are directly required by the + wrapper update and are clearly part of the same change. Do not stage + dependency reports or unrelated build output in this commit. + + Commit with the exact subject, replacing `GRADLE_VERSION`: + + ```text + Bump Gradle -> `GRADLE_VERSION` + ``` + + Example: + + ```bash + git commit -m 'Bump Gradle -> `9.5.1`' + ``` + + If no Gradle-related files changed, do not create an empty commit; report + that the wrapper was already current after verification. + +6. Commit dependency reports separately when the build updates them. + + Stage only generated dependency report files. In repositories using this + config, the usual paths are: + + ```text + docs/dependencies/pom.xml + docs/dependencies/dependencies.md + ``` + + Include other changed files only when they are clearly generated dependency + reports from the build. Commit them separately with: + + ```text + Update dependency reports + ``` + +7. Verify the final branch state. + + Confirm the recent commit subjects and make sure no owned Gradle bump or + dependency report changes remain unstaged: + + ```bash + git log --format=%s -2 + git status --short + ``` + + Leave unrelated pre-existing user changes alone and mention them separately + in the final response. diff --git a/.agents/skills/bump-gradle/agents/openai.yaml b/.agents/skills/bump-gradle/agents/openai.yaml new file mode 100644 index 000000000..6edf97877 --- /dev/null +++ b/.agents/skills/bump-gradle/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Bump Gradle" + short_description: "Update the Gradle wrapper safely" + default_prompt: "Use $bump-gradle to update this repository to the latest Gradle wrapper version from the official release notes, build, and split Gradle/report commits." diff --git a/.agents/skills/bump-version/SKILL.md b/.agents/skills/bump-version/SKILL.md new file mode 100644 index 000000000..7143c3e9f --- /dev/null +++ b/.agents/skills/bump-version/SKILL.md @@ -0,0 +1,118 @@ +--- +name: bump-version +description: > + Bump the project version in `version.gradle.kts` following the Spine SDK + versioning policy. Use when starting a new branch, before opening a PR, or + when CI rejects a branch for a missing/insufficient version increment. Covers + locating the published version value, choosing the increment, committing the + bump, rebuilding reports, and resolving version conflicts. +--- + +# Bump the project version + +The authoritative policy is [Spine SDK Versioning][version-policy]. In this +skill's target repository, CI runs the `Version Guard` workflow, which invokes +`checkVersionIncrement` through `IncrementGuard`. The task fails if the current +project version already exists in the Maven repository. It does not compare git +branches or inspect commit subjects; the checks below are agent-side guardrails. + +## Checklist + +1. Work from the target repository root. + + Confirm `version.gradle.kts` exists before editing. If it is absent, stop and + report that this skill does not apply to the current checkout. + + Inspect `git status --short` before changing files. Preserve unrelated user + changes and stage only the version/report files this workflow owns. + +2. Locate `version.gradle.kts` and update the value that feeds + `versionToPublish`. + + The published version may be a literal: + + ```kotlin + val versionToPublish: String by extra("2.0.0-SNAPSHOT.182") + ``` + + Or it may come from another variable: + + ```kotlin + val compilerVersion: String by extra("2.0.0-SNAPSHOT.043") + val versionToPublish by extra(compilerVersion) + ``` + + In the second case, update the source value (`compilerVersion` here), not + only the `versionToPublish` alias. + +3. Choose the increment. + + For the normal snapshot-line PR, increment the trailing snapshot number by + one: `2.0.0-SNAPSHOT.182` -> `2.0.0-SNAPSHOT.183`. Preserve existing + zero-padding: `2.0.0-SNAPSHOT.009` -> `2.0.0-SNAPSHOT.010`. + + For a breaking snapshot-line PR, advance to the next multiple of 10 that is + strictly greater than the current value: `.187` -> `.190`, and `.180` -> + `.190`. + + For release-line work, follow the [policy][version-policy]: urgent fixes bump `PATCH`; + feature work or significant fixes bump `MINOR` and reset `PATCH` to `0`. + +4. Commit only the `version.gradle.kts` change with this subject: + + ```text + Bump version -> `2.0.0-SNAPSHOT.183` + ``` + + Use the actual new version in the subject. Do not include unrelated files in + this commit. + +5. Run the build to verify the bump and regenerate reports: + + ```bash + ./gradlew clean build + ``` + + Repos using this config commonly finalize `generatePom` and + `mergeAllLicenseReports` after `build`, which updates + `docs/dependencies/pom.xml` and `docs/dependencies/dependencies.md` when + those reports are configured. + +6. If `docs/dependencies/pom.xml` or `docs/dependencies/dependencies.md` changed, + commit those generated files separately: + + ```text + Update dependency reports + ``` + + If the PR has the `License Reports` workflow, make sure the branch modifies + `docs/dependencies/pom.xml` and `docs/dependencies/dependencies.md`. + +7. Validate the branch state. + + ```bash + BASE=master + git fetch --quiet origin "$BASE" + RANGE="$(git merge-base HEAD origin/$BASE)..HEAD" + git log --format=%s "$RANGE" | grep '^Bump version ->' + git diff --name-only "$RANGE" -- version.gradle.kts | grep '^version.gradle.kts$' + ``` + + Use the actual merge target for `BASE` when it is not `master`. + Also confirm `git status --short` has no uncommitted changes created by the + version bump or report regeneration. + +## Conflict Rule + +When merging a base branch into a feature branch: + +- If the base branch version is lower, keep the feature branch version. +- If the base branch version is greater than or equal to the feature branch + version, set the feature branch version to `base + 1`, or apply the breaking + change rounding rule. + +Do not require a completely clean worktree if unrelated user changes are +present. Instead, make sure no uncommitted changes were created by the version +bump or report regeneration. + +[version-policy]: https://github.com/SpineEventEngine/documentation/wiki/Versioning diff --git a/.agents/skills/bump-version/agents/openai.yaml b/.agents/skills/bump-version/agents/openai.yaml new file mode 100644 index 000000000..12f6e4f9b --- /dev/null +++ b/.agents/skills/bump-version/agents/openai.yaml @@ -0,0 +1,4 @@ +interface: + display_name: "Bump Version" + short_description: "Bump Spine project versions safely" + default_prompt: "Use $bump-version to bump the project version in version.gradle.kts, commit the version change, rebuild dependency reports, and verify the branch." diff --git a/.agents/skills/writer/SKILL.md b/.agents/skills/writer/SKILL.md index 30cb51e38..6b9d86f88 100644 --- a/.agents/skills/writer/SKILL.md +++ b/.agents/skills/writer/SKILL.md @@ -49,6 +49,15 @@ description: > - Follow `.agents/documentation-guidelines.md` and `.agents/documentation-tasks.md`. - Use fenced code blocks for commands and examples; format file/dir names as code. +- When referencing a documentation page or section in body prose, use typographic + double quotation marks only if the visible reference text is the actual page or + section title, such as the “Getting started” page or the “Troubleshooting” + section. The title normally starts with a capital letter. Do not add these + quotes around generic or descriptive links such as “this page”, “the next + section”, “declaring constraints”, or `4.3`, even if they point to a page or + section. Do not add these quotes in “What’s next” sections or navigation + elements. Keep file paths, identifiers, frontmatter values, navigation labels, + and Markdown link labels in their expected syntax. - In Markdown files, prefer footnote-style reference links for external `https://` targets instead of inline links. Write readable body text like `[label][short-id]`, then place the URL definition near the end of the file, diff --git a/.agents/version-policy.md b/.agents/version-policy.md index 65dc45749..95ac4513e 100644 --- a/.agents/version-policy.md +++ b/.agents/version-policy.md @@ -1,30 +1,15 @@ # Version policy -## We use semver -The version of the project is kept in the `version.gradle.kts` file in the root of the project. +The project follows the [Spine SDK Versioning policy][wiki-versioning]. +The version is kept in `version.gradle.kts` at the project root and follows +[Semantic Versioning 2.0.0][semver] with Spine-specific extensions +(snapshot `NUMBER`, patch, and flavor suffixes). -The version numbers in these files follow the conventions of -[Semantic Versioning 2.0.0](https://semver.org/). +PRs without a version bump fail CI. -## Quick checklist for versioning -1. Increment the patch version in `version.gradle.kts`. - Retain zero-padding if applicable: - - Example: `"2.0.0-SNAPSHOT.009"` → `"2.0.0-SNAPSHOT.010"` -2. Commit the version bump separately with this comment: - ```text - Bump version → `$newVersion` - ``` -3. Rebuild using `./gradlew clean build`. -4. Update `pom.xml`, `dependencies.md` and commit changes with: `Update dependency reports` +For the bump procedure — version-number selection, the commit-message +convention, the rebuild, dependency-report updates, and conflict resolution — +use the [`bump-version`](skills/bump-version/SKILL.md) skill. -Remember: PRs without version bumps will fail CI (conflict resolution detailed above). - -## Resolving conflicts in `version.gradle.kts` -A branch conflict over the version number should be resolved as described below. - * If a merged branch has a number which is less than that of the current branch, the version of - the current branch stays. - * If the merged branch has the number which is greater or equal to that of the current branch, - the number should be increased by one. - -## When to bump the version? - - When a new branch is created. +[semver]: https://semver.org/ +[wiki-versioning]: https://github.com/SpineEventEngine/documentation/wiki/Versioning diff --git a/.github/workflows/ensure-reports-updated.yml b/.github/workflows/ensure-reports-updated.yml index 7df73d220..315cd202b 100644 --- a/.github/workflows/ensure-reports-updated.yml +++ b/.github/workflows/ensure-reports-updated.yml @@ -20,6 +20,6 @@ jobs: # Check out the `config` submodule to fetch the required script file. submodules: true - - name: Check that both `pom.xml` and license report files are modified + - name: Check that dependency report files are modified shell: bash run: chmod +x ./config/scripts/ensure-reports-updated.sh && ./config/scripts/ensure-reports-updated.sh diff --git a/.gitignore b/.gitignore index 5f85d295e..c43c66220 100644 --- a/.gitignore +++ b/.gitignore @@ -135,3 +135,6 @@ pubspec.lock # Python cache __pycache__/ *.pyc + +# Claude working files +/.claude/worktrees/ diff --git a/CLAUDE.md b/CLAUDE.md index 72e0ad227..38753d02a 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -3,7 +3,7 @@ ## Agent Guidelines Please read and follow all guidelines in the project's agent documentation: -- Start with the table of contents: `./agents/_TOC.md`. +- Start with the table of contents: `.agents/_TOC.md`. - Follow all linked documents from the TOC. - Apply all coding standards, formatting rules, and project conventions found in these documents. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt index 2333e4ce7..6ee3b088e 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/CoreJvmCompiler.kt @@ -46,12 +46,12 @@ object CoreJvmCompiler { /** * The version used to in the build classpath. */ - const val dogfoodingVersion = "2.0.0-SNAPSHOT.063" + const val dogfoodingVersion = "2.0.0-SNAPSHOT.064" /** * The version to be used for integration tests. */ - const val version = "2.0.0-SNAPSHOT.062" + const val version = "2.0.0-SNAPSHOT.063" /** * The ID of the Gradle plugin. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt index 4e285fa9d..e6c184c9c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Time.kt @@ -40,7 +40,7 @@ import io.spine.dependency.Dependency ) object Time : Dependency() { override val group = Spine.group - override val version = "2.0.0-SNAPSHOT.238" + override val version = "2.0.0-SNAPSHOT.240" private const val infix = "spine-time" fun lib(version: String): String = "$group:$infix:$version" diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt index 121d7aac2..c3e302c79 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/Validation.kt @@ -36,7 +36,7 @@ object Validation { /** * The version of the Validation library artifacts. */ - const val version = "2.0.0-SNAPSHOT.414" + const val version = "2.0.0-SNAPSHOT.421" /** * The last version of Validation compatible with ProtoData. diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt index 8ede9919a..14c280b7d 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/LicenseReporter.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. @@ -43,7 +43,7 @@ import org.gradle.kotlin.dsl.the * * Transitive dependencies are included. * - * The output file is placed to the root folder of the root Gradle project. + * The output file is placed under `docs/dependencies` of the root Gradle project. * * Usage: * @@ -146,7 +146,7 @@ object LicenseReporter { /** * Merges the license reports from all [sourceProjects] into a single file under - * the [rootProject]'s root directory. + * the [rootProject]'s dependency report directory. */ private fun mergeReports( sourceProjects: Iterable, @@ -165,7 +165,8 @@ object LicenseReporter { } println("Merging the license reports from all projects.") val mergedContent = paths.joinToString("\n\n\n") { (File(it)).readText() } - val output = File("${rootProject.rootDir}/${Paths.outputFilename}") + val output = Paths.outputFile(rootProject.rootDir, Paths.outputFilename) + output.parentFile.mkdirs() output.writeText(mergedContent) } } diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt index 975a73b0e..1d1632752 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/license/Paths.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. @@ -26,15 +26,23 @@ package io.spine.gradle.report.license +import java.io.File + /** - * Filesystem paths used by [LicenseReporter]. + * Filesystem paths used by [LicenseReporter] and + * [PomGenerator][io.spine.gradle.report.pom.PomGenerator]. */ internal object Paths { + /** + * The directory in the root project to which dependency reports are written. + */ + internal const val outputDirectory = "docs/dependencies" + /** * The output filename of the license report. * - * The file with this name is placed to the root folder of the root Gradle project — + * The file with this name is placed under [outputDirectory] of the root Gradle project — * as the result of the [LicenseReporter] work. * * Its contents describe the licensing information for each of the Java dependencies @@ -46,4 +54,10 @@ internal object Paths { * The path to a directory, to which a per-project report is generated. */ internal const val relativePath = "reports/dependency-license/dependency" + + /** + * Obtains a dependency report file under [outputDirectory] of the root project directory. + */ + internal fun outputFile(rootDirectory: File, filename: String): File = + rootDirectory.resolve(outputDirectory).resolve(filename) } diff --git a/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt index 6e986e136..7ffeda189 100644 --- a/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.kt +++ b/buildSrc/src/main/kotlin/io/spine/gradle/report/pom/PomGenerator.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. @@ -26,6 +26,7 @@ package io.spine.gradle.report.pom +import io.spine.gradle.report.license.Paths import org.gradle.api.Project import org.gradle.api.plugins.BasePlugin @@ -41,7 +42,7 @@ import org.gradle.api.plugins.BasePlugin * The generated `pom.xml` is not usable for Maven build tasks and is merely a * description of project dependencies. * - * Configures the `build` task to generate the `pom.xml` file. + * Configures the `build` task to generate the `pom.xml` file under `docs/dependencies`. * * Note that the generated `pom.xml` includes the group ID, artifact ID and the version of the * project this script was applied to. In case you want to override the default values, do so in @@ -63,6 +64,8 @@ import org.gradle.api.plugins.BasePlugin @Suppress("unused") object PomGenerator { + private const val pomFilename = "pom.xml" + /** * Configures the generator for the passed [project]. */ @@ -81,8 +84,8 @@ object PomGenerator { val task = project.tasks.register("generatePom") { doLast { - val pomFile = project.projectDir.resolve("pom.xml") - project.delete(pomFile) + val pomFile = Paths.outputFile(project.rootDir, pomFilename) + pomFile.parentFile.mkdirs() val projectData = project.metadata() val writer = PomXmlWriter(projectData) diff --git a/buildSrc/src/test/kotlin/io/spine/gradle/report/license/DependencyReportOutputTest.kt b/buildSrc/src/test/kotlin/io/spine/gradle/report/license/DependencyReportOutputTest.kt new file mode 100644 index 000000000..9c36b218b --- /dev/null +++ b/buildSrc/src/test/kotlin/io/spine/gradle/report/license/DependencyReportOutputTest.kt @@ -0,0 +1,104 @@ +/* + * 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 + * + * 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 + * disclaimer. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (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.gradle.report.license + +import io.kotest.matchers.shouldBe +import io.spine.gradle.report.pom.PomGenerator +import java.io.File +import org.gradle.api.Project +import org.gradle.api.Task +import org.gradle.api.plugins.BasePlugin +import org.gradle.testfixtures.ProjectBuilder +import org.junit.jupiter.api.BeforeEach +import org.junit.jupiter.api.DisplayName +import org.junit.jupiter.api.Test +import org.junit.jupiter.api.io.TempDir + +@DisplayName("Dependency reports should") +class DependencyReportOutputTest { + + @TempDir + lateinit var projectDir: File + + private lateinit var project: Project + + @BeforeEach + fun setUp() { + project = ProjectBuilder.builder() + .withProjectDir(projectDir) + .build() + project.group = "io.spine" + project.version = "2.0.0" + } + + @Test + fun `write the generated POM under docs-dependencies`() { + PomGenerator.applyTo(project) + + project.tasks.named("generatePom").get() + .executeActions() + + val pomFile = projectDir.resolve("docs/dependencies/pom.xml") + pomFile.exists() shouldBe true + } + + @Test + fun `merge license reports under docs-dependencies`() { + project.pluginManager.apply(BasePlugin::class.java) + val subproject = subproject("sub") + LicenseReporter.generateReportIn(subproject) + val sourceReport = subproject.layout.buildDirectory.asFile.get() + .resolve(Paths.relativePath) + .resolve(Paths.outputFilename) + sourceReport.parentFile.mkdirs() + sourceReport.writeText("license report") + + LicenseReporter.mergeAllReports(project) + + project.tasks.named("mergeAllLicenseReports").get() + .executeActions() + + val reportFile = projectDir.resolve("docs/dependencies/dependencies.md") + reportFile.readText() shouldBe "license report" + } + + private fun subproject(name: String): Project { + val subprojectDir = projectDir.resolve(name) + subprojectDir.mkdirs() + return ProjectBuilder.builder() + .withName(name) + .withParent(project) + .withProjectDir(subprojectDir) + .build() + } + + private fun Task.executeActions() { + actions.forEach { + it.execute(this) + } + } +} diff --git a/config b/config index 69c13f454..c3ab20a7f 160000 --- a/config +++ b/config @@ -1 +1 @@ -Subproject commit 69c13f45498b638ff4eccf8e097bb88c49af96e9 +Subproject commit c3ab20a7fc8cf1464ff45651a19935b5b7aeaea7 diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar index d997cfc60..b1b8ef56b 100644 Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c61a118f7..df6a6ad76 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,9 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.5.1-bin.zip networkTimeout=10000 +retries=0 +retryBackOffMs=500 validateDistributionUrl=true zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/gradlew b/gradlew index 739907dfd..b9bb139f7 100755 --- a/gradlew +++ b/gradlew @@ -57,7 +57,7 @@ # Darwin, MinGW, and NonStop. # # (3) This script is generated from the Groovy template -# https://github.com/gradle/gradle/blob/2d6327017519d23b96af35865dc997fcb544fb40/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt +# https://github.com/gradle/gradle/blob/3d91ce3b8caaf77ad09f381f43615b715b53f72c/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt # within the Gradle project. # # You can find Gradle at https://github.com/gradle/gradle/. diff --git a/gradlew.bat b/gradlew.bat index c4bdd3ab8..24c62d56f 100644 --- a/gradlew.bat +++ b/gradlew.bat @@ -23,8 +23,8 @@ @rem @rem ########################################################################## -@rem Set local scope for the variables with windows NT shell -if "%OS%"=="Windows_NT" setlocal +@rem Set local scope for the variables, and ensure extensions are enabled +setlocal EnableExtensions set DIRNAME=%~dp0 if "%DIRNAME%"=="" set DIRNAME=. @@ -51,7 +51,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :findJavaFromJavaHome set JAVA_HOME=%JAVA_HOME:"=% @@ -65,7 +65,7 @@ echo. 1>&2 echo Please set the JAVA_HOME variable in your environment to match the 1>&2 echo location of your Java installation. 1>&2 -goto fail +"%COMSPEC%" /c exit 1 :execute @rem Setup the command line @@ -73,21 +73,10 @@ goto fail @rem Execute Gradle -"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -jar "%APP_HOME%\gradle\wrapper\gradle-wrapper.jar" %* +@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 -:end -@rem End local scope for the variables with windows NT shell -if %ERRORLEVEL% equ 0 goto mainEnd - -:fail -rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of -rem the _cmd.exe /c_ return code! -set EXIT_CODE=%ERRORLEVEL% -if %EXIT_CODE% equ 0 set EXIT_CODE=1 -if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE% -exit /b %EXIT_CODE% - -:mainEnd -if "%OS%"=="Windows_NT" endlocal - -:omega +:exitWithErrorLevel +@rem Use "%COMSPEC%" /c exit to allow operators to work properly in scripts +"%COMSPEC%" /c exit %ERRORLEVEL% diff --git a/time/src/main/kotlin/io/spine/time/validation/LocalDateValidator.kt b/time/src/main/kotlin/io/spine/time/validation/LocalDateValidator.kt index 5a3fb83c1..24ae7938c 100644 --- a/time/src/main/kotlin/io/spine/time/validation/LocalDateValidator.kt +++ b/time/src/main/kotlin/io/spine/time/validation/LocalDateValidator.kt @@ -33,8 +33,8 @@ import io.spine.time.Month import io.spine.validation.DetectedViolation import io.spine.validation.FieldViolation import io.spine.validation.MessageValidator -import io.spine.validation.RuntimeErrorPlaceholder.FIELD_PATH -import io.spine.validation.RuntimeErrorPlaceholder.RANGE_VALUE +import io.spine.validation.ErrorPlaceholder.FIELD_PATH +import io.spine.validation.ErrorPlaceholder.RANGE_VALUE import io.spine.validation.templateString import java.time.Year import java.time.YearMonth diff --git a/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenGenerator.kt b/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenGenerator.kt index da910ad11..f9916d2e4 100644 --- a/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenGenerator.kt +++ b/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenGenerator.kt @@ -43,12 +43,6 @@ import io.spine.tools.compiler.jvm.field import io.spine.tools.time.validation.TimeFieldType.TFT_TEMPORAL import io.spine.tools.time.validation.TimeFieldType.TFT_TIMESTAMP import io.spine.tools.time.validation.WhenField -import io.spine.tools.validation.ErrorPlaceholder -import io.spine.tools.validation.ErrorPlaceholder.FIELD_PATH -import io.spine.tools.validation.ErrorPlaceholder.FIELD_TYPE -import io.spine.tools.validation.ErrorPlaceholder.FIELD_VALUE -import io.spine.tools.validation.ErrorPlaceholder.PARENT_TYPE -import io.spine.tools.validation.ErrorPlaceholder.WHEN_IN import io.spine.tools.validation.java.expression.EmptyFieldCheck import io.spine.tools.validation.java.expression.JsonExtensionsClass import io.spine.tools.validation.java.expression.SpineTime @@ -66,6 +60,12 @@ import io.spine.tools.validation.java.generate.ValidateScope.parentName import io.spine.tools.validation.java.generate.ValidateScope.parentPath import io.spine.tools.validation.java.generate.ValidateScope.violations import io.spine.validation.ConstraintViolation +import io.spine.validation.ErrorPlaceholder +import io.spine.validation.ErrorPlaceholder.FIELD_PATH +import io.spine.validation.ErrorPlaceholder.FIELD_TYPE +import io.spine.validation.ErrorPlaceholder.FIELD_VALUE +import io.spine.validation.ErrorPlaceholder.PARENT_TYPE +import io.spine.validation.ErrorPlaceholder.WHEN_IN /** * The generator for the `(when)` option. diff --git a/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenOption.kt b/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenOption.kt index eed6573a5..48c93eff5 100644 --- a/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenOption.kt +++ b/validation/src/main/kotlin/io/spine/tools/time/validation/java/WhenOption.kt @@ -65,16 +65,16 @@ import io.spine.tools.time.validation.TimeFieldType.TFT_UNKNOWN import io.spine.tools.time.validation.WhenField import io.spine.tools.time.validation.event.WhenFieldDiscovered import io.spine.tools.time.validation.event.whenFieldDiscovered -import io.spine.tools.validation.ErrorPlaceholder.FIELD_PATH -import io.spine.tools.validation.ErrorPlaceholder.FIELD_TYPE -import io.spine.tools.validation.ErrorPlaceholder.FIELD_VALUE -import io.spine.tools.validation.ErrorPlaceholder.PARENT_TYPE -import io.spine.tools.validation.ErrorPlaceholder.WHEN_IN import io.spine.tools.validation.OPTION_NAME import io.spine.tools.validation.checkPlaceholders import io.spine.tools.validation.defaultMessage import io.spine.tools.validation.java.ValidationOption import io.spine.tools.validation.java.generate.OptionGenerator +import io.spine.validation.ErrorPlaceholder.FIELD_PATH +import io.spine.validation.ErrorPlaceholder.FIELD_TYPE +import io.spine.validation.ErrorPlaceholder.FIELD_VALUE +import io.spine.validation.ErrorPlaceholder.PARENT_TYPE +import io.spine.validation.ErrorPlaceholder.WHEN_IN /** * Extends the Java validation with code generation for the `(when)` option. diff --git a/version.gradle.kts b/version.gradle.kts index 0ea4c4a6b..e0a62b4cb 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -27,4 +27,4 @@ /** * The version of this library for publishing. */ -val versionToPublish by extra("2.0.0-SNAPSHOT.240") +val versionToPublish by extra("2.0.0-SNAPSHOT.241")