Skip to content

Commit 62273e3

Browse files
authored
Fix snapshot version name (#1571)
1 parent 32904e2 commit 62273e3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

build.gradle.kts

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import com.vanniktech.maven.publish.MavenPublishBaseExtension
22
import io.getstream.video.android.Configuration
3+
import java.text.SimpleDateFormat
4+
import java.util.Date
5+
import java.util.TimeZone
36

47
apply(from = "${rootDir}/scripts/open-api-code-gen.gradle.kts")
58

@@ -71,7 +74,16 @@ tasks.register("clean")
7174
}
7275

7376
private val isSnapshot = System.getenv("SNAPSHOT")?.toBoolean() == true
74-
version = if (isSnapshot) Configuration.snapshotVersionName else Configuration.versionName
77+
78+
version = if (isSnapshot) {
79+
val timestamp = SimpleDateFormat("yyyyMMddHHmm").run {
80+
timeZone = TimeZone.getTimeZone("UTC")
81+
format(Date())
82+
}
83+
"${Configuration.snapshotBasedVersionName}-${timestamp}-SNAPSHOT"
84+
} else {
85+
Configuration.versionName
86+
}
7587

7688
subprojects {
7789
plugins.withId("com.vanniktech.maven.publish") {

0 commit comments

Comments
 (0)