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
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,12 @@ package io.spine.dependency.local
@Suppress("ConstPropertyName", "unused")
object ToolBase {
const val group = Spine.toolsGroup
const val version = "2.0.0-SNAPSHOT.333"
const val version = "2.0.0-SNAPSHOT.335"

const val lib = "$group:spine-tool-base:$version"
const val pluginBase = "$group:spine-plugin-base:$version"
const val gradleRootPlugin = "$group:spine-gradle-root-plugin:$version"
const val gradlePluginApi = "$group:spine-gradle-plugin-api:$version"
const val pluginTestlib = "$group:spine-plugin-testlib:$version"

const val intellijPlatformJava = "$group:intellij-platform-java:$version"
Expand Down
44 changes: 22 additions & 22 deletions dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine.compiler:api:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:api:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -1046,12 +1046,12 @@

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:api-tests:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:api-tests:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 13.0.
Expand Down Expand Up @@ -1836,12 +1836,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:backend:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:backend:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -2887,12 +2887,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:cli:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:cli:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -3962,12 +3962,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:gradle-api:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:gradle-api:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -4948,12 +4948,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:gradle-plugin:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:gradle-plugin:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -5982,12 +5982,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:jvm:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:jvm:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -7033,12 +7033,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:params:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:params:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -8076,12 +8076,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:protoc-plugin:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:protoc-plugin:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -8884,12 +8884,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:test-env:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:test-env:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -9931,12 +9931,12 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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.compiler:testlib:2.0.0-SNAPSHOT.007`
# Dependencies of `io.spine.compiler:testlib:2.0.0-SNAPSHOT.008`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.18.3.
Expand Down Expand Up @@ -11080,4 +11080,4 @@ This report was generated on **Tue May 27 20:07:11 WEST 2025** using [Gradle-Lic

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

This report was generated on **Tue May 27 20:07:11 WEST 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).
This report was generated on **Tue Jun 03 18:11:05 WEST 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).
1 change: 1 addition & 0 deletions gradle-api/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ dependencies {
compileOnly(gradleApi())

implementation(ToolBase.pluginBase)
implementation(ToolBase.gradlePluginApi)
implementation(project(":api"))
implementation(project(":params"))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ package io.spine.compiler.gradle.api
import org.gradle.api.file.DirectoryProperty

/**
* Configures the code generation process performed by ProtoData.
* Configures the code generation process performed by the Compiler.
*/
public interface CodegenSettings {
public interface CompilerSettings {

/**
* Passes given names of Java classes to ProtoData as
* the `io.spine.compiler.plugin.Plugin` classes.
* Passes given names of Java classes to the Compiler as classes
* extending the `io.spine.compiler.plugin.Plugin` class.
*/
public fun plugins(vararg classNames: String)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
package io.spine.compiler.gradle.api

/**
* The name of various objects in ProtoData Gradle API.
* The name of various objects in Spine Compiler Gradle API.
*/
public object Names {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,31 +26,33 @@

package io.spine.compiler.gradle.api

import org.gradle.api.Project
import io.spine.compiler.params.Directories.PROTODATA_WORKING_DIR
import io.spine.compiler.params.Directories.COMPILER_WORKING_DIR
import io.spine.tools.gradle.lib.spineExtension
import io.spine.tools.gradle.root.rootWorkingDir
import java.io.File
import java.nio.file.Path
import org.gradle.api.Project
import org.gradle.api.file.Directory
import org.gradle.api.tasks.SourceSet

/**
* Obtains the directory where ProtoData stores its temporary files.
*/
public val Project.compilerWorkingDir: Directory
get() = layout.buildDirectory.dir(PROTODATA_WORKING_DIR).get()
get() = rootWorkingDir.dir(COMPILER_WORKING_DIR)

/**
* Obtains the instance of [CodegenSettings] extension of this project.
* Obtains the instance of [CompilerSettings] extension of this project.
*/
public val Project.codegenSettings: CodegenSettings
get() = extensions.findByType(CodegenSettings::class.java)!!
public val Project.compilerSettings: CompilerSettings
get() = spineExtension<CompilerSettings>()

/**
* Obtains the path of the directory with the generated code as configured by
* the [CodegenSettings.outputBaseDir] property of the ProtoData extension of this Gradle project.
* the [CompilerSettings.outputBaseDir] property of the ProtoData extension of this Gradle project.
*/
public val Project.generatedDir: Path
get() = codegenSettings.outputBaseDir.get().asFile.toPath()
get() = compilerSettings.outputBaseDir.get().asFile.toPath()

/**
* Obtains the `generated` directory for the given [sourceSet] and a language.
Expand Down
7 changes: 5 additions & 2 deletions gradle-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -72,13 +72,14 @@ testing {
}

dependencies {
api(project(":gradle-api"))

compileOnly(gradleApi())
compileOnly(gradleKotlinDsl())
compileOnly(Protobuf.GradlePlugin.lib)
compileOnly(Kotlin.GradlePlugin.api)

api(project(":gradle-api"))
api(ToolBase.gradlePluginApi)

implementation(project(":api"))
implementation(project(":params"))
implementation(ToolBase.lib)
Expand All @@ -89,6 +90,7 @@ dependencies {
* Make functional tests depend on publishing all the submodules to Maven Local so that
* the Gradle plugin can get all the dependencies when it's applied to the test projects.
*/
@Suppress("unused")
val functionalTest: Task by tasks.getting {
val task = this
productionModules.forEach { subproject ->
Expand All @@ -108,6 +110,7 @@ val publishPlugins: Task by tasks.getting {
enabled = !isSnapshot
}

@Suppress("unused")
val publish: Task by tasks.getting {
if (!isSnapshot) {
dependsOn(publishPlugins)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,49 @@ class PluginSpec {
generatedKotlinDir = generatedMainDir.resolve("kotlin")
}

private fun createProject(resourceDir: String) {
val version = Plugin.readVersion()
val builder = GradleProject.setupAt(projectDir)
.fromResources(resourceDir)
.withSharedTestKitDirectory()
.replace("@COMPILER_PLUGIN_ID@", GRADLE_PLUGIN_ID)
.replace("@COMPILER_VERSION@", version)
.withLoggingLevel(LogLevel.INFO)
/* Uncomment the following if you need to debug the build process.
Please note that:
1) Test will run much slower.
2) Under Windows it may cause this issue to occur:
https://github.com/gradle/native-platform/issues/274
After finishing the debug, please comment out this call again. */
//.enableRunnerDebug()
.copyBuildSrc()
project = builder.create()
(project.runner as DefaultGradleRunner).withJvmArguments(
"-Xmx8g",
"-XX:MaxMetaspaceSize=1512m",
"-XX:+UseParallelGC",
"-XX:+HeapDumpOnOutOfMemoryError"
)
}

private fun createEmptyProject() {
createProject("empty-test")
}

private fun createLaunchTestProject() {
createProject("launch-test")
}

private fun launchAndExpectResult(expected: TaskOutcome) {
val result = launch()

val outcome = result[launchSpineCompiler]
outcome shouldBe expected
}

private fun launch(): BuildResult =
project.executeTask(launchSpineCompiler)

/**
* Since there are no `proto` files in this project, the request file is
* not created, resulting in the [SKIPPED] status of the [launchSpineCompiler] task.
Expand All @@ -87,7 +130,7 @@ class PluginSpec {
}

@Test
fun `launch ProtoData`() {
fun `launch the compiler task`() {
createLaunchTestProject()
launchAndExpectResult(SUCCESS)
}
Expand Down Expand Up @@ -168,49 +211,6 @@ class PluginSpec {
assertExists(generatedGrpcDir)
assertExists(generatedGrpcDir.resolve(serviceClass))
}

private fun createEmptyProject() {
createProject("empty-test")
}

private fun createLaunchTestProject() {
createProject("launch-test")
}

private fun launchAndExpectResult(expected: TaskOutcome) {
val result = launch()

val outcome = result[launchSpineCompiler]
outcome shouldBe expected
}

private fun launch(): BuildResult =
project.executeTask(launchSpineCompiler)

private fun createProject(resourceDir: String) {
val version = Plugin.readVersion()
val builder = GradleProject.setupAt(projectDir)
.fromResources(resourceDir)
.withSharedTestKitDirectory()
.replace("@PROTODATA_PLUGIN_ID@", GRADLE_PLUGIN_ID)
.replace("@PROTODATA_VERSION@", version)
.withLoggingLevel(LogLevel.INFO)
/* Uncomment the following if you need to debug the build process.
Please note that:
1) Test will run much slower.
2) Under Windows it may cause this issue to occur:
https://github.com/gradle/native-platform/issues/274
After finishing the debug, please comment out this call again. */
//.enableRunnerDebug()
.copyBuildSrc()
project = builder.create()
(project.runner as DefaultGradleRunner).withJvmArguments(
"-Xmx8g",
"-XX:MaxMetaspaceSize=1512m",
"-XX:+UseParallelGC",
"-XX:+HeapDumpOnOutOfMemoryError"
)
}
}

/**
Expand Down
Loading
Loading