Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport Scala 2.13.12 support #1377

Merged
merged 3 commits into from
Sep 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
fail-fast: false
matrix:
java-version: [8, 11]
scala-version: [2.12.18, 2.13.11, 3.2.2]
scala-version: [2.12.18, 2.13.12, 3.2.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand All @@ -29,7 +29,7 @@ jobs:
fail-fast: false
matrix:
java-version: [8, 11]
scala-version: [2.12.18, 2.13.11, 3.2.2]
scala-version: [2.12.18, 2.13.12, 3.2.2]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package ammonite.compiler

import ammonite.util.Classpath

import scala.reflect.internal.util.{CodeAction, Position}
import scala.reflect.io.FileZipArchive
import scala.tools.nsc
import scala.tools.nsc.classpath.{AggregateClassPath, ZipAndJarClassPathFactory}
import scala.tools.nsc.{Global, Settings}
import scala.tools.nsc.interactive.{InteractiveAnalyzer, Global => InteractiveGlobal}
import scala.tools.nsc.plugins.Plugin
import scala.tools.nsc.reporters.FilteringReporter
import scala.tools.nsc.typechecker.Analyzer

object MakeReporter {

type Reporter = scala.tools.nsc.reporters.Reporter

def makeReporter(errorLogger: (Position, String) => Unit,
warningLogger: (Position, String) => Unit,
infoLogger: (Position, String) => Unit,
outerSettings: Settings): Reporter =
new FilteringReporter {

override
def doReport(pos: scala.reflect.internal.util.Position,
msg: String,
severity: Severity,
actions: List[CodeAction]): Unit =
display(pos, msg, severity)

def display(pos: Position, msg: String, severity: Severity) =
severity match{
case ERROR =>
Classpath.traceClasspathProblem(s"ERROR: $msg")
errorLogger(pos, msg)
case WARNING =>
warningLogger(pos, msg)
case INFO =>
infoLogger(pos, msg)
}

def settings = outerSettings
}
}
10 changes: 6 additions & 4 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ val cross2_3Version = (scala3Ver: String) =>


val scala2_12Versions = Seq("2.12.8", "2.12.9", "2.12.10", "2.12.11", "2.12.12", "2.12.13", "2.12.14", "2.12.15", "2.12.16", "2.12.17", "2.12.18")
val scala2_13Versions = Seq("2.13.0", "2.13.1", "2.13.2", "2.13.3", "2.13.4", "2.13.5", "2.13.6", "2.13.7", "2.13.8", "2.13.9", "2.13.10", "2.13.11")
val scala2_13Versions = Seq("2.13.0", "2.13.1", "2.13.2", "2.13.3", "2.13.4", "2.13.5", "2.13.6", "2.13.7", "2.13.8", "2.13.9", "2.13.10", "2.13.11", "2.13.12")
val scala30Versions = Seq("3.0.0", "3.0.1", "3.0.2")
val scala31Versions = Seq("3.1.0", "3.1.1", "3.1.2", "3.1.3")
val scala32Versions = Seq("3.2.0", "3.2.1", "3.2.2")
Expand Down Expand Up @@ -79,7 +79,7 @@ val fastparseVersion = "2.3.0"
val scalametaVersion = "4.8.5"

object Deps {
val acyclic = ivy"com.lihaoyi:::acyclic:0.3.8"
val acyclic = ivy"com.lihaoyi:::acyclic:0.3.9"
val bsp4j = ivy"ch.epfl.scala:bsp4j:${bspVersion}"
val bcprovJdk15on = ivy"org.bouncycastle:bcprov-jdk15on:1.56"
val cask = ivy"com.lihaoyi::cask:0.6.0"
Expand Down Expand Up @@ -269,8 +269,10 @@ trait AmmInternalModule extends CrossSbtModule with Bloop.Module{
val extraDir3 =
if (isScala2()) {
val dir =
if (sv.startsWith("2.13.") && sv != "2.13.0")
millSourcePath / "src" / "main" / "scala-2.13.1+"
if (sv.startsWith("2.13.") && sv.stripPrefix("2.13.").toInt >= 1 && sv.stripPrefix("2.13.").toInt <= 11)
millSourcePath / "src" / "main" / "scala-2.13.1-2.13.11"
else if (sv.startsWith("2.13.") && sv.stripPrefix("2.13.").toInt >= 12)
millSourcePath / "src" / "main" / "scala-2.13.12+"
else if (sv.startsWith("2.12.") && sv.stripPrefix("2.12.").toInt >= 13)
millSourcePath / "src" / "main" / "scala-2.12.13+"
else
Expand Down
Loading