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
1 change: 1 addition & 0 deletions .agents/memory/MEMORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ See [README.md](README.md) for the format and routing rules.

- [which-fixer applied](which-fixer-applied.md) — bulk sweep done; skill now runs in incremental mode
- [integration tests stale compiler after version bump](project/integration-tests-stale-compiler-after-version-bump.md) — after a version bump, clean-build `integrationTest` or it may launch the old compiler
- [functional-test fixtures](project/functional-test-fixtures.md) — authoring `gradle-plugin` TestKit fixtures: copied buildSrc, import rules, Maven Local prerequisite, `tuneRunner()`

## Reference (external systems)

Expand Down
31 changes: 31 additions & 0 deletions .agents/memory/project/functional-test-fixtures.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
---
name: functional-test-fixtures
description: Authoring `gradle-plugin` functionalTest fixture projects — copied buildSrc,
import rules, Maven Local prerequisite, runner tuning.
metadata:
type: project
since: 2026-07-06
---

Fixture projects under `gradle-plugin/src/functionalTest/resources/<name>/` are TestKit
builds materialized via `GradleProject.setupAt(dir).fromResources("<name>")` — see
`PluginSpec` and `LaunchTaskCoverageSpec` for the setup chain.

**Why:** The fixtures compile against a copied `buildSrc` and resolve the plugin from
Maven Local, so failures surface only at fixture-build time inside a running test —
a slow feedback loop when the wiring is wrong (one missed import costs a full
`functionalTest` cycle).

**How to apply:**

- `copyBuildSrc()` copies the repo's `buildSrc` into the fixture, so fixture build
scripts may use `io.spine.dependency.*` objects (e.g. `Jacoco.version`) directly.
- Top-level buildSrc helpers (`standardSpineSdkRepositories()`) resolve without an
import, but `standardToSpineSdk()` needs
`import io.spine.gradle.repo.standardToSpineSdk` — copy the imports of an existing
fixture (`launch-test`) when creating a new one.
- The `functionalTest` task depends on `publishToMavenLocal` of every production
module; fixtures resolve `id("io.spine.compiler") version "@COMPILER_VERSION@"`
(replaced with `Plugin.version`) from `mavenLocal()`.
- After `builder.create()`, call `project.tuneRunner()` (shared helper in the
`functionalTest` source set) instead of tuning the TestKit runner inline.
377 changes: 377 additions & 0 deletions .agents/tasks/compiler-coverage-plan.md

Large diffs are not rendered by default.

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.057"
private const val fallbackVersion = "2.0.0-SNAPSHOT.059"

/**
* 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.057"
private const val fallbackDfVersion = "2.0.0-SNAPSHOT.059"

/**
* The artifact for the Compiler Gradle plugin.
Expand Down
33 changes: 24 additions & 9 deletions buildSrc/src/main/kotlin/io/spine/gradle/VersionGradleFile.kt
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,20 @@ import org.gradle.api.GradleException
* Reads a `version.gradle.kts` file and resolves the `extra` properties it declares.
*
* [contentUnder] and [contentInBase] read the file (from the working tree or a base branch);
* [keyForValue] and [valueForKey] resolve its `extra` properties. The following declaration
* shapes are handled (see the `bump-version` skill):
* [keyForValue] and [valueForKey] resolve its `extra` properties. Each property is registered
* either with the current `extra.set("name", …)` call or the legacy `by extra(…)` property
* delegate that Gradle deprecated (the `bump-version` skill migrates the latter to the former);
* both spellings are recognized, so a file is read correctly whether or not it has migrated.
* The following value shapes are handled:
*
* 1. a literal: `val versionToPublish: String by extra("2.0.0-SNAPSHOT.182")`;
* 2. an alias to another `extra`: `val versionToPublish by extra(compilerVersion)` paired
* with `val compilerVersion: String by extra("2.0.0-SNAPSHOT.043")`;
* 3. an alias to a plain `val`: `val versionToPublish by extra(base)` paired with
* `val base = "2.0.0-SNAPSHOT.043"`.
* 1. a literal:
* `extra.set("versionToPublish", "2.0.0-SNAPSHOT.182")`, or the legacy
* `val versionToPublish: String by extra("2.0.0-SNAPSHOT.182")`;
* 2. an alias to a plain `val` (or, in the legacy spelling, to another `extra`):
* `extra.set("versionToPublish", compilerVersion)` paired with
* `val compilerVersion = "2.0.0-SNAPSHOT.043"`, or the legacy
* `val versionToPublish by extra(compilerVersion)` paired with
* `val compilerVersion: String by extra("2.0.0-SNAPSHOT.043")`.
*
* The publishing-version property is identified by [keyForValue] using the already-resolved
* project version as an oracle, so the specific property name (`versionToPublish`,
Expand All @@ -56,10 +62,19 @@ internal object VersionGradleFile {
*/
const val NAME = "version.gradle.kts"

// Legacy `by extra(…)` property-delegate spellings (deprecated by Gradle).
private val literalExtra =
Regex("""val\s+(\w+)\s*(?::\s*String)?\s+by\s+extra\(\s*"([^"]+)"\s*\)""")
private val aliasExtra =
Regex("""val\s+(\w+)\s*(?::\s*String)?\s+by\s+extra\(\s*([A-Za-z_]\w*)\s*\)""")

// Current `extra.set("name", …)` spellings.
private val literalSet =
Regex("""extra\.set\(\s*"(\w+)"\s*,\s*"([^"]+)"\s*\)""")
private val aliasSet =
Regex("""extra\.set\(\s*"(\w+)"\s*,\s*([A-Za-z_]\w*)\s*\)""")

// A plain `val name = "value"` that an alias may reference.
private val plainAssignment =
Regex("""val\s+(\w+)\s*(?::\s*String)?\s*=\s*"([^"]+)"""")

Expand All @@ -68,12 +83,12 @@ internal object VersionGradleFile {
* string value.
*/
private fun parse(content: String): Map<String, String> {
val literals = literalExtra.findAll(content)
val literals = (literalExtra.findAll(content) + literalSet.findAll(content))
.associate { it.groupValues[1] to it.groupValues[2] }
val plains = plainAssignment.findAll(content)
.associate { it.groupValues[1] to it.groupValues[2] }
val resolved = literals.toMutableMap()
aliasExtra.findAll(content).forEach { match ->
(aliasExtra.findAll(content) + aliasSet.findAll(content)).forEach { match ->
val name = match.groupValues[1]
val source = match.groupValues[2]
if (name !in resolved) {
Expand Down
12 changes: 12 additions & 0 deletions buildSrc/src/main/kotlin/kmp-module.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ import io.spine.gradle.javac.configureJavac
import io.spine.gradle.kotlin.setFreeCompilerArgs
import io.spine.gradle.publish.IncrementGuard
import io.spine.gradle.report.license.LicenseReporter
import io.spine.gradle.testing.configureLogging

/**
* Configures this [Project] as a Kotlin Multiplatform module.
Expand Down Expand Up @@ -161,11 +162,22 @@ java {
*
* Also, Kotlin and Java share the same test executor (JUnit), so tests
* configuration is for both.
*
* The `jvmTest` task mirrors the setup made by `module-testing` for
* the `test` task of a `jvm-module` (`module-testing` itself cannot be
* applied here because it brings `java-library`, which conflicts with
* the Kotlin Multiplatform plugin). Unlike `module-testing`, no engine
* filter is imposed: `jvmTest` dependencies include the Kotest runner,
* which is a JUnit Platform engine of its own.
*/
tasks {
withType<JavaCompile>().configureEach {
configureJavac()
}
named<Test>("jvmTest") {
useJUnitPlatform()
configureLogging()
}
}

/**
Expand Down
22 changes: 22 additions & 0 deletions buildSrc/src/test/kotlin/io/spine/gradle/VersionGradleFileSpec.kt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,28 @@ internal class VersionGradleFileSpec {
VersionGradleFile.valueForKey(content, "versionToPublish") shouldBe "2.0.0-SNAPSHOT.043"
}

@Test
fun `declared as a literal via 'extra set'`() {
val content = """
extra.set("versionToPublish", "2.0.0-SNAPSHOT.182")
""".trimIndent()

VersionGradleFile.keyForValue(content, "2.0.0-SNAPSHOT.182") shouldBe "versionToPublish"
VersionGradleFile.valueForKey(content, "versionToPublish") shouldBe "2.0.0-SNAPSHOT.182"
}

@Test
fun `declared as an alias via 'extra set'`() {
val content = """
val compilerVersion = "2.0.0-SNAPSHOT.043"
extra.set("compilerVersion", compilerVersion)
extra.set("versionToPublish", compilerVersion)
""".trimIndent()

VersionGradleFile.valueForKey(content, "versionToPublish") shouldBe "2.0.0-SNAPSHOT.043"
VersionGradleFile.valueForKey(content, "compilerVersion") shouldBe "2.0.0-SNAPSHOT.043"
}

@Test
fun `identified by the resolved project version, not a hard-coded name`() {
val content = """
Expand Down
44 changes: 22 additions & 22 deletions docs/dependencies/dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine.tools:compiler-api:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-api:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -1099,14 +1099,14 @@

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-api-tests:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-api-tests:2.0.0-SNAPSHOT.060`

## Runtime
## Compile, tests, and tooling
Expand Down Expand Up @@ -1476,14 +1476,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:16 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:29 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-backend:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-backend:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -2586,14 +2586,14 @@ This report was generated on **Wed Jul 01 16:19:16 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-cli:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-cli:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -3855,14 +3855,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-gradle-api:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-gradle-api:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -4879,14 +4879,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-gradle-plugin:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-gradle-plugin:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -5947,14 +5947,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-jvm:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-jvm:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -7074,14 +7074,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-params:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-params:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -8172,14 +8172,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-protoc-plugin:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-protoc-plugin:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -9012,14 +9012,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-test-env:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-test-env:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -10118,14 +10118,14 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).




# Dependencies of `io.spine.tools:compiler-testlib:2.0.0-SNAPSHOT.059`
# Dependencies of `io.spine.tools:compiler-testlib:2.0.0-SNAPSHOT.060`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -11331,6 +11331,6 @@ This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using

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

This report was generated on **Wed Jul 01 16:19:17 WEST 2026** using
This report was generated on **Mon Jul 06 18:11:30 WEST 2026** 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).
Loading
Loading