From 8d038b44ccd4ae83b443f61d87c69b3910f3647f Mon Sep 17 00:00:00 2001
From: Osip Fatkullin <osip.fatkullin@jetbrains.com>
Date: Mon, 27 Jan 2025 10:11:39 +0100
Subject: [PATCH] Fix versioning for local builds

---
 build-logic/src/main/kotlin/ktorbuild/internal/Version.kt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/build-logic/src/main/kotlin/ktorbuild/internal/Version.kt b/build-logic/src/main/kotlin/ktorbuild/internal/Version.kt
index 6440b3bc449..66a4cfe83d3 100644
--- a/build-logic/src/main/kotlin/ktorbuild/internal/Version.kt
+++ b/build-logic/src/main/kotlin/ktorbuild/internal/Version.kt
@@ -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
@@ -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
     }
 }