Skip to content

Commit

Permalink
Merge branch 'main' into update/case-app-2.1.0-M29
Browse files Browse the repository at this point in the history
 Conflicts:
	project/deps.sc
  • Loading branch information
alexarchambault committed Jun 19, 2024
2 parents adf8d5f + 4c99367 commit 5f0ec05
Show file tree
Hide file tree
Showing 7 changed files with 51 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
matrix:
OS: [ubuntu-latest]
JDK: [8]
SCALA: [2.12.18, 2.12.19, 2.13.13, 2.13.14, 3.3.3]
SCALA: [2.12.18, 2.12.19, 2.13.13, 2.13.14, 3.3.3, 3.4.2]
include:
- OS: windows-latest
JDK: 8
Expand All @@ -50,7 +50,7 @@ jobs:
SCALA: 2.13.14
- OS: ubuntu-latest
JDK: 17
SCALA: 2.12.19
SCALA: 2.13.14
steps:
- uses: actions/checkout@v4
with:
Expand Down
16 changes: 16 additions & 0 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,9 @@ trait ScalaInterpreter extends Cross.Module[String] with AlmondModule with Bloop
else Nil
scala213Options
}
def sources = T.sources {
super.sources() ++ CrossSources.extraSourcesDirs(scalaVersion(), millSourcePath)
}
object test extends CrossSbtModuleTests with AlmondTestModule {
def moduleDeps = {
val rx =
Expand Down Expand Up @@ -857,3 +860,16 @@ object dummy extends Module {
)
}
}

object CrossSources {
def extraSourcesDirs(sv: String, millSourcePath: os.Path): Seq[PathRef] = {
val (maj, min) = sv.split('.') match {
case Array(maj0, min0, _*) if min0.nonEmpty && min0.forall(_.isDigit) =>
(maj0, min0.toInt)
case _ =>
sys.error(s"Malformed Scala version: $sv")
}
val baseDir = millSourcePath / "src" / "main"
(0 to min).map(min0 => PathRef(baseDir / s"scala-$maj.$min0+"))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package almond.internals

import dotty.tools.dotc.CompilationUnit
import dotty.tools.dotc.util.SourceFile

object Helper {
def nonSuspendableCompilationUnit(source: SourceFile): CompilationUnit =
new CompilationUnit(source):
override def isSuspendable: Boolean = false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
package almond.internals

import dotty.tools.dotc.CompilationUnit
import dotty.tools.dotc.util.SourceFile

object Helper {
def nonSuspendableCompilationUnit(source: SourceFile): CompilationUnit =
new CompilationUnit(source, null):
override def isSuspendable: Boolean = false
}
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,7 @@ object ScalaInterpreterCompletions {
)
implicit val ctx: Context = run.runContext.withSource(sourceFile)

val unit =
new CompilationUnit(ctx.source):
override def isSuspendable: Boolean = false
val unit = Helper.nonSuspendableCompilationUnit(ctx.source)
ctx
.run
.compileUnits(unit :: Nil, ctx)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,21 @@ object Tests {
| ^
|No warnings can be incurred under -Xfatal-warnings.
|Compilation Failed""".stripMargin
else
else if ((0 to 3).exists(min => scalaVersion.startsWith(s"3.$min.")))
// FIXME The line number is wrong here
"""-- Error: cmd2.sc:3:8 ----------------------------------------------------------
|3 |val n = getValue()
| | ^^^^^^^^
| | method getValue in class Helper is deprecated since 0.1: foo
|Compilation Failed""".stripMargin
else
// FIXME The line number is wrong here
"""-- Warning: cmd2.sc:3:8 --------------------------------------------------------
|3 |val n = getValue()
| | ^^^^^^^^
| | method getValue in class Helper is deprecated since 0.1: foo
|No warnings can be incurred under -Werror (or -Xfatal-warnings)
|Compilation Failed""".stripMargin

execute(
"""//> using option "-Xfatal-warnings" "-deprecation"
Expand Down
5 changes: 3 additions & 2 deletions project/deps.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import mill._
import mill.scalalib._

object Versions {
def ammonite = "3.0.0-M2-8-ba4429a2"
def ammonite = "3.0.0-M2-10-f6e2c001"
def caseApp = "2.1.0-M29"
def coursier = "2.1.10"
def jsoniterScala = "2.13.5"
Expand Down Expand Up @@ -75,14 +75,15 @@ object Deps {
}

object ScalaVersions {
def scala3Latest = "3.3.3"
def scala3Latest = "3.4.2"
def scala3Compat = "3.3.0"
def scala213 = "2.13.14"
def scala212 = "2.12.19"
val binaries = Seq(scala3Compat, scala213, scala212)
val scala2Binaries = Seq(scala213, scala212)
val all = Seq(
scala3Latest,
"3.3.3",
"3.3.2",
"3.3.1",
scala3Compat,
Expand Down

0 comments on commit 5f0ec05

Please sign in to comment.