Capture version at configuration time to avoid configuration cache issue (#291)
Moves capture of the project version to execution time to avoid a gradle configuration cache issue
This commit is contained in:
parent
d86813636e
commit
8958f4c731
1 changed files with 4 additions and 1 deletions
|
|
@ -14,6 +14,9 @@ val generateLibVersion by tasks.registering {
|
|||
val outputDir = layout.buildDirectory.dir("generated-sources/libVersion")
|
||||
outputs.dir(outputDir)
|
||||
|
||||
// Capture version at configuration time to avoid configuration cache issues
|
||||
val projectVersion = project.version.toString()
|
||||
|
||||
doLast {
|
||||
val sourceFile = outputDir.get().file("io/modelcontextprotocol/kotlin/sdk/LibVersion.kt").asFile
|
||||
sourceFile.parentFile.mkdirs()
|
||||
|
|
@ -21,7 +24,7 @@ val generateLibVersion by tasks.registering {
|
|||
"""
|
||||
package io.modelcontextprotocol.kotlin.sdk
|
||||
|
||||
public const val LIB_VERSION: String = "${project.version}"
|
||||
public const val LIB_VERSION: String = "$projectVersion"
|
||||
|
||||
""".trimIndent(),
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue