Skip to content
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

Enable cycle reporting when scalac isn't invoked #988

Merged
merged 1 commit into from
Jun 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,20 @@ object Analysis {

def empty: Analysis = Empty

def summary(a: Analysis): String = {
case class Sources(java: Set[String], scala: Set[String])

def sources(a: Analysis): Sources = {
def sourceFileForClass(className: String): VirtualFileRef =
a.relations.definesClass(className).headOption.getOrElse {
sys.error(s"Can't find source file for $className")
}
def isJavaClass(className: String) = sourceFileForClass(className).id.endsWith(".java")
val (j, s) = a.apis.allInternalClasses.partition(isJavaClass)
Sources(j.toSet, s.toSet)
}

def summary(a: Analysis): String = {
val Sources(j, s) = sources(a)
val c = a.stamps.allProducts
val ext = a.apis.allExternals
val jars = a.relations.allLibraryDeps.filter(_.id.endsWith(".jar"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,10 @@ private[inc] abstract class IncrementalCommon(
val continue = nextInvalidations.nonEmpty &&
lookup.shouldDoIncrementalCompilation(nextInvalidations, analysis)

// If we're completing the cycle, then mergeAndInvalidate has already been called
if (!completingCycle) {
val hasScala = Analysis.sources(partialAnalysis).scala.nonEmpty

// If we're completing the cycle and we had scala sources, then mergeAndInvalidate has already been called
if (!completingCycle || !hasScala) {
registerCycle(recompiledClasses, newApiChanges, nextInvalidations, continue)
}
CompileCycleResult(continue, nextInvalidations, analysis)
Expand Down