Skip to content

Commit

Permalink
Fix versioning for local builds
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Jan 27, 2025
1 parent 65fb18f commit 8d038b4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions build-logic/src/main/kotlin/ktorbuild/internal/Version.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2014-2024 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
* Copyright 2014-2025 JetBrains s.r.o and contributors. Use of this source code is governed by the Apache 2.0 license.
*/

package ktorbuild.internal
Expand All @@ -14,13 +14,13 @@ import org.gradle.api.Project
* ```
*/
internal fun Project.resolveVersion(): String {
val projectVersion = version.toString().removeSuffix("-SNAPSHOT")
val projectVersion = project.version.toString()
val releaseVersion = findProperty("releaseVersion")?.toString()
val eapVersion = findProperty("eapVersion")?.toString()

return when {
releaseVersion != null -> releaseVersion
eapVersion != null -> "$projectVersion-eap-$eapVersion"
eapVersion != null -> "${projectVersion.removeSuffix("-SNAPSHOT")}-eap-$eapVersion"
else -> projectVersion
}
}

0 comments on commit 8d038b4

Please sign in to comment.