Skip to content

Commit c7a27d1

Browse files
authored
Change Nightly version date to be the current date in UTC (#23819)
Works better if the last commit doesn't belong to the same date as the build time.
2 parents 98a319a + 00e3c4b commit c7a27d1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

project/Build.scala

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,12 @@ object Build {
9999
/** Final version of Scala compiler, controlled by environment variables. */
100100
val dottyVersion = {
101101
if (isRelease) baseVersion
102-
else if (isNightly) s"${baseVersion}-bin-${VersionUtil.commitDate}-${VersionUtil.gitHash}-NIGHTLY"
102+
else if (isNightly) {
103+
val formatter = java.time.format.DateTimeFormatter.ofPattern("yyyyMMdd")
104+
val currentDate =
105+
formatter.format(java.time.ZonedDateTime.now(java.time.ZoneId.of("UTC")))
106+
s"${baseVersion}-bin-${currentDate}-${VersionUtil.gitHash}-NIGHTLY"
107+
}
103108
else s"${baseVersion}-bin-SNAPSHOT"
104109
}
105110
def isRelease = sys.env.get("RELEASEBUILD").contains("yes")

0 commit comments

Comments
 (0)