@@ -83,7 +83,39 @@ object Build {
83
83
84
84
val referenceVersion = " 3.3.5"
85
85
86
- val baseVersion = " 3.3.6-RC1"
86
+ /** Version of the Scala compiler targeted in the current release cycle
87
+ * Contains a version without RC/SNAPSHOT/NIGHTLY specific suffixes
88
+ * Should be updated ONLY after release or cutoff for previous release cycle.
89
+ *
90
+ * Should only be referred from `dottyVersion` or settings/tasks requiring simplified version string,
91
+ * eg. `compatMode` or Windows native distribution version.
92
+ */
93
+ val developedVersion = " 3.3.6"
94
+
95
+ /** The version of the compiler including the RC prefix.
96
+ * Defined as common base before calculating environment specific suffixes in `dottyVersion`
97
+ *
98
+ * By default, during development cycle defined as `${developedVersion}-RC1`;
99
+ * During release candidate cycle incremented by the release officer before publishing a subsequent RC version;
100
+ * During final, stable release is set exactly to `developedVersion`.
101
+ */
102
+ val baseVersion = s " $developedVersion-RC1 "
103
+
104
+ /** Final version of Scala compiler, controlled by environment variables. */
105
+ val dottyVersion = {
106
+ if (isRelease) baseVersion
107
+ else if (isNightly) s " ${baseVersion}-bin- ${VersionUtil .commitDate}- ${VersionUtil .gitHash}-NIGHTLY "
108
+ else s " ${baseVersion}-bin-SNAPSHOT "
109
+ }
110
+ def isRelease = sys.env.get(" RELEASEBUILD" ).contains(" yes" )
111
+ def isNightly = sys.env.get(" NIGHTLYBUILD" ).contains(" yes" )
112
+
113
+ /** Version calculate for `nonbootstrapped` projects */
114
+ val dottyNonBootstrappedVersion = {
115
+ // Make sure sbt always computes the scalaBinaryVersion correctly
116
+ val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
117
+ dottyVersion + bin + " -nonbootstrapped"
118
+ }
87
119
88
120
// LTS or Next
89
121
val versionLine = " LTS"
@@ -110,8 +142,8 @@ object Build {
110
142
}
111
143
112
144
val compatMode = {
113
- val VersionRE = """ ^\d+\.(\d+).(\d+).* """ .r
114
- baseVersion match {
145
+ val VersionRE = """ ^\d+\.(\d+)\ .(\d+)""" .r
146
+ developedVersion match {
115
147
case VersionRE (_, " 0" ) => CompatMode .BinaryCompatible
116
148
case _ => CompatMode .SourceAndBinaryCompatible
117
149
}
@@ -132,24 +164,6 @@ object Build {
132
164
val dottyGithubUrl = " https://github.com/scala/scala3"
133
165
val dottyGithubRawUserContentUrl = " https://raw.githubusercontent.com/scala/scala3"
134
166
135
-
136
- val isRelease = sys.env.get(" RELEASEBUILD" ) == Some (" yes" )
137
-
138
- val dottyVersion = {
139
- def isNightly = sys.env.get(" NIGHTLYBUILD" ) == Some (" yes" )
140
- if (isRelease)
141
- baseVersion
142
- else if (isNightly)
143
- baseVersion + " -bin-" + VersionUtil .commitDate + " -" + VersionUtil .gitHash + " -NIGHTLY"
144
- else
145
- baseVersion + " -bin-SNAPSHOT"
146
- }
147
- val dottyNonBootstrappedVersion = {
148
- // Make sure sbt always computes the scalaBinaryVersion correctly
149
- val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
150
- dottyVersion + bin + " -nonbootstrapped"
151
- }
152
-
153
167
val sbtCommunityBuildVersion = " 0.1.0-SNAPSHOT"
154
168
155
169
val agentOptions = List (
0 commit comments