From ea8fbb990f42e80d60d5904c8da0d39afc9b0c43 Mon Sep 17 00:00:00 2001 From: Eugene Yokota Date: Sun, 6 Sep 2020 06:02:09 -0400 Subject: [PATCH] Don't auto-invalidate java sources every cycle, take 2 This propagates "don't auto-invalidate Java sources in every cycle" to pipelining as well. Note that all Java sources are invalidated in Incremental.scala: https://github.com/sbt/zinc/blob/21c73c9e6758d27a388d3df70ccbe8f85e6d04e8/internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala#L386-L388 I don't think it's necessary to invalidate them for all cycles. --- .../src/main/scala/sbt/internal/inc/Incremental.scala | 1 - .../src/main/scala/sbt/internal/inc/IncrementalCommon.scala | 6 +----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala b/internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala index 37b4596258..1028829d47 100644 --- a/internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala +++ b/internal/zinc-core/src/main/scala/sbt/internal/inc/Incremental.scala @@ -412,7 +412,6 @@ object Incremental { classfileManager, output, 1, - pickleJava, ) else { val analysis = diff --git a/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala b/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala index cfe635b25a..7c2d8a446b 100644 --- a/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala +++ b/internal/zinc-core/src/main/scala/sbt/internal/inc/IncrementalCommon.scala @@ -70,11 +70,9 @@ private[inc] abstract class IncrementalCommon( classfileManager: XClassFileManager, output: Output, cycleNum: Int, - isPipeline: Boolean, ) { def toVf(ref: VirtualFileRef): VirtualFile = converter.toVirtualFile(ref) def sourceRefs: Set[VirtualFileRef] = allSources.asInstanceOf[Set[VirtualFileRef]] - lazy val javaSources: Set[VirtualFileRef] = sourceRefs.filter(_.id.endsWith(".java")) def hasNext: Boolean = invalidatedClasses.nonEmpty || initialChangedSources.nonEmpty @@ -120,7 +118,7 @@ private[inc] abstract class IncrementalCommon( // Return immediate analysis as all sources have been recompiled copy( if (continue && !handler.isFullCompilation) nextInvalidations else Set.empty, - if (continue && !handler.isFullCompilation && isPipeline) javaSources else Set.empty, + Set.empty, binaryChanges = IncrementalCommon.emptyChanges, previous = current, cycleNum = cycleNum + 1, @@ -231,7 +229,6 @@ private[inc] abstract class IncrementalCommon( classfileManager: XClassFileManager, output: Output, cycleNum: Int, - isPipeline: Boolean ): Analysis = { var s = CycleState( invalidatedClasses, @@ -245,7 +242,6 @@ private[inc] abstract class IncrementalCommon( classfileManager, output, cycleNum, - isPipeline, ) val it = iterations(s) while (it.hasNext) {