mirror of https://github.com/sbt/sbt.git
Revert "remove unneeded unlinking in compiler interface"
Unlinking is actually needed.
This reverts commit 1581d1b7e1.
This commit is contained in:
parent
d9a8ec0c22
commit
4bc993e0ba
|
|
@ -44,6 +44,7 @@ final class Analyzer(val global: CallbackGlobal) extends Compat
|
||||||
classFile(on) match
|
classFile(on) match
|
||||||
{
|
{
|
||||||
case Some((f,className,inOutDir)) =>
|
case Some((f,className,inOutDir)) =>
|
||||||
|
if(inOutDir && on.isJavaDefined) registerTopLevelSym(on)
|
||||||
f match
|
f match
|
||||||
{
|
{
|
||||||
case ze: ZipArchive#Entry => for(zip <- ze.underlyingSource; zipFile <- Option(zip.file) ) binaryDependency(zipFile, className)
|
case ze: ZipArchive#Entry => for(zip <- ze.underlyingSource; zipFile <- Option(zip.file) ) binaryDependency(zipFile, className)
|
||||||
|
|
|
||||||
|
|
@ -172,6 +172,7 @@ private final class CachedCompiler0(args: Array[String], initialLog: WeakLog) ex
|
||||||
def clear()
|
def clear()
|
||||||
{
|
{
|
||||||
callback0 = null
|
callback0 = null
|
||||||
|
atPhase(currentRun.namerPhase) { forgetAll() }
|
||||||
superDropRun()
|
superDropRun()
|
||||||
reporter = null
|
reporter = null
|
||||||
}
|
}
|
||||||
|
|
@ -188,6 +189,21 @@ private final class CachedCompiler0(args: Array[String], initialLog: WeakLog) ex
|
||||||
def findOnClassPath(name: String): Option[AbstractFile] =
|
def findOnClassPath(name: String): Option[AbstractFile] =
|
||||||
classPath.findClass(name).flatMap(_.binary.asInstanceOf[Option[AbstractFile]])
|
classPath.findClass(name).flatMap(_.binary.asInstanceOf[Option[AbstractFile]])
|
||||||
|
|
||||||
|
override def registerTopLevelSym(sym: Symbol) = toForget += sym
|
||||||
|
|
||||||
|
final def unlinkAll(m: Symbol) {
|
||||||
|
val scope = m.owner.info.decls
|
||||||
|
scope unlink m
|
||||||
|
scope unlink m.companionSymbol
|
||||||
|
}
|
||||||
|
|
||||||
|
def forgetAll()
|
||||||
|
{
|
||||||
|
for(sym <- toForget)
|
||||||
|
unlinkAll(sym)
|
||||||
|
toForget = mutable.Set()
|
||||||
|
}
|
||||||
|
|
||||||
// fine-control over external changes is unimplemented:
|
// fine-control over external changes is unimplemented:
|
||||||
// must drop whole CachedCompiler when !changes.isEmpty
|
// must drop whole CachedCompiler when !changes.isEmpty
|
||||||
def reload(changes: DependencyChanges)
|
def reload(changes: DependencyChanges)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue