Skip to content

Commit 05de912

Browse files
Merge pull request #1099 from alexarchambault/scala-2.12.16
Update Scala to 2.12.16
2 parents ddd4202 + 6ed7823 commit 05de912

File tree

4 files changed

+36
-10
lines changed

4 files changed

+36
-10
lines changed

modules/build/src/test/scala/scala/build/tests/BuildOptionsTests.scala

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package scala.build.tests
22

33
import com.eed3si9n.expecty.Expecty.{assert => expect}
4+
import coursier.cache.FileCache
45
import dependency.ScalaParameters
56

67
import scala.build.Ops._
@@ -23,6 +24,7 @@ import scala.build.{Build, BuildThreads, LocalRepo}
2324
import scala.build.Directories
2425
import scala.build.options.ScalacOpt
2526
import scala.build.Positioned
27+
import scala.concurrent.duration.DurationInt
2628

2729
class BuildOptionsTests extends munit.FunSuite {
2830

@@ -258,6 +260,9 @@ class BuildOptionsTests extends munit.FunSuite {
258260
val options = BuildOptions(
259261
scalaOptions = ScalaOptions(
260262
scalaVersion = prefix.map(MaybeScalaVersion(_))
263+
),
264+
internal = InternalOptions(
265+
cache = Some(FileCache().withTtl(0.seconds))
261266
)
262267
)
263268
val scalaParams = options.scalaParams.orThrow.getOrElse(???)

modules/options/src/main/scala/scala/build/options/BuildOptions.scala

Lines changed: 26 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -274,9 +274,26 @@ final case class BuildOptions(
274274
case Right(versions) =>
275275
versions.find(_.scalaCliVersion == scalaCliVersion)
276276
.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)
278295
versions
279-
.filter(_.scalaCliVersion0.compareTo(scalaCliVersion0) <= 0)
296+
.filter(_.scalaCliVersion0.compareTo(retainedCliVersion0) <= 0)
280297
.maxByOption(_.scalaCliVersion0)
281298
}
282299
.map(_.supportedScalaVersions)
@@ -335,11 +352,14 @@ final case class BuildOptions(
335352
}
336353

337354
lazy val scalaParams: Either[BuildException, Option[ScalaParameters]] =
338-
computeScalaParams(Constants.version, finalCache).orElse(
339-
// when the passed scala version is missed in the cache, we always force a cache refresh
340-
// https://github.com/VirtusLab/scala-cli/issues/1090
355+
if (System.getenv("CI") == null)
356+
computeScalaParams(Constants.version, finalCache).orElse(
357+
// when the passed scala version is missed in the cache, we always force a cache refresh
358+
// https://github.com/VirtusLab/scala-cli/issues/1090
359+
computeScalaParams(Constants.version, finalCache.withTtl(0.seconds))
360+
)
361+
else
341362
computeScalaParams(Constants.version, finalCache.withTtl(0.seconds))
342-
)
343363

344364
private[build] def computeScalaParams(
345365
scalaCliVersion: String,

project/deps.sc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import mill._, scalalib._
44
import scala.util.Properties
55

66
object Scala {
7-
def scala212 = "2.12.15"
7+
def scala212 = "2.12.16"
88
def scala213 = "2.13.8"
99
def scala3 = "3.1.2"
1010
val allScala2 = Seq(scala213, scala212)
@@ -59,12 +59,12 @@ object Deps {
5959
def coursier = "2.1.0-M6-26-gcec901e9a"
6060
def coursierCli = "2.1.0-M5-18-gfebf9838c"
6161
def jsoniterScala = "2.13.26"
62-
def scalaMeta = "4.5.8"
62+
def scalaMeta = "4.5.9"
6363
def scalaNative = "0.4.4"
6464
def scalaPackager = "0.1.26"
6565
def signingCli = "0.1.6"
6666
}
67-
def ammonite = ivy"com.lihaoyi:::ammonite:2.5.4"
67+
def ammonite = ivy"com.lihaoyi:::ammonite:2.5.4-8-30448e49"
6868
def asm = ivy"org.ow2.asm:asm:9.3"
6969
// Force using of 2.13 - is there a better way?
7070
def bloopConfig = ivy"io.github.alexarchambault.bleep:bloop-config_2.13:1.5.0-sc-1"

website/docs/reference/scala-versions.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ it is recommended to update scala-cli.
1010
|---------------------|:-----------------:|------------:|-----------:|
1111
| 0.0.9 | 3.0.2 | 2.13.7 | 2.12.7 |
1212
| 0.1.0 - 0.1.3 | 3.1.1 | 2.13.8 | 2.12.15 |
13-
| 0.1.4 - current | 3.1.2 | 2.13.8 | 2.12.15 |
13+
| 0.1.4 - 0.1.7 | 3.1.2 | 2.13.8 | 2.12.15 |
14+
| 0.1.8 - current | 3.1.2 | 2.13.8 | 2.12.16 |
1415

0 commit comments

Comments
 (0)