diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt index 304ea7a1a..1a2afc1b1 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/McJava.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -42,12 +42,12 @@ object McJava { /** * The version used to in the build classpath. */ - const val dogfoodingVersion = "2.0.0-SNAPSHOT.259" + const val dogfoodingVersion = "2.0.0-SNAPSHOT.260" /** * The version to be used for integration tests. */ - const val version = "2.0.0-SNAPSHOT.259" + const val version = "2.0.0-SNAPSHOT.260" /** * The ID of the Gradle plugin. diff --git a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt index d28b069e3..45c00431c 100644 --- a/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt +++ b/buildSrc/src/main/kotlin/io/spine/dependency/local/ProtoData.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -73,7 +73,7 @@ object ProtoData { * The version of ProtoData dependencies. */ val version: String - private const val fallbackVersion = "0.80.1" + private const val fallbackVersion = "0.90.0" /** * The distinct version of ProtoData used by other build tools. @@ -106,6 +106,9 @@ object ProtoData { val backend get() = "$group:protodata-backend:$version" + val params + get() = "$group:protodata-params:$version" + val protocPlugin get() = "$group:protodata-protoc:$version" diff --git a/dependencies.md b/dependencies.md index 6b89283e8..d93001220 100644 --- a/dependencies.md +++ b/dependencies.md @@ -1,6 +1,6 @@ -# Dependencies of `io.spine.tools:spine-mc-java:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -1030,12 +1030,12 @@ The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:09 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:11 WET 2025** 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:spine-mc-java-annotation:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-annotation:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -1937,12 +1937,12 @@ This report was generated on **Mon Dec 30 19:14:09 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:09 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:12 WET 2025** 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:spine-mc-java-base:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-base:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -2844,12 +2844,12 @@ This report was generated on **Mon Dec 30 19:14:09 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:09 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:12 WET 2025** 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:spine-mc-java-checks:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-checks:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -3660,12 +3660,12 @@ This report was generated on **Mon Dec 30 19:14:09 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:10 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:13 WET 2025** 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:spine-mc-java-comparable:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-comparable:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -4567,12 +4567,12 @@ This report was generated on **Mon Dec 30 19:14:10 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:10 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:13 WET 2025** 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:spine-mc-java-comparable-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-comparable-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -5340,12 +5340,12 @@ This report was generated on **Mon Dec 30 19:14:10 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:10 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:13 WET 2025** 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:spine-mc-java-entity:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-entity:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -6247,12 +6247,12 @@ This report was generated on **Mon Dec 30 19:14:10 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:11 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:13 WET 2025** 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:spine-mc-java-entity-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-entity-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -7020,12 +7020,12 @@ This report was generated on **Mon Dec 30 19:14:11 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:11 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:14 WET 2025** 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:spine-mc-java-marker:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-marker:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -7927,12 +7927,12 @@ This report was generated on **Mon Dec 30 19:14:11 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:11 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:14 WET 2025** 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:spine-mc-java-marker-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-marker-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -8700,12 +8700,12 @@ This report was generated on **Mon Dec 30 19:14:11 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:11 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:14 WET 2025** 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:spine-mc-java-message-group:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-message-group:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -9607,12 +9607,12 @@ This report was generated on **Mon Dec 30 19:14:11 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:12 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:15 WET 2025** 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:spine-mc-java-message-group-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-message-group-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -10380,12 +10380,12 @@ This report was generated on **Mon Dec 30 19:14:12 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:12 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:15 WET 2025** 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:spine-mc-java-plugin-bundle:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-plugin-bundle:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : aopalliance. **Name** : aopalliance. **Version** : 1.0. @@ -11366,12 +11366,12 @@ This report was generated on **Mon Dec 30 19:14:12 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:12 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:15 WET 2025** 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:spine-mc-java-signal:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-signal:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -12273,12 +12273,12 @@ This report was generated on **Mon Dec 30 19:14:12 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:12 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:15 WET 2025** 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:spine-mc-java-signal-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-signal-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -13046,12 +13046,12 @@ This report was generated on **Mon Dec 30 19:14:12 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:13 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:16 WET 2025** 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:spine-mc-java-uuid:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-uuid:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.15.3. @@ -13953,12 +13953,12 @@ This report was generated on **Mon Dec 30 19:14:13 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:13 WET 2024** 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). +This report was generated on **Fri Jan 03 19:45:16 WET 2025** 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:spine-mc-java-uuid-tests:2.0.0-SNAPSHOT.260` +# Dependencies of `io.spine.tools:spine-mc-java-uuid-tests:2.0.0-SNAPSHOT.261` ## Runtime 1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2. @@ -14726,4 +14726,4 @@ This report was generated on **Mon Dec 30 19:14:13 WET 2024** using [Gradle-Lice The dependencies distributed under several licenses, are used according their commercial-use-friendly license. -This report was generated on **Mon Dec 30 19:14:13 WET 2024** 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). \ No newline at end of file +This report was generated on **Fri Jan 03 19:45:16 WET 2025** 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). \ No newline at end of file diff --git a/mc-java-annotation/build.gradle.kts b/mc-java-annotation/build.gradle.kts index 52ab59a14..3bcd456a5 100644 --- a/mc-java-annotation/build.gradle.kts +++ b/mc-java-annotation/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -27,6 +27,7 @@ import io.spine.dependency.lib.Roaster import io.spine.dependency.local.Logging import io.spine.dependency.local.Spine +import io.spine.dependency.local.TestLib import io.spine.dependency.local.ToolBase plugins { @@ -39,7 +40,7 @@ dependencies { implementation(Logging.lib) testFixturesImplementation(ToolBase.lib) - testFixturesImplementation(Spine.testlib) + testFixturesImplementation(TestLib.lib) val guavaGroup = "com.google.guava" testFixturesImplementation(Roaster.api) { diff --git a/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt b/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt index afecbcb32..1b0ca4eab 100644 --- a/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt +++ b/mc-java-base/src/testFixtures/kotlin/io/spine/tools/mc/java/PluginTestSetup.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -30,14 +30,20 @@ import com.google.protobuf.Message import io.kotest.matchers.shouldBe import io.kotest.matchers.shouldNotBe import io.spine.protodata.java.style.JavaCodeStyleFormatterPlugin +import io.spine.protodata.params.Directories +import io.spine.protodata.params.WorkingDirectory import io.spine.protodata.plugin.Plugin import io.spine.protodata.render.SourceFile import io.spine.protodata.render.SourceFileSet -import io.spine.protodata.settings.Format +import io.spine.protodata.util.Format import io.spine.protodata.settings.SettingsDirectory import io.spine.protodata.testing.PipelineSetup import io.spine.protodata.testing.PipelineSetup.Companion.byResources +import io.spine.protodata.testing.pipelineParams +import io.spine.protodata.testing.withRequestFile +import io.spine.protodata.testing.withSettingsDir import io.spine.tools.code.Java +import io.spine.tools.code.SourceSetName import io.spine.tools.mc.java.gradle.settings.CodegenSettings import io.spine.type.toJson import java.nio.file.Path @@ -92,18 +98,27 @@ abstract class PluginTestSetup( /** * Creates an instance of [PipelineSetup] with the given parameters. * - * [settings] will be written to the [settingsDir] before creation of - * a [Pipeline][io.spine.protodata.backend.Pipeline]. + * [settings] will be written to the [WorkingDirectory.settingsDirectory] before + * creation of a [Pipeline][io.spine.protodata.backend.Pipeline]. */ - fun setup(outputDir: Path, settingsDir: Path, settings: S): PipelineSetup { + fun setup(projectDir: Path, settings: S): PipelineSetup { + val workingDir = projectDir.resolve("build").resolve(Directories.PROTODATA_WORKING_DIR) + val workingDirectory = WorkingDirectory(workingDir) + val requestFile = workingDirectory.requestDirectory.file(SourceSetName("testFixtures")) + val params = pipelineParams { + withRequestFile(requestFile) + withSettingsDir(workingDirectory.settingsDirectory.path) + } + val outputDir = projectDir.resolve("output") + outputDir.toFile().mkdirs() val setup = byResources( - listOf( + params = params, + plugins = listOf( plugin, - // We want to be able to see the code in debug with human eyes. Mercy!.. + // We want to be able to see the code in debug formatted for easier reading. JavaCodeStyleFormatterPlugin() ), - outputDir, - settingsDir + outputRoot = outputDir, ) { writeSettings(it, settings) } @@ -119,14 +134,14 @@ abstract class PluginTestSetup( * * @see createSettings */ - fun runPipeline(projectDir: Path, outputDir: Path, settingsDir: Path) { + fun runPipeline(projectDir: Path) { // Clear the cache of previously parsed files to avoid repeated code generation. SourceFile.clearCache() val settings = createSettings(projectDir) - val setup = setup(outputDir, settingsDir, settings) + val setup = setup(projectDir, settings) val pipeline = setup.createPipeline() pipeline() - this.sourceFileSet = setup.sourceFileSet + this.sourceFileSet = pipeline.sources[0] } /** diff --git a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt index 08a29e06a..65b5d4ace 100644 --- a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt +++ b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddComparatorSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -75,13 +75,9 @@ internal class AddComparatorSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { + fun setup(@TempDir projectDir: Path) { withLoggingMutedIn(AddComparator::class.java.packageName) { - runPipeline(projectDir, outputDir, settingsDir) + runPipeline(projectDir) } } } diff --git a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddCompareToSpec.kt b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddCompareToSpec.kt index 78006aded..430311598 100644 --- a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddCompareToSpec.kt +++ b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/AddCompareToSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -46,11 +46,7 @@ internal class AddCompareToSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) = runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) = runPipeline(projectDir) } @Test diff --git a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/ImplementComparableSpec.kt b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/ImplementComparableSpec.kt index 3305e6ff3..307a65293 100644 --- a/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/ImplementComparableSpec.kt +++ b/mc-java-comparable-tests/src/test/kotlin/io/spine/tools/mc/java/comparable/ImplementComparableSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -45,11 +45,7 @@ internal class ImplementComparableSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) = runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) = runPipeline(projectDir) } @Test diff --git a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClassSpec.kt b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClassSpec.kt index dbf0b2b7d..37f292eca 100644 --- a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClassSpec.kt +++ b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/column/AddColumnClassSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -58,12 +58,8 @@ internal class AddColumnClassSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path(DEPARTMENT_JAVA)) entityStateCode = sourceFile.code() psiFile = sourceFile.psi() as PsiJavaFile diff --git a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/field/AddFieldClassSpec.kt b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/field/AddFieldClassSpec.kt index 2201fa8e9..b84e9334e 100644 --- a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/field/AddFieldClassSpec.kt +++ b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/field/AddFieldClassSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -57,12 +57,8 @@ internal class AddFieldClassSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path(DEPARTMENT_JAVA)) entityStateCode = sourceFile.code() psiFile = sourceFile.psi() as PsiJavaFile diff --git a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryBuilderClassSpec.kt b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryBuilderClassSpec.kt index caf5cad09..c39d2308d 100644 --- a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryBuilderClassSpec.kt +++ b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryBuilderClassSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -59,12 +59,8 @@ internal class QueryBuilderClassSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path(DEPARTMENT_JAVA)) val psiFile = sourceFile.psi() as PsiJavaFile entityStateClass = psiFile.topLevelClass diff --git a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryClassSpec.kt b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryClassSpec.kt index a5a5b6413..0258de47c 100644 --- a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryClassSpec.kt +++ b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryClassSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -51,12 +51,8 @@ internal class QueryClassSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path(DEPARTMENT_JAVA)) val psiFile = sourceFile.psi() as PsiJavaFile entityStateClass = psiFile.topLevelClass diff --git a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryMethodSpec.kt b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryMethodSpec.kt index 80621e996..9fcad6615 100644 --- a/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryMethodSpec.kt +++ b/mc-java-entity-tests/src/test/kotlin/io/spine/tools/mc/java/entity/query/QueryMethodSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -51,12 +51,8 @@ internal class QueryMethodSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path(DEPARTMENT_JAVA)) psiFile = sourceFile.psi() as PsiJavaFile } diff --git a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt index 0ec62cb52..337631107 100644 --- a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt +++ b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/EveryIsOptionRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -48,12 +48,8 @@ internal class EveryIsOptionRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - generateCode(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + generateCode(projectDir) } } diff --git a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/IsOptionRendererSpec.kt b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/IsOptionRendererSpec.kt index ce2ef1f77..272b0a959 100644 --- a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/IsOptionRendererSpec.kt +++ b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/IsOptionRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -41,12 +41,8 @@ internal class IsOptionRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - generateCode(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + generateCode(projectDir) } } diff --git a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/MarkerPluginTestSetup.kt b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/MarkerPluginTestSetup.kt index 0cab0c5f7..ddbd8d390 100644 --- a/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/MarkerPluginTestSetup.kt +++ b/mc-java-marker-tests/src/test/kotlin/io/spne/mc/java/marker/MarkerPluginTestSetup.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -55,11 +55,7 @@ internal abstract class MarkerPluginTestSetup : PluginTestSetup(MarkerPlu override fun createSettings(projectDir: Path): Empty = Empty.getDefaultInstance() - fun generateCode( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun generateCode(@TempDir projectDir: Path) { + runPipeline(projectDir) } } diff --git a/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRendererSpec.kt b/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRendererSpec.kt index d13a420a4..c17215cb0 100644 --- a/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRendererSpec.kt +++ b/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/GroupedMessageRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -49,16 +49,12 @@ internal class GroupedMessageRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { + fun setup(@TempDir projectDir: Path) { val settings = createSettings(projectDir) - val setup = setup(outputDir, settingsDir, settings) + val setup = setup(projectDir, settings) val pipeline = setup.createPipeline() pipeline() - val sourceFileSet = setup.sourceFileSet + val sourceFileSet = pipeline.sources[0] code = sourceFileSet.find( Path("io/spine/tools/mc/mgroup/given/Student.java") )!!.code() diff --git a/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/OneofFieldCodegenSpec.kt b/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/OneofFieldCodegenSpec.kt index bc6bcecd4..12fe09e67 100644 --- a/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/OneofFieldCodegenSpec.kt +++ b/mc-java-message-group-tests/src/test/kotlin/io/spine/tools/mc/java/mgroup/OneofFieldCodegenSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -55,12 +55,8 @@ internal class OneofFieldCodegenSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val file = file(Path("io/spine/given/core/EventContext.java")) code = file.code() } diff --git a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/CommandRendererSpec.kt b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/CommandRendererSpec.kt index 643b19520..1e2cd2a2d 100644 --- a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/CommandRendererSpec.kt +++ b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/CommandRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -47,12 +47,8 @@ internal class CommandRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path("io/spine/tools/mc/signal/given/command/StartScanning.java")) commandCode = sourceFile.code() } diff --git a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/EventRendererSpec.kt b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/EventRendererSpec.kt index fd1ba00c8..dcd28d9b6 100644 --- a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/EventRendererSpec.kt +++ b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/EventRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -48,12 +48,8 @@ internal class EventRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path("io/spine/tools/mc/signal/given/event/ScanningStarted.java")) eventCode = sourceFile.code() } diff --git a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/RejectionRendererSpec.kt b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/RejectionRendererSpec.kt index a35da24bf..0604872de 100644 --- a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/RejectionRendererSpec.kt +++ b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/RejectionRendererSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -54,12 +54,8 @@ internal class RejectionRendererSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path("io/spine/tools/mc/signal/given/rejection/Rejections.java")) rejectionCode = sourceFile.code() } diff --git a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/SignalDiscoverySpec.kt b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/SignalDiscoverySpec.kt index 1e948bde8..537c4a502 100644 --- a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/SignalDiscoverySpec.kt +++ b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/SignalDiscoverySpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -59,13 +59,9 @@ internal class SignalDiscoverySpec { @BeforeAll @JvmStatic - fun run( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { + fun run(@TempDir projectDir: Path) { val signalSettings = createSettings(projectDir) - setup = setup(outputDir, settingsDir, signalSettings) + setup = setup(projectDir, signalSettings) val (p, b) = setup.createPipelineWithBlackBox() pipeline = p blackbox = b @@ -102,7 +98,7 @@ internal class SignalDiscoverySpec { } // Create a file set with the descriptors for the proto files. - val fileSet = FileSet.of(setup.request.sourceFileDescriptorsList) + val fileSet = FileSet.of(pipeline.request.sourceFileDescriptorsList) fileSet.files().forEach { it.assertIfMatches(COMMANDS, CommandActions::class.java) diff --git a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/rejection/TypesTestEnv.kt b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/rejection/TypesTestEnv.kt index a2695802b..52634e190 100644 --- a/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/rejection/TypesTestEnv.kt +++ b/mc-java-signal-tests/src/test/kotlin/io/spine/tools/mc/java/signal/rejection/TypesTestEnv.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -54,8 +54,10 @@ import io.spine.protodata.ast.protoFileHeader import io.spine.protodata.ast.protobufSourceFile import io.spine.protodata.ast.service import io.spine.protodata.ast.serviceName +import io.spine.protodata.ast.toPath import io.spine.protodata.ast.type import io.spine.protodata.ast.typeName +import io.spine.protodata.protobuf.ProtoFileList import io.spine.protodata.type.TypeSystem import io.spine.protodata.value.pack import io.spine.protodata.ast.enumType as newEnumType @@ -190,10 +192,16 @@ object TypesTestEnv { header = rejectionsProtoHeader type.put(rejectionTypeName.typeUrl, rejectionType) } - TypeSystem(setOf( + val compiledProtoFiles = ProtoFileList( + listOf(protoSourceMultiple, protoSourceSingle, rejectionsFile).map { + it.toPath().toFile() + } + ) + val definitions = setOf( multipleFilesProto, singleFileProto, rejections - )) + ) + TypeSystem(compiledProtoFiles, definitions) } } diff --git a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt index a12373eca..a04c496a9 100644 --- a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt +++ b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/AddFactoryMethodsSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -48,12 +48,8 @@ internal class AddFactoryMethodsSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - generateCode(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) { + generateCode(projectDir) } } diff --git a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/ImplementUuidValueSpec.kt b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/ImplementUuidValueSpec.kt index 89aeb0072..c32ab864e 100644 --- a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/ImplementUuidValueSpec.kt +++ b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/ImplementUuidValueSpec.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -48,11 +48,7 @@ internal class ImplementUuidValueSpec { @BeforeAll @JvmStatic - fun setup( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) = generateCode(projectDir, outputDir, settingsDir) + fun setup(@TempDir projectDir: Path) = generateCode(projectDir) } @Test diff --git a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/UuidPluginTestSetup.kt b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/UuidPluginTestSetup.kt index 8d782f9c6..f7beed968 100644 --- a/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/UuidPluginTestSetup.kt +++ b/mc-java-uuid-tests/src/test/kotlin/io/spine/tools/mc/java/uuid/UuidPluginTestSetup.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -66,12 +66,8 @@ abstract class UuidPluginTestSetup( } } - fun generateCode( - @TempDir projectDir: Path, - @TempDir outputDir: Path, - @TempDir settingsDir: Path - ) { - runPipeline(projectDir, outputDir, settingsDir) + fun generateCode(@TempDir projectDir: Path) { + runPipeline(projectDir) val sourceFile = file(Path("io/spine/tools/mc/java/uuid/given/$uuidType.java")) generatedCode = sourceFile.code() val file = sourceFile.psi() as PsiJavaFile diff --git a/mc-java/build.gradle.kts b/mc-java/build.gradle.kts index 5ff7da29e..d05402512 100644 --- a/mc-java/build.gradle.kts +++ b/mc-java/build.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -27,16 +27,17 @@ import io.spine.dependency.lib.Grpc import io.spine.dependency.lib.Protobuf import io.spine.dependency.local.ProtoData -import io.spine.dependency.local.Spine +import io.spine.dependency.local.TestLib import io.spine.dependency.local.ToolBase import io.spine.dependency.local.Validation import io.spine.gradle.WriteVersions dependencies { implementation(ProtoData.pluginLib) + implementation(ProtoData.params) - // We access the Protobuf Gradle Plugin extension, so we need it as a dependency. implementation(Protobuf.GradlePlugin.lib) + ?.because("We access the Protobuf Gradle Plugin extension.") // Module dependencies listOf( @@ -58,7 +59,7 @@ dependencies { gradleApi(), gradleKotlinDsl(), gradleTestKit(), - Spine.testlib, + TestLib.lib, ToolBase.pluginTestlib, testFixtures(project(":mc-java-base")) ).forEach { diff --git a/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/ProtoDataConfigPlugin.kt b/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/ProtoDataConfigPlugin.kt index e62561b21..bd8388c8a 100644 --- a/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/ProtoDataConfigPlugin.kt +++ b/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/ProtoDataConfigPlugin.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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. @@ -30,9 +30,10 @@ package io.spine.tools.mc.java.gradle.plugins import io.spine.protodata.gradle.Names import io.spine.protodata.gradle.Names.GRADLE_PLUGIN_ID -import io.spine.protodata.gradle.plugin.CreateSettingsDirectory import io.spine.protodata.gradle.plugin.LaunchProtoData import io.spine.protodata.java.style.JavaCodeStyleFormatterPlugin +import io.spine.protodata.params.Directories.PROTODATA_WORKING_DIR +import io.spine.protodata.params.WorkingDirectory import io.spine.tools.fs.DirectoryName import io.spine.tools.gradle.Artifact import io.spine.tools.mc.annotation.ApiAnnotationsPlugin @@ -51,7 +52,6 @@ import io.spine.tools.mc.java.mgroup.MessageGroupPlugin import io.spine.tools.mc.java.signal.SignalPlugin import io.spine.tools.mc.java.signal.rejection.RThrowablePlugin import io.spine.tools.mc.java.uuid.UuidPlugin -import io.spine.util.theOnly import org.gradle.api.Plugin import org.gradle.api.Project import org.gradle.api.artifacts.Dependency @@ -117,16 +117,20 @@ private fun Project.configureProtoData() { } private fun Project.createWriteSettingsTask(): WriteProtoDataSettings { - val settingsDirTask = tasks.withType(CreateSettingsDirectory::class.java).theOnly() + //TODO:2025-01-03:alexander.yevsyukov: Migrate to project extensions from ProtoData. + // See `io.spine.protodata.gradle.plugin.ProjectExts.kt`. val result = tasks.create(WRITE_PROTODATA_SETTINGS, WriteProtoDataSettings::class.java) { - it.settingsDir.set(settingsDirTask.settingsDir.get()) - it.dependsOn(settingsDirTask) + val wd = layout.buildDirectory.dir(PROTODATA_WORKING_DIR).get() + val workingDir = WorkingDirectory(wd.asFile.toPath()) + it.settingsDir.set(project.layout.dir( + provider { workingDir.settingsDirectory.path.toFile() } + )) } return result } /** - * Configures ProtoData with plugins, for the given Gradle project. + * Configures ProtoData with plugins for the given Gradle project. */ private fun Project.configureProtoDataPlugins() { // Pass the uber JAR of McJava so that plugins from all the submodules are available. diff --git a/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/WriteProtoDataSettings.kt b/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/WriteProtoDataSettings.kt index fb923b836..a6470dd98 100644 --- a/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/WriteProtoDataSettings.kt +++ b/mc-java/src/main/kotlin/io/spine/tools/mc/java/gradle/plugins/WriteProtoDataSettings.kt @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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,7 +31,7 @@ package io.spine.tools.mc.java.gradle.plugins import com.google.protobuf.Message import io.spine.protodata.java.style.JavaCodeStyle -import io.spine.protodata.settings.Format +import io.spine.protodata.util.Format import io.spine.protodata.settings.SettingsDirectory import io.spine.tools.mc.annotation.ApiAnnotationsPlugin import io.spine.tools.mc.java.annotation.SettingsKt.annotationTypes diff --git a/pom.xml b/pom.xml index 501e9489c..b62abb520 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject. --> io.spine.tools mc-java -2.0.0-SNAPSHOT.260 +2.0.0-SNAPSHOT.261 2015 @@ -38,7 +38,7 @@ all modules and does not describe the project structure per-subproject. io.spine protodata - 0.80.1 + 0.90.0 compile @@ -68,7 +68,13 @@ all modules and does not describe the project structure per-subproject. io.spine.protodata protodata-java - 0.80.1 + 0.90.0 + compile + + + io.spine.protodata + protodata-params + 0.90.0 compile @@ -146,7 +152,7 @@ all modules and does not describe the project structure per-subproject. io.spine.protodata protodata-testlib - 0.80.1 + 0.90.0 test @@ -281,13 +287,13 @@ all modules and does not describe the project structure per-subproject. io.spine.tools spine-mc-java-checks - 2.0.0-SNAPSHOT.259 + 2.0.0-SNAPSHOT.260 provided io.spine.tools spine-mc-java-plugins - 2.0.0-SNAPSHOT.259 + 2.0.0-SNAPSHOT.260 io.spine.validation diff --git a/version.gradle.kts b/version.gradle.kts index 13f57c4a2..3cdbeb9ff 100644 --- a/version.gradle.kts +++ b/version.gradle.kts @@ -1,5 +1,5 @@ /* - * Copyright 2024, TeamDev. All rights reserved. + * Copyright 2025, 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,5 +31,5 @@ * * For versions of Spine-based dependencies please see [io.spine.internal.dependency.spine]. */ -val mcJavaVersion by extra("2.0.0-SNAPSHOT.260") +val mcJavaVersion by extra("2.0.0-SNAPSHOT.261") val versionToPublish by extra(mcJavaVersion)