File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
modules/options/src/main/scala/scala/build/options Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -274,9 +274,26 @@ final case class BuildOptions(
274
274
case Right (versions) =>
275
275
versions.find(_.scalaCliVersion == scalaCliVersion)
276
276
.orElse {
277
- val scalaCliVersion0 = Version (scalaCliVersion)
277
+ val retainedCliVersion =
278
+ if (scalaCliVersion.endsWith(" -SNAPSHOT" ))
279
+ if (scalaCliVersion.contains(" -g" ))
280
+ // version like 0.1.7-30-g51330f19d-SNAPSHOT
281
+ scalaCliVersion.takeWhile(_ != '-' ).split('.' ) match {
282
+ case Array (maj, min, patch) if patch.nonEmpty && patch.forall(_.isDigit) =>
283
+ val patch0 = patch.toInt + 1
284
+ s " $maj. $min. $patch0"
285
+ case _ =>
286
+ // shouldn't happen
287
+ scalaCliVersion
288
+ }
289
+ else
290
+ // version like 0.1.8-SNAPSHOT
291
+ scalaCliVersion.takeWhile(_ != '-' )
292
+ else
293
+ scalaCliVersion
294
+ val retainedCliVersion0 = Version (retainedCliVersion)
278
295
versions
279
- .filter(_.scalaCliVersion0.compareTo(scalaCliVersion0 ) <= 0 )
296
+ .filter(_.scalaCliVersion0.compareTo(retainedCliVersion0 ) <= 0 )
280
297
.maxByOption(_.scalaCliVersion0)
281
298
}
282
299
.map(_.supportedScalaVersions)
You can’t perform that action at this time.
0 commit comments