Workaround for private access modifier for Global.computePhaseDescriptors in 2.8.

This commit is contained in:
Mark Harrah 2009-10-15 18:06:57 -04:00
parent a2c0fc941b
commit 4fda9f0690
2 changed files with 9 additions and 3 deletions

View File

@ -36,12 +36,18 @@ class CompilerInterface
def newPhase(prev: Phase) = analyzer.newPhase(prev)
def name = phaseName
}
override def computePhaseDescriptors = // done this way for compatibility between 2.7 and 2.8
override lazy val phaseDescriptors = // done this way for compatibility between 2.7 and 2.8
{
phasesSet += sbtAnalyzer
val superd = super.computePhaseDescriptors
val superd = superComputePhaseDescriptors
if(superd.contains(sbtAnalyzer)) superd else ( superd ++ List(sbtAnalyzer) ).toList
}
private def superComputePhaseDescriptors() = // required because 2.8 makes computePhaseDescriptors private
{
val meth = classOf[Global].getDeclaredMethod("computePhaseDescriptors")
meth.setAccessible(true)
meth.invoke(this).asInstanceOf[List[SubComponent]]
}
trait Compat27 { val runsBefore: List[String] = Nil }
}
if(!reporter.hasErrors)

View File

@ -36,7 +36,7 @@ object WithCompiler
log.bufferQuietly {
boot.LaunchTest.withLauncher { launch =>
FileUtilities.withTemporaryDirectory { componentDirectory =>
val manager = new ComponentManager(new boot.ComponentProvider(componentDirectory), log)
val manager = new ComponentManager(xsbt.boot.Locks, new boot.ComponentProvider(componentDirectory), log)
val compiler = new AnalyzingCompiler(ScalaInstance(scalaVersion, launch), manager)
compiler.newComponentCompiler(log).clearCache(ComponentCompiler.compilerInterfaceID)
prepare(manager, ComponentCompiler.compilerInterfaceSrcID, "CompilerInterface.scala")