mirror of https://github.com/sbt/sbt.git
Work with latest compiler changes. API is commented for stability in 0.7.
This commit is contained in:
parent
8daaf9ea17
commit
b6f017c508
|
|
@ -30,12 +30,12 @@ final class API(val global: Global, val callback: xsbti.AnalysisCallback) extend
|
|||
if(java.lang.Boolean.getBoolean("sbt.api.enable"))
|
||||
{
|
||||
val start = System.currentTimeMillis
|
||||
currentRun.units.foreach(processUnit)
|
||||
//currentRun.units.foreach(processUnit)
|
||||
val stop = System.currentTimeMillis
|
||||
println("API phase took : " + ((stop - start)/1000.0) + " s")
|
||||
}
|
||||
}
|
||||
def processUnit(unit: CompilationUnit)
|
||||
/*def processUnit(unit: CompilationUnit)
|
||||
{
|
||||
val sourceFile = unit.source.file.file
|
||||
val traverser = new TopLevelHandler(sourceFile)
|
||||
|
|
@ -43,9 +43,9 @@ final class API(val global: Global, val callback: xsbti.AnalysisCallback) extend
|
|||
val packages = traverser.packages.toArray[String].map(p => new xsbti.api.Package(p))
|
||||
val source = new xsbti.api.Source(packages, traverser.definitions.toArray[xsbti.api.Definition])
|
||||
callback.api(sourceFile, source)
|
||||
}
|
||||
}*/
|
||||
}
|
||||
private def thisPath(sym: Symbol) = path(pathComponents(sym, Constants.thisPath :: Nil))
|
||||
/*private def thisPath(sym: Symbol) = path(pathComponents(sym, Constants.thisPath :: Nil))
|
||||
private def path(components: List[PathComponent]) = new xsbti.api.Path(components.toArray[PathComponent])
|
||||
private def pathComponents(sym: Symbol, postfix: List[PathComponent]): List[PathComponent] =
|
||||
{
|
||||
|
|
@ -317,5 +317,5 @@ final class API(val global: Global, val callback: xsbti.AnalysisCallback) extend
|
|||
if(annots.isEmpty) processType(at.underlying) else annotated(annots, at.underlying)
|
||||
}
|
||||
private def fullName(s: Symbol): String = s.fullNameString
|
||||
private def simpleName(s: Symbol): String = s.simpleName.toString.trim
|
||||
private def simpleName(s: Symbol): String = s.simpleName.toString.trim*/
|
||||
}
|
||||
|
|
@ -20,6 +20,15 @@ final class Analyzer(val global: Global, val callback: AnalysisCallback) extends
|
|||
{
|
||||
import global._
|
||||
|
||||
/** After 2.8.0.Beta1, fullNameString was renamed fullName.*/
|
||||
private implicit def symName(sym: Symbol): WithString = new WithString(sym)
|
||||
private final class WithString(s: Symbol)
|
||||
{
|
||||
def fullNameString = s.fullName; def fullName = sourceCompatibilityOnly
|
||||
def fullNameString(sep: Char) = s.fullName(sep); def fullName(sep: Char) = sourceCompatibilityOnly
|
||||
private def sourceCompatibilityOnly = error("For source compatibility only: should not get here.")
|
||||
}
|
||||
|
||||
def newPhase(prev: Phase): Phase = new AnalyzerPhase(prev)
|
||||
private class AnalyzerPhase(prev: Phase) extends Phase(prev)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue