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
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine.chords:spine-chords-gradle-plugin:1.9.21`
# Dependencies of `io.spine.chords:spine-chords-gradle-plugin:1.9.22`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -751,4 +751,4 @@

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

This report was generated on **Mon Dec 29 10:48:38 EET 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 **Sat Apr 25 01:52:04 EEST 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).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024, 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.
Expand Down Expand Up @@ -35,6 +35,7 @@ package io.spine.chords.gradle
*/
internal fun generateGradleBuildFile(
pluginId: String,
codegenPluginsArtifact: String,
spineArtifactsRepo: String
): String = """

Expand All @@ -51,8 +52,7 @@ repositories {

chordsGradlePlugin {
protoDependencies("io.spine:spine-money:1.5.0")
codegenPluginsArtifact =
"io.spine.chords:spine-chords-codegen-plugins:2.0.0-SNAPSHOT.81"
codegenPluginsArtifact = "$codegenPluginsArtifact"
}

""".trimIndent()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024, 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.
Expand Down Expand Up @@ -27,12 +27,13 @@
package io.spine.chords.gradle

import io.kotest.assertions.withClue
import io.kotest.matchers.ints.shouldBeGreaterThan
import io.kotest.matchers.shouldBe
import java.io.File
import java.io.FileWriter
import org.gradle.testkit.runner.GradleRunner
import org.junit.jupiter.api.DisplayName
import org.junit.jupiter.api.Test
import java.io.File
import java.io.FileWriter

/**
* The functional test for `io.spine.chords.gradle` Gradle plugin.
Expand All @@ -47,6 +48,19 @@ class GradlePluginSpec {
*/
private const val pluginId = "io.spine.chords"

/**
* The Chords `codegen-plugins` dependency to generate the code with.
*/
private object CodegenPlugins {
private const val group = "io.spine.chords"
private const val prefix = "spine-chords-"

// The latest version as of 2026-04-24.
private const val version = "2.0.0-SNAPSHOT.85"

const val artifact = "$group:${prefix}codegen-plugins:$version"
}

/**
* The Spine cloud artifacts repo to load the `codegen-plugins` from.
*/
Expand Down Expand Up @@ -78,7 +92,11 @@ class GradlePluginSpec {

File(projectDir, "settings.gradle.kts").writeText("")
File(projectDir, "build.gradle.kts").writeText(
generateGradleBuildFile(pluginId, spineArtifactsRepo)
generateGradleBuildFile(
pluginId,
CodegenPlugins.artifact,
spineArtifactsRepo
)
)
File(projectDir, sourceProtoFile).writeText(
protoFileContent
Expand All @@ -100,8 +118,12 @@ class GradlePluginSpec {
result.output.contains(message) shouldBe true
}

val expectedFile = File(projectDir, expectedKotlinFile)
withClue("The required Kotlin file has not been generated.") {
File(projectDir, expectedKotlinFile).exists() shouldBe true
expectedFile.exists() shouldBe true
}
withClue("The generated Kotlin file is empty.") {
expectedFile.readText().length shouldBeGreaterThan 0
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,29 @@
/*
* 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.chords.gradle

import java.io.File
Expand Down Expand Up @@ -50,7 +76,7 @@ public open class ApplyCodegenPlugins : DefaultTask() {
public var sourceModuleDir: String = project.projectDir.path

/**
* Dependencies that should be added to classpath of codegen module
* Dependencies that should be added to the classpath of the codegen module
* to read the necessary Proto files.
*/
private val dependencies: MutableSet<String> = mutableSetOf()
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject.
-->
<groupId>io.spine.chords</groupId>
<artifactId>Chords-Gradle-plugin</artifactId>
<version>1.9.21</version>
<version>1.9.22</version>

<inceptionYear>2015</inceptionYear>

Expand Down
4 changes: 2 additions & 2 deletions version.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2024, 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.
Expand Down Expand Up @@ -33,4 +33,4 @@
*
* The version should be updated to `2.0.x` after migrating to Spine `2.0.x`.
*/
val gradlePluginVersion: String by extra("1.9.21")
val gradlePluginVersion: String by extra("1.9.22")
Loading