Skip to content

Fix incremental compilation dependency tracking #2311

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 26, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions compiler/src/dotty/tools/dotc/sbt/ExtractDependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import Names._, NameOps._, StdNames._

import scala.collection.{Set, mutable}

import dotty.tools.io.{AbstractFile, Path, PlainFile, ZipArchive}
import dotty.tools.io.{AbstractFile, Path, ZipArchive}
import java.io.File

import java.util.{Arrays, Comparator}
Expand Down Expand Up @@ -101,14 +101,15 @@ class ExtractDependencies extends Phase {
val classSegments = Path(ze.path).segments
binaryDependency(zipFile, className(classSegments))
}
case pf: PlainFile =>
case pf: scala.reflect.io.PlainFile =>
val packages = dep.ownersIterator
.filter(x => x.is(PackageClass) && !x.isEffectiveRoot).length
// We can recover the fully qualified name of a classfile from
// its path
val classSegments = pf.givenPath.segments.takeRight(packages + 1)
binaryDependency(pf.file, className(classSegments))
case _ =>
ctx.warning(s"sbt-deps: Ignoring dependency $depFile of class ${depFile.getClass}")
}
} else if (depFile.file != currentSourceFile) {
ctx.sbtCallback.sourceDependency(depFile.file, currentSourceFile, context)
Expand Down