mirror of https://github.com/sbt/sbt.git
Jason's patch to work with latest changes to CompilerCommand
This commit is contained in:
parent
d5b0071eeb
commit
27816f32f6
2
LICENSE
2
LICENSE
|
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2008, 2009, 2010 Mark Harrah
|
||||
Copyright (c) 2008, 2009, 2010 Mark Harrah, Jason Zaugg
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without
|
||||
|
|
|
|||
2
NOTICE
2
NOTICE
|
|
@ -1,5 +1,5 @@
|
|||
Simple Build Tool (xsbt)
|
||||
Copyright 2008, 2009, 2010 Mark Harrah
|
||||
Copyright 2008, 2009, 2010 Mark Harrah, Jason Zaugg
|
||||
Licensed under BSD-style license (see LICENSE)
|
||||
|
||||
Portions based on code from the Scala compiler. Portions of the Scala
|
||||
|
|
|
|||
|
|
@ -1,3 +1,3 @@
|
|||
Simple Build Tool: Compile Component
|
||||
Copyright 2009, 2010 Mark Harrah
|
||||
Copyright 2009, 2010 Mark Harrah, Jason Zaugg
|
||||
Licensed under BSD-style license (see LICENSE)
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
/* sbt -- Simple Build Tool
|
||||
* Copyright 2010 Jason Zaugg
|
||||
*/
|
||||
package xsbt
|
||||
|
||||
import scala.tools.nsc.{CompilerCommand, Settings}
|
||||
|
||||
object Command
|
||||
{
|
||||
/**
|
||||
* Construct a CompilerCommand using reflection, to be compatible with Scalac before and after
|
||||
* <a href="https://lampsvn.epfl.ch/trac/scala/changeset/21274">r21274</a>
|
||||
*/
|
||||
def apply(arguments: List[String], settings: Settings): CompilerCommand = {
|
||||
def constr(params: Class[_]*) = classOf[CompilerCommand].getConstructor(params: _*)
|
||||
try {
|
||||
constr(classOf[List[_]], classOf[Settings]).newInstance(arguments, settings)
|
||||
} catch {
|
||||
case e: NoSuchMethodException =>
|
||||
constr(classOf[List[_]], classOf[Settings], classOf[Function1[_, _]], classOf[Boolean]).newInstance(arguments, settings, error _, false.asInstanceOf[AnyRef])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -11,13 +11,14 @@ class CompilerInterface
|
|||
{
|
||||
def run(args: Array[String], callback: AnalysisCallback, maximumErrors: Int, log: Logger)
|
||||
{
|
||||
import scala.tools.nsc.{CompilerCommand, Global, Settings}
|
||||
import scala.tools.nsc.{Global, Settings}
|
||||
|
||||
debug(log, "Interfacing (CompilerInterface) with Scala compiler " + scala.tools.nsc.Properties.versionString)
|
||||
|
||||
val reporter = new LoggerReporter(maximumErrors, log)
|
||||
val settings = new Settings(reporter.error)
|
||||
val command = new CompilerCommand(args.toList, settings, error, false)
|
||||
|
||||
val command = Command(args.toList, settings)
|
||||
|
||||
val phasesSet = new scala.collection.mutable.HashSet[Any] // 2.7 compatibility
|
||||
object compiler extends Global(command.settings, reporter)
|
||||
|
|
|
|||
|
|
@ -12,10 +12,10 @@ class ScaladocInterface
|
|||
}
|
||||
private class Runner(args: Array[String], maximumErrors: Int, log: Logger)
|
||||
{
|
||||
import scala.tools.nsc.{doc, CompilerCommand, Global}
|
||||
import scala.tools.nsc.{doc, Global}
|
||||
val reporter = new LoggerReporter(maximumErrors, log)
|
||||
val docSettings: doc.Settings = new doc.Settings(reporter.error)
|
||||
val command = new CompilerCommand(args.toList, docSettings, error, false)
|
||||
val command = Command(args.toList, docSettings)
|
||||
|
||||
import forScope._
|
||||
def run()
|
||||
|
|
|
|||
Loading…
Reference in New Issue