@@ -93,9 +93,39 @@ object Build {
93
93
94
94
val referenceVersion = " 3.5.2"
95
95
96
- val baseVersion = " 3.6.2"
97
- // Will be required by some automation later
98
- // val prereleaseVersion = s"$baseVersion-RC1"
96
+ /** Version of the Scala compiler targeted in the current release cycle
97
+ * Contains a version without RC/SNAPSHOT/NIGHTLY specific suffixes
98
+ * Should be updated ONLY after release or cutoff for previous release cycle.
99
+ *
100
+ * Should only be referred from `dottyVersion` or settings/tasks requiring simplified version string,
101
+ * eg. `compatMode` or Windows native distribution version.
102
+ */
103
+ val developedVersion = " 3.6.2"
104
+
105
+ /** The version of the compiler including the RC prefix.
106
+ * Defined as common base before calculating environment specific suffixes in `dottyVersion`
107
+ *
108
+ * By default, during development cycle defined as `${developedVersion}-RC1`;
109
+ * During release candidate cycle incremented by the release officer before publishing a subsequent RC version;
110
+ * During final, stable release is set exactly to `developedVersion`.
111
+ */
112
+ val baseVersion = s " $developedVersion-RC1 "
113
+
114
+ /** Final version of Scala compiler, controlled by environment variables. */
115
+ val dottyVersion = {
116
+ if (isRelease) baseVersion
117
+ else if (isNightly) s " ${baseVersion}-bin- ${VersionUtil .commitDate}- ${VersionUtil .gitHash}-NIGHTLY "
118
+ else s " ${baseVersion}-bin-SNAPSHOT "
119
+ }
120
+ def isRelease = sys.env.get(" RELEASEBUILD" ).contains(" yes" )
121
+ def isNightly = sys.env.get(" NIGHTLYBUILD" ).contains(" yes" )
122
+
123
+ /** Version calculate for `nonbootstrapped` projects */
124
+ val dottyNonBootstrappedVersion = {
125
+ // Make sure sbt always computes the scalaBinaryVersion correctly
126
+ val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
127
+ dottyVersion + bin + " -nonbootstrapped"
128
+ }
99
129
100
130
// LTS or Next
101
131
val versionLine = " Next"
@@ -110,7 +140,7 @@ object Build {
110
140
/** Minor version against which we check binary compatibility.
111
141
*
112
142
* This must be the earliest published release in the same versioning line.
113
- * For a baseVersion `3.M.P` the mimaPreviousDottyVersion should be set to:
143
+ * For a developedVersion `3.M.P` the mimaPreviousDottyVersion should be set to:
114
144
* - `3.M.0` if `P > 0`
115
145
* - `3.(M-1).0` if `P = 0`
116
146
*/
@@ -136,7 +166,7 @@ object Build {
136
166
137
167
val compatMode = {
138
168
val VersionRE = """ ^\d+\.(\d+)\.(\d+)""" .r
139
- baseVersion match {
169
+ developedVersion match {
140
170
case VersionRE (_, " 0" ) => CompatMode .BinaryCompatible
141
171
case _ => CompatMode .SourceAndBinaryCompatible
142
172
}
@@ -166,24 +196,6 @@ object Build {
166
196
val dottyGithubUrl = " https://github.com/scala/scala3"
167
197
val dottyGithubRawUserContentUrl = " https://raw.githubusercontent.com/scala/scala3"
168
198
169
-
170
- val isRelease = sys.env.get(" RELEASEBUILD" ) == Some (" yes" )
171
-
172
- val dottyVersion = {
173
- def isNightly = sys.env.get(" NIGHTLYBUILD" ) == Some (" yes" )
174
- if (isRelease)
175
- baseVersion
176
- else if (isNightly)
177
- baseVersion + " -RC1-bin-" + VersionUtil .commitDate + " -" + VersionUtil .gitHash + " -NIGHTLY"
178
- else
179
- baseVersion + " -RC1-bin-SNAPSHOT"
180
- }
181
- val dottyNonBootstrappedVersion = {
182
- // Make sure sbt always computes the scalaBinaryVersion correctly
183
- val bin = if (! dottyVersion.contains(" -bin" )) " -bin" else " "
184
- dottyVersion + bin + " -nonbootstrapped"
185
- }
186
-
187
199
val sbtCommunityBuildVersion = " 0.1.0-SNAPSHOT"
188
200
189
201
val agentOptions = List (
@@ -2235,6 +2247,9 @@ object Build {
2235
2247
)
2236
2248
.settings(
2237
2249
Windows / name := " scala" ,
2250
+ // Windows/version is used to create ProductInfo - it requires a version without any -RC suffixes
2251
+ // If not explicitly overriden it would try to use `dottyVersion` assigned to `dist-win-x86_64/version`
2252
+ Windows / version := developedVersion,
2238
2253
Windows / mappings := (Universal / mappings).value,
2239
2254
Windows / packageBin := (Windows / packageBin).dependsOn(republish).value,
2240
2255
Windows / wixFiles := (Windows / wixFiles).dependsOn(republish).value,
0 commit comments