Fix mima binary issues

This commit is contained in:
Adrien Piquerez 2021-07-08 09:13:22 +02:00
parent b4c6299b9c
commit 94cc9a84ac
2 changed files with 9 additions and 7 deletions

View File

@ -681,6 +681,8 @@ lazy val actionsProj = (project in file("main-actions"))
exclude[DirectMissingMethodProblem]("sbt.compiler.Eval.filesModifiedBytes"),
exclude[DirectMissingMethodProblem]("sbt.compiler.Eval.fileModifiedBytes"),
exclude[DirectMissingMethodProblem]("sbt.Doc.$init$"),
// Added field in nested private[this] class
exclude[ReversedMissingMethodProblem]("sbt.compiler.Eval#EvalType.sourceName"),
),
)
.configure(

View File

@ -81,8 +81,8 @@ final class Eval(
new CompilerCommand(options.toList, s) // this side-effects on Settings..
s
}
lazy val reporter = mkReporter(settings)
private lazy val evalReporter = mkReporter(settings)
def reporter: Reporter = evalReporter // kept for binary compatibility
/**
* Subclass of Global which allows us to mutate currentRun from outside.
* See for rationale https://issues.scala-lang.org/browse/SI-8794
@ -95,7 +95,7 @@ final class Eval(
}
var curRun: Run = null
}
lazy val global: EvalGlobal = new EvalGlobal(settings, reporter)
lazy val global: EvalGlobal = new EvalGlobal(settings, evalReporter)
import global._
private[sbt] def unlinkDeferred(): Unit = {
@ -216,7 +216,7 @@ final class Eval(
}
} finally {
// send a final report even if the class file was backed to reset preceding diagnostics
reporter.finalReport(ev.sourceName)
evalReporter.finalReport(ev.sourceName)
}
val generatedFiles = getGeneratedFiles(backing, moduleName)
@ -232,7 +232,7 @@ final class Eval(
moduleName: String,
ev: EvalType[T]
): (T, ClassLoader => ClassLoader) = {
reporter.reset()
evalReporter.reset()
val unit = ev.makeUnit
val run = new Run {
override def units = (unit :: Nil).iterator
@ -262,7 +262,7 @@ final class Eval(
def compile(phase: Phase): Unit = {
globalPhase = phase
if (phase == null || phase == phase.next || reporter.hasErrors)
if (phase == null || phase == phase.next || evalReporter.hasErrors)
()
else {
enteringPhase(phase) { phase.run }
@ -498,7 +498,7 @@ final class Eval(
private[this] def mkUnit(srcName: String, firstLine: Int, s: String) =
new CompilationUnit(new EvalSourceFile(srcName, firstLine, s))
private[this] def checkError(label: String) =
if (reporter.hasErrors) throw new EvalException(label)
if (evalReporter.hasErrors) throw new EvalException(label)
private[this] final class EvalSourceFile(name: String, startLine: Int, contents: String)
extends BatchSourceFile(name, contents) {