gradle-semver-plugin
gradle-semver-plugin copied to clipboard
Error when trying to use custom configuration
When trying to use a custom configuration like the one in the README (with some changes to avoid compile errors):
semver {
tagPrefix("")
versionModifier { nextMinor() }
versionCalculatorStrategy(
listOf(
BranchMatchingConfiguration(
"""^main$""".toRegex(),
GitRef.Branch.MAIN,
{ PreReleaseLabel("") to BuildMetadataLabel("") },
{ nextMinor() })
)
)
}
version = semver.version
The gradle build fails with:
FAILURE: Build failed with an exception.
* Where:
Build file '/test-project/build.gradle.kts' line: 67
* What went wrong:
Could not isolate value com.figure.gradle.semver.internal.valuesources.GitCalculateSemverValueSource$Params_Decorated@5d4dbefd of type GitCalculateSemverValueSource.Params
> Could not serialize value of type BranchMatchingConfiguration
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 9.0.
You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.
For more on this, please refer to https://docs.gradle.org/8.5/userguide/command_line_interface.html#sec:command_line_warnings in the Gradle documentation.
BUILD FAILED in 349ms
I am not versed in Kotlin, and every tip of help will be appreciated.