@@ -99,10 +99,39 @@ object Build {
99
99
*/
100
100
val referenceVersion = " 3.6.0"
101
101
102
- val baseVersion = " 3.6.2"
103
- // Will be required by some automation later
104
- // TODO: Introduce automation and handling for RC versions before 3.6.2-RC1
105
- // val prereleaseVersion = s"$baseVersion-RC1"
102
+ /** Version of the Scala compiler targeted in the current release cycle
103
+ * Contains a version without RC/SNAPSHOT/NIGHTLY specific suffixes
104
+ * Should be updated ONLY after release or cutoff for previous release cycle.
105
+ *
106
+ * Should only be referred from `dottyVersion` or settings/tasks requiring simplified version string,
107
+ * eg. `compatMode` or Windows native distribution version.
108
+ */
109
+ val developedVersion = " 3.6.2"
110
+
111
+ /** The version of the compiler including the RC prefix.
112
+ * Defined as common base before calculating environment specific suffixes in `dottyVersion`
113
+ *
114
+ * By default, during development cycle defined as `${developedVersion}-RC1`;
115
+ * During release candidate cycle incremented by the release officer before publishing a subsequent RC version;
116
+ * During final, stable release is set exactly to `developedVersion`.
117
+ */
118
+ val baseVersion = s " $developedVersion-RC1 "
119
+
120
+ /** Final version of Scala compiler, controlled by environment variables. */
121
+ val dottyVersion = {
122
+ if (isRelease) baseVersion
123
+ else if (isNightly) s " ${baseVersion}-bin- ${VersionUtil .commitDate}- ${VersionUtil .gitHash}-NIGHTLY "
124
+ else s " ${baseVersion}-bin-SNAPSHOT "
125
+ }
126
+ def isRelease = sys.env.get(" RELEASEBUILD" ).contains(" yes" )
127
+ def isNightly = sys.env.get(" NIGHTLYBUILD" ).contains(" yes" )
128
+
129
+ /** Version calculate for `nonbootstrapped` projects */
130
+ val dottyNonBootstrappedVersion = {
131
+ // Make sure sbt always computes the scalaBinaryVersion correctly
132
+ val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
133
+ dottyVersion + bin + " -nonbootstrapped"
134
+ }
106
135
107
136
// LTS or Next
108
137
val versionLine = " Next"
@@ -117,7 +146,7 @@ object Build {
117
146
/** Minor version against which we check binary compatibility.
118
147
*
119
148
* This must be the earliest published release in the same versioning line.
120
- * For a baseVersion `3.M.P` the mimaPreviousDottyVersion should be set to:
149
+ * For a developedVersion `3.M.P` the mimaPreviousDottyVersion should be set to:
121
150
* - `3.M.0` if `P > 0`
122
151
* - `3.(M-1).0` if `P = 0`
123
152
* 3.6.1 is an exception from this rule - 3.6.0 was a broken release
@@ -144,7 +173,7 @@ object Build {
144
173
145
174
val compatMode = {
146
175
val VersionRE = """ ^\d+\.(\d+)\.(\d+)""" .r
147
- baseVersion match {
176
+ developedVersion match {
148
177
case VersionRE (_, " 0" ) => CompatMode .BinaryCompatible
149
178
case _ => CompatMode .SourceAndBinaryCompatible
150
179
}
@@ -174,24 +203,6 @@ object Build {
174
203
val dottyGithubUrl = " https://github.com/scala/scala3"
175
204
val dottyGithubRawUserContentUrl = " https://raw.githubusercontent.com/scala/scala3"
176
205
177
-
178
- val isRelease = sys.env.get(" RELEASEBUILD" ) == Some (" yes" )
179
-
180
- val dottyVersion = {
181
- def isNightly = sys.env.get(" NIGHTLYBUILD" ) == Some (" yes" )
182
- if (isRelease)
183
- baseVersion
184
- else if (isNightly)
185
- baseVersion + " -RC1-bin-" + VersionUtil .commitDate + " -" + VersionUtil .gitHash + " -NIGHTLY"
186
- else
187
- baseVersion + " -RC1-bin-SNAPSHOT"
188
- }
189
- val dottyNonBootstrappedVersion = {
190
- // Make sure sbt always computes the scalaBinaryVersion correctly
191
- val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
192
- dottyVersion + bin + " -nonbootstrapped"
193
- }
194
-
195
206
val sbtCommunityBuildVersion = " 0.1.0-SNAPSHOT"
196
207
197
208
val agentOptions = List (
0 commit comments