diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e22f465793..7a5906b26a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,9 @@ jobs: - os: ubuntu-latest java: 21 jobtype: 5 + - os: ubuntu-latest + java: 21 + jobtype: 6 runs-on: ${{ matrix.os }} steps: - name: Checkout @@ -67,23 +70,28 @@ jobs: shell: bash run: | sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks" - - name: Checkout Target Branch (4, 5) - if: ${{ github.event_name == 'pull_request' && (matrix.jobtype == 4 || matrix.jobtype == 5) }} + - name: Benchmark (AnalysisFormatBenchmark) (6) + if: ${{ matrix.jobtype == 6 }} + shell: bash + run: | + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks" + - name: Checkout Target Branch (4-6) + if: ${{ github.event_name == 'pull_request' && (matrix.jobtype >= 4 && matrix.jobtype <= 6) }} uses: actions/checkout@v4 with: - clean: false ref: ${{ github.event.pull_request.base.ref }} - - name: Setup SBT - uses: sbt/setup-sbt@v1 - if: ${{ github.event_name == 'pull_request' && (matrix.jobtype >= 4 && matrix.jobtype <= 6) }} - name: Benchmark (Scalac) against Target Branch (4) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 4 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "zincBenchmarks3/Jmh/clean" "runBenchmarks" + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Scalac.*" "runBenchmarks" - name: Benchmark (Shapeless) against Target Branch (5) if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 5 }} shell: bash run: | - sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "zincBenchmarks3/Jmh/clean" "runBenchmarks" - + sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*Shapeless.*" "runBenchmarks" +# - name: Benchmark (AnalysisFormatBenchmark) against Target Branch (6) +# if: ${{ github.event_name == 'pull_request' && matrix.jobtype == 6 }} +# shell: bash +# run: | +# sbt -v -Dfile.encoding=UTF-8 "-Dbenchmark.pattern=.*AnalysisFormatBenchmark.*" "runBenchmarks" diff --git a/.scala-steward.conf b/.scala-steward.conf index fd3928446b..00e3eba3a2 100644 --- a/.scala-steward.conf +++ b/.scala-steward.conf @@ -5,5 +5,6 @@ pullRequests.frequency = "14 days" updates.ignore = [ # as per discussion on sbt/zinc#1236, this is # "if it ain't broke don't fix it" territory - { groupId = "com.google.protobuf" } + { groupId = "com.google.protobuf" }, + { groupId = "org.eclipse.jgit" } ] diff --git a/build.sbt b/build.sbt index 481b1526bb..73d5216b96 100644 --- a/build.sbt +++ b/build.sbt @@ -29,6 +29,9 @@ def mimaSettings: Seq[Setting[?]] = Seq( "1.5.0", "1.6.0", "1.7.0", + "1.8.0", + "1.9.0", + "1.10.0", ) val versions = if (scalaVersion.value.startsWith("2.12.")) pre140 ++ post140 @@ -555,6 +558,9 @@ lazy val zincClasspath = (projectMatrix in internalPath / "zinc-classpath") exclude[IncompatibleResultTypeProblem]( "sbt.internal.inc.classpath.NativeCopyConfig.*" ), + exclude[IncompatibleResultTypeProblem]( + "sbt.internal.inc.ReflectUtilities.fields" + ), exclude[IncompatibleSignatureProblem]( "sbt.internal.inc.classpath.NativeCopyConfig.*" ), @@ -597,7 +603,6 @@ lazy val zincScripted = (projectMatrix in internalPath / "zinc-scripted") .enablePlugins(BuildInfoPlugin) .settings( baseSettings, - ideSkipProject := true, // otherwise IntelliJ complains publish / skip := true, name := "zinc Scripted", Compile / buildInfo := Nil, // Only generate build info for tests diff --git a/internal/compiler-bridge-test/src/test/scala/sbt/internal/inc/CompilingSpecification.scala b/internal/compiler-bridge-test/src/test/scala/sbt/internal/inc/CompilingSpecification.scala index 34ec66a001..4dde627b8d 100644 --- a/internal/compiler-bridge-test/src/test/scala/sbt/internal/inc/CompilingSpecification.scala +++ b/internal/compiler-bridge-test/src/test/scala/sbt/internal/inc/CompilingSpecification.scala @@ -9,7 +9,6 @@ import java.util.Optional import sbt.internal.inc.classpath.ClassLoaderCache import sbt.io.IO -import sbt.io.syntax._ import xsbti.compile._ import sbt.util.Logger import xsbti.TestCallback.ExtractedClassDependencies @@ -35,7 +34,7 @@ trait CompilingSpecification extends AbstractBridgeProviderTestkit { .get("zinc.build.compilerbridge.scalaVersion") .getOrElse(sys.error("zinc.build.compilerbridge.scalaVersion property not found")) def maxErrors = 100 - def scala213 = "2.13.14" + def scala213 = "2.13.15" def scalaCompiler(instance: xsbti.compile.ScalaInstance, bridgeJar: Path): AnalyzingCompiler = { val bridgeProvider = ZincUtil.constantBridgeProvider(instance, bridgeJar) @@ -281,8 +280,8 @@ trait CompilingSpecification extends AbstractBridgeProviderTestkit { val cp = (si.allJars).map(_.toPath) ++ Array(targetDir) val classpath = cp.map(converter.toVirtualFile) sc.doc( - sources = sources.toArray[VirtualFile], - classpath = classpath, + sources = sources.toIndexedSeq, + classpath = classpath.toIndexedSeq, converter = converter, outputDirectory = targetDir, options = Nil, @@ -305,7 +304,7 @@ trait CompilingSpecification extends AbstractBridgeProviderTestkit { val cp = (si.allJars).map(_.toPath) ++ Array(targetDir) val classpath = cp.map(converter.toVirtualFile) sc.console( - classpath = classpath, + classpath = classpath.toIndexedSeq, converter = converter, options = Nil, initialCommands = initial, @@ -327,7 +326,7 @@ trait CompilingSpecification extends AbstractBridgeProviderTestkit { val cp = (si.allJars).map(_.toPath) ++ Array(targetDir) val classpath = cp.map(converter.toVirtualFile) sc.interactiveConsole( - classpath = classpath, + classpath = classpath.toIndexedSeq, converter = converter, options = args.toSeq, initialCommands = "", diff --git a/internal/compiler-bridge/src/main/scala/xsbt/AbstractZincFile.scala b/internal/compiler-bridge/src/main/scala/xsbt/AbstractZincFile.scala index 2398339a22..b3352a8fdc 100644 --- a/internal/compiler-bridge/src/main/scala/xsbt/AbstractZincFile.scala +++ b/internal/compiler-bridge/src/main/scala/xsbt/AbstractZincFile.scala @@ -12,7 +12,6 @@ package xsbt import xsbti.{ PathBasedFile, VirtualFile } -import scala.reflect.io.Streamable private trait AbstractZincFile extends scala.reflect.io.AbstractFile { def underlying: VirtualFile @@ -25,7 +24,22 @@ private final class ZincPlainFile private[xsbt] (val underlying: PathBasedFile) private final class ZincVirtualFile private[xsbt] (val underlying: VirtualFile) extends scala.reflect.io.VirtualFile(underlying.name, underlying.id) with AbstractZincFile { - Streamable.closing(output)(_.write(Streamable.bytes(underlying.input))) // fill in the content + val buffer = new Array[Byte](4096) + + val in = underlying.input() + val output0 = output + + try { + var readBytes = in.read(buffer) + + while (readBytes != -1) { + output0.write(buffer, 0, readBytes) + readBytes = in.read(buffer) + } + } finally { + in.close() + output0.close() + } } private object AbstractZincFile { diff --git a/internal/compiler-bridge/src/main/scala/xsbt/CallbackGlobal.scala b/internal/compiler-bridge/src/main/scala/xsbt/CallbackGlobal.scala index 0b3663ece0..4c6f53d9d5 100644 --- a/internal/compiler-bridge/src/main/scala/xsbt/CallbackGlobal.scala +++ b/internal/compiler-bridge/src/main/scala/xsbt/CallbackGlobal.scala @@ -11,7 +11,7 @@ package xsbt -import xsbti.{ AnalysisCallback, Severity } +import xsbti.{ AnalysisCallback, AnalysisCallback3, Severity } import xsbti.compile._ import scala.tools.nsc._ @@ -20,6 +20,7 @@ import java.nio.file.{ Files, Path } import scala.reflect.io.PlainFile import scala.reflect.ReflectAccess._ +import scala.reflect.internal.util.BatchSourceFile /** Defines the interface of the incremental compiler hiding implementation details. */ sealed abstract class CallbackGlobal( @@ -78,6 +79,15 @@ sealed class ZincCompiler(settings: Settings, dreporter: DelegatingReporter, out extends CallbackGlobal(settings, dreporter, output) with ZincGlobalCompat { + override def getSourceFile(f: AbstractFile): BatchSourceFile = { + val file = (f, callback) match { + case (plainFile: PlainFile, callback3: AnalysisCallback3) => + AbstractZincFile(callback3.toVirtualFile(plainFile.file.toPath)) + case _ => f + } + super.getSourceFile(file) + } + final class ZincRun(compileProgress: CompileProgress) extends Run { override def informUnitStarting(phase: Phase, unit: CompilationUnit): Unit = { compileProgress.startUnit(phase.name, unit.source.path) diff --git a/internal/compiler-bridge/src/main/scala/xsbt/CompilerBridge.scala b/internal/compiler-bridge/src/main/scala/xsbt/CompilerBridge.scala index b491b0e71f..77260e7ac2 100644 --- a/internal/compiler-bridge/src/main/scala/xsbt/CompilerBridge.scala +++ b/internal/compiler-bridge/src/main/scala/xsbt/CompilerBridge.scala @@ -18,6 +18,8 @@ import scala.collection.mutable import scala.reflect.io.AbstractFile import scala.tools.nsc.CompilerCommand import Log.debug +import xsbti.compile.analysis.ReadSourceInfos + import java.io.File /** @@ -49,6 +51,16 @@ class InterfaceCompileFailed( override val toString: String ) extends xsbti.CompileFailed +class InterfaceCompileFailed2( + val arguments: Array[String], + val sourceInfos: ReadSourceInfos, + override val toString: String +) extends xsbti.CompileFailed2 { + import scala.collection.JavaConverters._ + val problems: Array[Problem] = + sourceInfos.getAllSourceInfos.values().asScala.flatMap(_.getReportedProblems).toArray +} + class InterfaceCompileCancelled(val arguments: Array[String], override val toString: String) extends xsbti.CompileCancelled @@ -149,8 +161,8 @@ private final class CachedCompiler0( underlyingReporter: DelegatingReporter, compileProgress: CompileProgress ): Unit = { - // cast down to AnalysisCallback2 - val callback2 = callback.asInstanceOf[xsbti.AnalysisCallback2] + // cast down to AnalysisCallback3 + val callback3 = callback.asInstanceOf[xsbti.AnalysisCallback3] compiler.set(callback, underlyingReporter) if (command.shouldStopWithInfo) { @@ -165,7 +177,7 @@ private final class CachedCompiler0( run.compileFiles(sources) processUnreportedWarnings(run) underlyingReporter.problems.foreach(p => - callback2.problem2( + callback3.problem2( p.category, p.position, p.message, @@ -180,8 +192,10 @@ private final class CachedCompiler0( } underlyingReporter.printSummary() - if (!noErrors(underlyingReporter)) - handleErrors(underlyingReporter, log) + if (!noErrors(underlyingReporter)) { + val infos = callback3.getSourceInfos + handleErrors(infos, log) + } // the case where we cancelled compilation _after_ some compilation errors got reported // will be handled by line above so errors still will be reported properly just potentially not @@ -195,6 +209,11 @@ private final class CachedCompiler0( throw new InterfaceCompileFailed(args, dreporter.problems, "Compilation failed") } + def handleErrors(sourceInfos: ReadSourceInfos, log: Logger): Nothing = { + debug(log, "Compilation failed (CompilerInterface)") + throw new InterfaceCompileFailed2(args, sourceInfos, "Compilation failed") + } + def handleCompilationCancellation(dreporter: DelegatingReporter, log: Logger): Nothing = { assert(dreporter.cancelled, "We should get here only if when compilation got cancelled") debug(log, "Compilation cancelled (CompilerInterface)") diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Access.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Access.java index 7b3be0e323..74a0235dd6 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Access.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Access.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnalyzedClass.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnalyzedClass.java index f336e30029..4a664649af 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnalyzedClass.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnalyzedClass.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotated.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotated.java index 6e78e95669..5ab0aa5942 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotated.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotated.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotation.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotation.java index 4afa7b7dba..93a76a9d24 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotation.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Annotation.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnnotationArgument.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnnotationArgument.java index 8604c7cf6d..5009f8e686 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnnotationArgument.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/AnnotationArgument.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassDefinition.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassDefinition.java index a1a95f09d4..ea58ea2877 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassDefinition.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassDefinition.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLike.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLike.java index 1bf398b592..b09cf3ec51 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLike.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLike.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLikeDef.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLikeDef.java index 28fc4712ee..1a8755dcb7 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLikeDef.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ClassLikeDef.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Companions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Companions.java index d7bf4e99e1..25ddd7103f 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Companions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Companions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Constant.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Constant.java index 1bd1b50701..3431489232 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Constant.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Constant.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Def.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Def.java index 3d893a1843..795393b30b 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Def.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Def.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Definition.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Definition.java index 4c204a9b89..ee0978c32d 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Definition.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Definition.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/DefinitionType.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/DefinitionType.java index d2f7d505fe..dd5782da17 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/DefinitionType.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/DefinitionType.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/DependencyContext.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/DependencyContext.java index 9bc6d4db11..2270e886b9 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/DependencyContext.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/DependencyContext.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/EmptyType.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/EmptyType.java index 011968329c..aa34a585b3 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/EmptyType.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/EmptyType.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Existential.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Existential.java index 47f840e3ba..a84934e3f4 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Existential.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Existential.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ExternalDependency.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ExternalDependency.java index 447539bb6a..e4978044ad 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ExternalDependency.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ExternalDependency.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/FieldLike.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/FieldLike.java index ceff4862e1..4e33a15669 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/FieldLike.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/FieldLike.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Id.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Id.java index d292a7d45e..0ca918d15f 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Id.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Id.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/IdQualifier.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/IdQualifier.java index 9956bb66c4..5c68301291 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/IdQualifier.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/IdQualifier.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/InternalDependency.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/InternalDependency.java index 7f4d9020d6..849cbd060d 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/InternalDependency.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/InternalDependency.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/MethodParameter.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/MethodParameter.java index 85befeee76..30e2ebec5c 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/MethodParameter.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/MethodParameter.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/NameHash.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/NameHash.java index 153f182433..8470e197cf 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/NameHash.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/NameHash.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Package.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Package.java index 831b1d46c2..6b2f66ba51 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Package.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Package.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterList.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterList.java index d902ad85f4..4d72c41ea0 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterList.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterList.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterModifier.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterModifier.java index cea8bbc975..5d5292ca77 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterModifier.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterModifier.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterRef.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterRef.java index 058f1c8afd..7c9982bca0 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterRef.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterRef.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Parameterized.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Parameterized.java index 5efedda684..ac1f108338 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Parameterized.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Parameterized.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterizedDefinition.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterizedDefinition.java index 604374ea1a..43d1478698 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterizedDefinition.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ParameterizedDefinition.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Path.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Path.java index 8ff2bebef2..a4fd51918b 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Path.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Path.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/PathComponent.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/PathComponent.java index d0568001ee..cc51b79245 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/PathComponent.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/PathComponent.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Polymorphic.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Polymorphic.java index 8a70bb1cfe..934a717c9d 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Polymorphic.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Polymorphic.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Private.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Private.java index 0c35cd88ef..d02b993a73 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Private.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Private.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Projection.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Projection.java index 509a63f5d9..b22568df39 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Projection.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Projection.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Protected.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Protected.java index 0090f16e42..1dd167ad3d 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Protected.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Protected.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Public.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Public.java index 1d777f7a5b..d2c4121825 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Public.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Public.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualified.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualified.java index ebeac7390c..5f927cd826 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualified.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualified.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualifier.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualifier.java index 7c90648529..b43b7d80bd 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualifier.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Qualifier.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Singleton.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Singleton.java index 0a66cb824b..1af73e7a24 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Singleton.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Singleton.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Structure.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Structure.java index 6bbb86af98..e7b4e88a56 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Structure.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Structure.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Super.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Super.java index 3219722f41..ab570c3fb4 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Super.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Super.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/This.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/This.java index b1ae7a0066..cb9627e9e8 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/This.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/This.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ThisQualifier.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ThisQualifier.java index 4a9781cce7..9cc5263c89 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/ThisQualifier.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/ThisQualifier.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Type.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Type.java index a427839a44..1a7d51f8a7 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Type.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Type.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeAlias.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeAlias.java index 658ca35120..c193e87ab2 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeAlias.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeAlias.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeDeclaration.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeDeclaration.java index 525ba41ebf..5d6db01480 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeDeclaration.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeDeclaration.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeMember.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeMember.java index 040924c686..699b0f25b3 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeMember.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeMember.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeParameter.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeParameter.java index a02a4f3f3d..5481e8f46c 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeParameter.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/TypeParameter.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Unqualified.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Unqualified.java index b481a4c977..505cce6509 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Unqualified.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Unqualified.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Val.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Val.java index 7a5c5fb429..41ff176cc1 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Val.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Val.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Var.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Var.java index a70498a3b9..09db27aaac 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Var.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Var.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Variance.java b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Variance.java index e8991d108f..efeb54baf1 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/api/Variance.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/api/Variance.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClassFileManagerType.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClassFileManagerType.java index 0a7b002866..a7efe1b1a7 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClassFileManagerType.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClassFileManagerType.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClasspathOptions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClasspathOptions.java index 3fac455fc5..23e267d758 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClasspathOptions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/ClasspathOptions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileOptions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileOptions.java index 35ce9fb2e7..85c8cf4775 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileOptions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileOptions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileResult.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileResult.java index 39759a3fe4..77a38fcd2e 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileResult.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/CompileResult.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Compilers.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Compilers.java index 4d1a5d79ee..6aa7b739e5 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Compilers.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Compilers.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/DeleteImmediatelyManagerType.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/DeleteImmediatelyManagerType.java index c211514862..9c87eefea8 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/DeleteImmediatelyManagerType.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/DeleteImmediatelyManagerType.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/FileHash.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/FileHash.java index 230b5526e5..78b701adc6 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/FileHash.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/FileHash.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncOptions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncOptions.java index 9ae4f41064..a73116eca8 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncOptions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncOptions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncToolOptions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncToolOptions.java index 7b7268fd14..417526fb5c 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncToolOptions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/IncToolOptions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Inputs.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Inputs.java index 00d5caceaf..012bb2ad5f 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Inputs.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Inputs.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniOptions.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniOptions.java index b1e4716f2b..fb6a21ed99 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniOptions.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniOptions.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniSetup.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniSetup.java index 23da8e1cc8..6509b36542 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniSetup.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/MiniSetup.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/PreviousResult.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/PreviousResult.java index 450a4e7e3e..09099447ba 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/PreviousResult.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/PreviousResult.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Setup.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Setup.java index e50a3c00a1..ced769f045 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Setup.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/Setup.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/TransactionalManagerType.java b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/TransactionalManagerType.java index 66b14db5e7..d813314dde 100644 --- a/internal/compiler-interface/src/main/contraband-java/xsbti/compile/TransactionalManagerType.java +++ b/internal/compiler-interface/src/main/contraband-java/xsbti/compile/TransactionalManagerType.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/compiler-interface/src/main/java/xsbti/AnalysisCallback3.java b/internal/compiler-interface/src/main/java/xsbti/AnalysisCallback3.java new file mode 100644 index 0000000000..b91afd0284 --- /dev/null +++ b/internal/compiler-interface/src/main/java/xsbti/AnalysisCallback3.java @@ -0,0 +1,26 @@ +/* + * Zinc - The incremental compiler for Scala. + * Copyright Scala Center, Lightbend, and Mark Harrah + * + * Licensed under Apache License 2.0 + * SPDX-License-Identifier: Apache-2.0 + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package xsbti; + +import xsbti.compile.analysis.ReadSourceInfos; + +import java.nio.file.Path; + +/** + * Extension to {@link AnalysisCallback2}. + * Similar to {@link AnalysisCallback2}, it serves as compatibility layer for Scala compilers. + */ +public interface AnalysisCallback3 extends AnalysisCallback2 { + VirtualFile toVirtualFile(Path path); + + ReadSourceInfos getSourceInfos(); +} diff --git a/internal/compiler-interface/src/main/java/xsbti/CompileFailed2.java b/internal/compiler-interface/src/main/java/xsbti/CompileFailed2.java new file mode 100644 index 0000000000..e5d4260a34 --- /dev/null +++ b/internal/compiler-interface/src/main/java/xsbti/CompileFailed2.java @@ -0,0 +1,22 @@ +/* + * Zinc - The incremental compiler for Scala. + * Copyright Scala Center, Lightbend, and Mark Harrah + * + * Licensed under Apache License 2.0 + * SPDX-License-Identifier: Apache-2.0 + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package xsbti; + +import xsbti.compile.analysis.ReadSourceInfos; + +public abstract class CompileFailed2 extends CompileFailed { + /** + * Returns SourceInfos containing problems for each file. + * This includes problems found by most recent compilation run. + */ + public abstract ReadSourceInfos sourceInfos(); +} diff --git a/internal/zinc-apiinfo/src/main/scala/sbt/internal/inc/ClassToAPI.scala b/internal/zinc-apiinfo/src/main/scala/sbt/internal/inc/ClassToAPI.scala index 2a91f0cf89..d3506f73d7 100644 --- a/internal/zinc-apiinfo/src/main/scala/sbt/internal/inc/ClassToAPI.scala +++ b/internal/zinc-apiinfo/src/main/scala/sbt/internal/inc/ClassToAPI.scala @@ -191,14 +191,29 @@ object ClassToAPI { cmap: ClassMap ): (api.Structure, api.Structure) = { lazy val cf = classFileForClass(c) - val methods = mergeMap(c, c.getDeclaredMethods, c.getMethods, methodToDef(enclPkg)) - val fields = mergeMap(c, c.getDeclaredFields, c.getFields, fieldToDef(c, cf, enclPkg)) + val methods = mergeMap( + c, + c.getDeclaredMethods.toIndexedSeq, + c.getMethods.toIndexedSeq, + methodToDef(enclPkg) + ) + val fields = mergeMap( + c, + c.getDeclaredFields.toIndexedSeq, + c.getFields.toIndexedSeq, + fieldToDef(c, cf, enclPkg) + ) val constructors = - mergeMap(c, c.getDeclaredConstructors, c.getConstructors, constructorToDef(enclPkg)) + mergeMap( + c, + c.getDeclaredConstructors.toIndexedSeq, + c.getConstructors.toIndexedSeq, + constructorToDef(enclPkg) + ) val classes = merge[Class[?]]( c, - c.getDeclaredClasses, - c.getClasses, + c.getDeclaredClasses.toIndexedSeq, + c.getClasses.toIndexedSeq, toDefinitions(cmap), (_: Seq[Class[?]]).partition(isStatic), _.getEnclosingClass != c @@ -240,7 +255,7 @@ object ClassToAPI { private def allSuperTypes(t: Type): Seq[Type] = { @tailrec def accumulate(t: Type, accum: Seq[Type] = Seq.empty): Seq[Type] = t match { case c: Class[?] => - val (parent, interfaces) = (c.getGenericSuperclass, c.getGenericInterfaces) + val (parent, interfaces) = (c.getGenericSuperclass, c.getGenericInterfaces.toIndexedSeq) accumulate(parent, (accum :+ parent) ++ flattenAll(interfaces)) case p: ParameterizedType => accumulate(p.getRawType, accum) @@ -263,7 +278,7 @@ object ClassToAPI { def types(ts: Seq[Type]): Array[api.Type] = ts.filter(_ ne null).map(reference).toArray def upperBounds(ts: Array[Type]): api.Type = - api.Structure.of(lzy(types(ts)), lzyEmptyDefArray, lzyEmptyDefArray) + api.Structure.of(lzy(types(ts.toIndexedSeq)), lzyEmptyDefArray, lzyEmptyDefArray) @deprecated("No longer used", "0.13.0") def parents(c: Class[?]): Seq[api.Type] = types(allSuperTypes(c)) @@ -507,11 +522,11 @@ object ClassToAPI { * We need this logic to trigger recompilation due to changes to pattern exhaustivity checking results. */ private def childrenOfSealedClass(c: Class[?]): Seq[api.Type] = - if (!c.isEnum) emptyTypeArray + if (!c.isEnum) emptyTypeArray.toIndexedSeq else { // Calling getCanonicalName() on classes from enum constants yields same string as enumClazz.getCanonicalName // Moreover old behaviour create new instance of enum - what may fail (e.g. in static block ) - Array(reference(c)) + Seq(reference(c)) } // full information not available from reflection @@ -556,7 +571,7 @@ object ClassToAPI { } def pathFromString(s: String): api.Path = - pathFromStrings(s.split("\\.")) + pathFromStrings(s.split("\\.").toIndexedSeq) def pathFromStrings(ss: Seq[String]): api.Path = api.Path.of((ss.map(api.Id.of(_)) :+ ThisRef).toArray) def packageName(c: Class[?]) = packageAndName(c)._1 diff --git a/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala b/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala index 608a1c8dad..e5e0313d26 100644 --- a/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala +++ b/internal/zinc-apiinfo/src/main/scala/xsbt/api/Discovery.scala @@ -34,13 +34,13 @@ class Discovery(baseClasses: Set[String], annotations: Set[String]) { case _ => Discovered.empty } def discover(c: ClassLike): Discovered = { - val onClass = Discovery.findAnnotations(c.annotations, annotations) + val onClass = Discovery.findAnnotations(c.annotations.toIndexedSeq, annotations) val onDefs = Discovery.defAnnotations(c.structure, annotations) ++ c.savedAnnotations.filter( annotations ) val module = isModule(c) new Discovered( - bases(c.name, c.structure.parents), + bases(c.name, c.structure.parents.toIndexedSeq), onClass ++ onDefs, module && hasMainMethod(c), module @@ -66,7 +66,7 @@ object Discovery { simpleName(a.base).filter(pred) }.toSet def defAnnotations(s: Structure, pred: String => Boolean): Set[String] = - defAnnotations(s.declared, pred) ++ defAnnotations(s.inherited, pred) + defAnnotations(s.declared.toIndexedSeq, pred) ++ defAnnotations(s.inherited.toIndexedSeq, pred) def defAnnotations(defs: Seq[Definition], pred: String => Boolean): Set[String] = findAnnotations( defs.flatMap { @@ -82,19 +82,21 @@ object Discovery { def isModule(c: ClassLike) = c.definitionType == DefinitionType.Module def hasMainMethod(c: ClassLike): Boolean = - hasMainMethod(c.structure.declared) || hasMainMethod(c.structure.inherited) + hasMainMethod(c.structure.declared.toIndexedSeq) || hasMainMethod( + c.structure.inherited.toIndexedSeq + ) def hasMainMethod(defs: Seq[Definition]): Boolean = defs.exists(isMainMethod) def isMainMethod(d: Definition): Boolean = d match { case d: Def => d.name == "main" && isPublic(d) && isConcrete(d) && isUnit(d.returnType) && isStringArray( - d.valueParameters + d.valueParameters.toIndexedSeq ) case _ => false } def isStringArray(vp: IndexedSeq[ParameterList]): Boolean = - vp.length == 1 && isStringArray(vp(0).parameters) + vp.length == 1 && isStringArray(vp(0).parameters.toIndexedSeq) def isStringArray(params: Seq[MethodParameter]): Boolean = params.length == 1 && isStringArray(params(0)) def isStringArray(p: MethodParameter): Boolean = diff --git a/internal/zinc-apiinfo/src/main/scala/xsbt/api/HashAPI.scala b/internal/zinc-apiinfo/src/main/scala/xsbt/api/HashAPI.scala index 6a3c0dfef5..005e27bc6a 100644 --- a/internal/zinc-apiinfo/src/main/scala/xsbt/api/HashAPI.scala +++ b/internal/zinc-apiinfo/src/main/scala/xsbt/api/HashAPI.scala @@ -432,8 +432,8 @@ final class HashAPI private ( extend(StructureHash) hashTypes(structure.parents, includeDefinitions) if (includeDefinitions) { - hashDefinitions(structure.declared, false, isTrait) - hashDefinitions(structure.inherited, false, isTrait) + hashDefinitions(structure.declared.toIndexedSeq, false, isTrait) + hashDefinitions(structure.inherited.toIndexedSeq, false, isTrait) } } def hashParameters(parameters: Array[TypeParameter], base: Type): Unit = { diff --git a/internal/zinc-apiinfo/src/main/scala/xsbt/api/SameAPI.scala b/internal/zinc-apiinfo/src/main/scala/xsbt/api/SameAPI.scala index bc926caa5f..8049d611f6 100644 --- a/internal/zinc-apiinfo/src/main/scala/xsbt/api/SameAPI.scala +++ b/internal/zinc-apiinfo/src/main/scala/xsbt/api/SameAPI.scala @@ -139,7 +139,10 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { // a.name == b.name && debug(sameAccess(a.access, b.access), "Access differed") && debug(sameModifiers(a.modifiers, b.modifiers), "Modifiers differed") && - debug(sameAnnotations(a.annotations, b.annotations), "Annotations differed") && + debug( + sameAnnotations(a.annotations.toIndexedSeq, b.annotations.toIndexedSeq), + "Annotations differed" + ) && debug(sameDefinitionSpecificAPI(a, b), "Definition-specific differed") } @@ -184,7 +187,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameAnnotation(a: Annotation, b: Annotation): Boolean = debug(sameType(a.base, b.base), "Annotation base type differed") && debug( - sameAnnotationArguments(a.arguments, b.arguments), + sameAnnotationArguments(a.arguments.toIndexedSeq, b.arguments.toIndexedSeq), "Annotation arguments differed (" + a + ") and (" + b + ")" ) def sameAnnotationArguments(a: Seq[AnnotationArgument], b: Seq[AnnotationArgument]): Boolean = @@ -203,7 +206,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameParameterizedDefinition(a: ParameterizedDefinition, b: ParameterizedDefinition): Boolean = debug( - sameTypeParameters(a.typeParameters, b.typeParameters), + sameTypeParameters(a.typeParameters.toIndexedSeq, b.typeParameters.toIndexedSeq), "Different type parameters for " + a.name ) && sameParameterizedSpecificAPI(a, b) @@ -222,7 +225,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameDefSpecificAPI(a: Def, b: Def): Boolean = debug( - sameValueParameters(a.valueParameters, b.valueParameters), + sameValueParameters(a.valueParameters.toIndexedSeq, b.valueParameters.toIndexedSeq), "Different def value parameters for " + a.name ) && debug(sameType(a.returnType, b.returnType), "Different def return type for " + a.name) @@ -253,7 +256,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { debug(sameTopLevel(a, b), "Top level flag differs") && sameDefinitionType(a.definitionType, b.definitionType) && sameType(a.selfType, b.selfType) && - sameSeq(a.childrenOfSealedClass, b.childrenOfSealedClass)(sameType) && + sameSeq(a.childrenOfSealedClass.toIndexedSeq, b.childrenOfSealedClass.toIndexedSeq)(sameType) && sameStructure(a.structure, b.structure) } @@ -265,7 +268,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameParameterList(a: ParameterList, b: ParameterList): Boolean = (a.isImplicit == b.isImplicit) && - sameParameters(a.parameters, b.parameters) + sameParameters(a.parameters.toIndexedSeq, b.parameters.toIndexedSeq) def sameParameters(a: Seq[MethodParameter], b: Seq[MethodParameter]): Boolean = sameSeq(a, b)(sameMethodParameter) def sameMethodParameter(a: MethodParameter, b: MethodParameter): Boolean = @@ -283,8 +286,11 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameTypeParameters(a: Seq[TypeParameter], b: Seq[TypeParameter]): Boolean = debug(sameSeq(a, b)(sameTypeParameter), "Different type parameters") def sameTypeParameter(a: TypeParameter, b: TypeParameter): Boolean = { - sameTypeParameters(a.typeParameters, b.typeParameters) && - debug(sameAnnotations(a.annotations, b.annotations), "Different type parameter annotations") && + sameTypeParameters(a.typeParameters.toIndexedSeq, b.typeParameters.toIndexedSeq) && + debug( + sameAnnotations(a.annotations.toIndexedSeq, b.annotations.toIndexedSeq), + "Different type parameter annotations" + ) && debug(sameVariance(a.variance, b.variance), "Different variance") && debug(sameType(a.lowerBound, b.lowerBound), "Different lower bound") && debug(sameType(a.upperBound, b.upperBound), "Different upper bound") && @@ -326,14 +332,14 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { sameType(ca.baseType, cb.baseType) && ca.value == cb.value def sameExistentialType(a: Existential, b: Existential): Boolean = - sameTypeParameters(a.clause, b.clause) && + sameTypeParameters(a.clause.toIndexedSeq, b.clause.toIndexedSeq) && sameType(a.baseType, b.baseType) def samePolymorphicType(a: Polymorphic, b: Polymorphic): Boolean = - sameTypeParameters(a.parameters, b.parameters) && + sameTypeParameters(a.parameters.toIndexedSeq, b.parameters.toIndexedSeq) && sameType(a.baseType, b.baseType) def sameAnnotatedType(a: Annotated, b: Annotated): Boolean = sameType(a.baseType, b.baseType) && - sameAnnotations(a.annotations, b.annotations) + sameAnnotations(a.annotations.toIndexedSeq, b.annotations.toIndexedSeq) def sameStructure(a: Structure, b: Structure): Boolean = samePending(a, b)(sameStructureDirect) @@ -341,9 +347,9 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { if (pending add ((a, b))) f(a, b) else true def sameStructureDirect(a: Structure, b: Structure): Boolean = { - sameSeq(a.parents, b.parents)(sameType) && - sameMembers(a.declared, b.declared) && - sameMembers(a.inherited, b.inherited) + sameSeq(a.parents.toIndexedSeq, b.parents.toIndexedSeq)(sameType) && + sameMembers(a.declared.toIndexedSeq, b.declared.toIndexedSeq) && + sameMembers(a.inherited.toIndexedSeq, b.inherited.toIndexedSeq) } def sameMembers(a: Seq[Definition], b: Seq[Definition]): Boolean = @@ -358,7 +364,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { def sameParameterized(a: Parameterized, b: Parameterized): Boolean = sameType(a.baseType, b.baseType) && - sameSeq(a.typeArguments, b.typeArguments)(sameType) + sameSeq(a.typeArguments.toIndexedSeq, b.typeArguments.toIndexedSeq)(sameType) def sameParameterRef(a: ParameterRef, b: ParameterRef): Boolean = sameTags(a.id, b.id) def sameSingleton(a: Singleton, b: Singleton): Boolean = samePath(a.path, b.path) @@ -367,7 +373,7 @@ class SameAPI(includePrivate: Boolean, includeParamNames: Boolean) { (a.id == b.id) def samePath(a: Path, b: Path): Boolean = - samePathComponents(a.components, b.components) + samePathComponents(a.components.toIndexedSeq, b.components.toIndexedSeq) def samePathComponents(a: Seq[PathComponent], b: Seq[PathComponent]): Boolean = sameSeq(a, b)(samePathComponent) def samePathComponent(a: PathComponent, b: PathComponent): Boolean = diff --git a/internal/zinc-apiinfo/src/main/scala/xsbt/api/ShowAPI.scala b/internal/zinc-apiinfo/src/main/scala/xsbt/api/ShowAPI.scala index 3c706b8b61..14ae4f456f 100644 --- a/internal/zinc-apiinfo/src/main/scala/xsbt/api/ShowAPI.scala +++ b/internal/zinc-apiinfo/src/main/scala/xsbt/api/ShowAPI.scala @@ -41,12 +41,14 @@ object ShowAPI { case v: Val => showMonoDef(v, "val") + ": " + showType(v.tpe) case v: Var => showMonoDef(v, "var") + ": " + showType(v.tpe) case d: Def => - showPolyDef(d, "def") + showValueParams(d.valueParameters) + ": " + showType(d.returnType) + showPolyDef(d, "def") + showValueParams(d.valueParameters.toIndexedSeq) + ": " + showType( + d.returnType + ) case ta: TypeAlias => showPolyDef(ta, "type") + " = " + showType(ta.tpe) case td: TypeDeclaration => showPolyDef(td, "type") + showBounds(td.lowerBound, td.upperBound) case cl: ClassLike => showMonoDef(d, showDefinitionType(cl.definitionType)) + - showTypeParameters(cl.typeParameters) + " extends " + showTemplate(cl) + showTypeParameters(cl.typeParameters.toIndexedSeq) + " extends " + showTemplate(cl) case cl: ClassLikeDef => showPolyDef(cl, showDefinitionType(cl.definitionType)) } @@ -59,9 +61,11 @@ object ShowAPI { cl.structure.parents.map(showNestedType).mkString("", " with ", " {") + showSelf + lines( - truncateDecls(cl.structure.inherited).map(d => "^inherited^ " + showNestedDefinition(d)) + truncateDecls(cl.structure.inherited).toIndexedSeq.map(d => + "^inherited^ " + showNestedDefinition(d) + ) ) + - lines(truncateDecls(cl.structure.declared).map(showNestedDefinition)) + + lines(truncateDecls(cl.structure.declared).toIndexedSeq.map(showNestedDefinition)) + "}" } @@ -73,7 +77,7 @@ object ShowAPI { case p: Parameterized => showType(p.baseType) + p.typeArguments.map(showType).mkString("[", ", ", "]") case c: Constant => showType(c.baseType) + "(" + c.value + ")" - case a: Annotated => showAnnotations(a.annotations) + " " + showType(a.baseType) + case a: Annotated => showAnnotations(a.annotations.toIndexedSeq) + " " + showType(a.baseType) case s: Structure => s.parents.map(showType).mkString(" with ") + ( if (nesting <= 0) "{ }" @@ -90,7 +94,7 @@ object ShowAPI { case p: Polymorphic => showType(p.baseType) + ( if (nesting <= 0) " [ ]" - else showNestedTypeParameters(p.parameters) + else showNestedTypeParameters(p.parameters.toIndexedSeq) ) } @@ -103,22 +107,22 @@ object ShowAPI { private def space(s: String) = if (s.isEmpty) s else s + " " private def showMonoDef(d: Definition, label: String)(implicit nesting: Int): String = - space(showAnnotations(d.annotations)) + space(showAccess(d.access)) + space( + space(showAnnotations(d.annotations.toIndexedSeq)) + space(showAccess(d.access)) + space( showModifiers(d.modifiers) ) + space(label) + d.name private def showPolyDef(d: ParameterizedDefinition, label: String)( implicit nesting: Int ): String = - showMonoDef(d, label) + showTypeParameters(d.typeParameters) + showMonoDef(d, label) + showTypeParameters(d.typeParameters.toIndexedSeq) private def showTypeParameters(tps: Seq[TypeParameter])(implicit nesting: Int): String = if (tps.isEmpty) "" else tps.map(showTypeParameter).mkString("[", ", ", "]") private def showTypeParameter(tp: TypeParameter)(implicit nesting: Int): String = - showAnnotations(tp.annotations) + " " + showVariance(tp.variance) + tp.id + showTypeParameters( - tp.typeParameters + showAnnotations(tp.annotations.toIndexedSeq) + " " + showVariance(tp.variance) + tp.id + showTypeParameters( + tp.typeParameters.toIndexedSeq ) + " " + showBounds(tp.lowerBound, tp.upperBound) private def showAnnotations(as: Seq[Annotation])(implicit nesting: Int) = diff --git a/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala b/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala index 353a52eb3d..5b413af13c 100644 --- a/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala +++ b/internal/zinc-benchmarks/src/test/scala/xsbt/AnalysisFormatBenchmark.scala @@ -35,7 +35,7 @@ class AnalysisFormatBenchmark { IO.copyFile(f, f2) assert(f2.exists()) } - this.cached = readAll("", FileAnalysisStore.binary(_)) + this.cached = readAll("", FileAnalysisStore.text(_)) writeAll("-ref-text", FileAnalysisStore.text(_), cached) // writeAll("-ref-ctext", ConsistentFileAnalysisStore.text(_, ReadWriteMappers.getEmptyMappers), cached) writeAll( @@ -62,26 +62,12 @@ class AnalysisFormatBenchmark { if (temp != null) IO.delete(temp) } - @Benchmark - def readBinary(bh: Blackhole): Unit = bh.consume(readAll("", FileAnalysisStore.binary(_))) - - @Benchmark - def readText(bh: Blackhole): Unit = bh.consume(readAll("-ref-text", FileAnalysisStore.text(_))) - @Benchmark def readConsistentBinary(bh: Blackhole): Unit = bh.consume( readAll("-ref-cbin", ConsistentFileAnalysisStore.binary(_, ReadWriteMappers.getEmptyMappers)) ) - @Benchmark - def writeBinary(bh: Blackhole): Unit = - bh.consume(writeAll("-test-bin", FileAnalysisStore.binary(_), cached)) - - @Benchmark - def writeText(bh: Blackhole): Unit = - bh.consume(writeAll("-test-text", FileAnalysisStore.text(_), cached)) - @Benchmark def writeConsistentBinary(bh: Blackhole): Unit = bh.consume( diff --git a/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala b/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala index b033303080..72e6dfeb30 100644 --- a/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala +++ b/internal/zinc-benchmarks/src/test/scala/xsbt/ZincBenchmark.scala @@ -107,7 +107,7 @@ private[xsbt] class ZincBenchmark(toCompile: BenchmarkProject, zincEnabled: Bool private[xsbt] object ZincBenchmark { // This is the Scala version used to compile the benchmark project // do not use `scala.util.Properties.versionNumberString`. - val scalaVersion = "2.13.14" + val scalaVersion = "2.13.15" /* ************************************************************* */ /* Utils to programmatically instantiate Compiler from sbt setup */ diff --git a/internal/zinc-classfile/src/main/java/sbt/internal/inc/zip/ZipCentralDir.java b/internal/zinc-classfile/src/main/java/sbt/internal/inc/zip/ZipCentralDir.java index c0ca6d8aa0..4a9790f4a5 100644 --- a/internal/zinc-classfile/src/main/java/sbt/internal/inc/zip/ZipCentralDir.java +++ b/internal/zinc-classfile/src/main/java/sbt/internal/inc/zip/ZipCentralDir.java @@ -47,7 +47,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.util.*; -import java.util.zip.ZipError; import java.util.zip.ZipException; import static java.nio.file.StandardOpenOption.READ; diff --git a/internal/zinc-classfile/src/main/scala/sbt/internal/inc/classfile/Parser.scala b/internal/zinc-classfile/src/main/scala/sbt/internal/inc/classfile/Parser.scala index f68140fd9c..789c6476d5 100644 --- a/internal/zinc-classfile/src/main/scala/sbt/internal/inc/classfile/Parser.scala +++ b/internal/zinc-classfile/src/main/scala/sbt/internal/inc/classfile/Parser.scala @@ -39,13 +39,13 @@ import Constants._ private[sbt] object Parser { def apply(file: Path, log: Logger): ClassFile = - Using.bufferedInputStream(Files.newInputStream(file))(parse(file.toString, log)).right.get + Using.bufferedInputStream(Files.newInputStream(file))(parse(file.toString, log)).toOption.get def apply(file: File, log: Logger): ClassFile = - Using.fileInputStream(file)(parse(file.toString, log)).right.get + Using.fileInputStream(file)(parse(file.toString, log)).toOption.get def apply(url: URL, log: Logger): ClassFile = - usingUrlInputStreamWithoutCaching(url)(parse(url.toString, log)).right.get + usingUrlInputStreamWithoutCaching(url)(parse(url.toString, log)).toOption.get // JarURLConnection with caching enabled will never close the jar private val usingUrlInputStreamWithoutCaching = Using.resource((u: URL) => @@ -106,7 +106,7 @@ private[sbt] object Parser { in.readUnsignedShort(), toString(in.readUnsignedShort()), toString(in.readUnsignedShort()), - array(in.readUnsignedShort())(parseAttribute()) + array(in.readUnsignedShort())(parseAttribute()).toIndexedSeq ) private def parseAttribute() = { val nameIndex = in.readUnsignedShort() diff --git a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ReflectUtilities.scala b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ReflectUtilities.scala index c98e040960..c46fa13f5a 100644 --- a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ReflectUtilities.scala +++ b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ReflectUtilities.scala @@ -13,6 +13,7 @@ package sbt package internal package inc +import java.lang.reflect.Field import scala.collection._ object ReflectUtilities { @@ -33,10 +34,10 @@ object ReflectUtilities { def ancestry(clazz: Class[?]): List[Class[?]] = if (clazz == classOf[AnyRef] || !classOf[AnyRef].isAssignableFrom(clazz)) List(clazz) - else clazz :: ancestry(clazz.getSuperclass); + else clazz :: ancestry(clazz.getSuperclass) - def fields(clazz: Class[?]) = - mutable.OpenHashMap(ancestry(clazz).flatMap(_.getDeclaredFields).map(f => (f.getName, f))*) + def fields(clazz: Class[?]): mutable.Map[String, Field] = + mutable.AnyRefMap(ancestry(clazz).flatMap(_.getDeclaredFields).map(f => (f.getName, f))*) /** * Collects all `val`s of type `T` defined on value `self`. diff --git a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ScalaInstance.scala b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ScalaInstance.scala index 41ee277c2f..b282301521 100644 --- a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ScalaInstance.scala +++ b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/ScalaInstance.scala @@ -266,7 +266,7 @@ object ScalaInstance { /** Return all the required Scala jars from a path `scalaHome`. */ def allJars(scalaHome: File): Seq[File] = - IO.listFiles(scalaLib(scalaHome)).filter(f => !blacklist(f.getName)) + IO.listFiles(scalaLib(scalaHome)).toIndexedSeq.filter(f => !blacklist(f.getName)) private[this] def scalaLib(scalaHome: File): File = new File(scalaHome, "lib") diff --git a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClasspathUtilities.scala b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClasspathUtilities.scala index 15984d3f2e..0f58414cc0 100644 --- a/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClasspathUtilities.scala +++ b/internal/zinc-classpath/src/main/scala/sbt/internal/inc/classpath/ClasspathUtilities.scala @@ -81,7 +81,7 @@ object ClasspathUtil { classpath: Seq[Path], instance: ScalaInstance ): Map[String, String] = { - createClasspathResources(classpath, instance.libraryJars.map(_.toPath)) + createClasspathResources(classpath, instance.libraryJars.toIndexedSeq.map(_.toPath)) } def createClasspathResources(appPaths: Seq[Path], bootPaths: Seq[Path]): Map[String, String] = { diff --git a/internal/zinc-compile-core/src/main/contraband-java/xsbti/ReporterConfig.java b/internal/zinc-compile-core/src/main/contraband-java/xsbti/ReporterConfig.java index 1c34deaddb..8be6ec8764 100644 --- a/internal/zinc-compile-core/src/main/contraband-java/xsbti/ReporterConfig.java +++ b/internal/zinc-compile-core/src/main/contraband-java/xsbti/ReporterConfig.java @@ -1,5 +1,5 @@ /** - * This code is generated using [[https://www.scala-sbt.org/contraband/ sbt-contraband]]. + * This code is generated using [[https://www.scala-sbt.org/contraband]]. */ // DO NOT EDIT MANUALLY diff --git a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala index 8773d3b5a8..1ad475e421 100644 --- a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala +++ b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/CompilerArguments.scala @@ -88,7 +88,8 @@ final class CompilerArguments( */ def finishClasspath(classpath: Seq[Path]): Seq[Path] = { val filteredClasspath = filterLibrary(classpath) - val extraCompiler = include(cpOptions.compiler, scalaInstance.compilerJars.map(_.toPath)*) + val extraCompiler = + include(cpOptions.compiler, scalaInstance.compilerJars.toIndexedSeq.map(_.toPath)*) val otherJars = scalaInstance.otherJars.toList.map(_.toPath) val extraClasspath = include(cpOptions.extra, otherJars*) filteredClasspath ++ extraCompiler ++ extraClasspath diff --git a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/RawCompiler.scala b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/RawCompiler.scala index 137b9dd5c1..ce993e725b 100644 --- a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/RawCompiler.scala +++ b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/RawCompiler.scala @@ -15,6 +15,7 @@ package inc import java.nio.file.Path import sbt.internal.util.FeedbackProvidedException +import xsbti.compile.analysis.ReadSourceInfos import xsbti.compile.{ ClasspathOptions, ScalaInstance => XScalaInstance } /** @@ -98,11 +99,12 @@ class CompileFailed( val arguments: Array[String], override val toString: String, val problems: Array[xsbti.Problem], + val sourceInfosOption: Option[ReadSourceInfos], cause: Throwable ) extends xsbti.CompileFailed(cause) with FeedbackProvidedException { def this(arguments: Array[String], toString: String, problems: Array[xsbti.Problem]) = { - this(arguments, toString, problems, null) + this(arguments, toString, problems, None, null) } } diff --git a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaErrorParser.scala b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaErrorParser.scala index cb8c860580..6692f3ef53 100644 --- a/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaErrorParser.scala +++ b/internal/zinc-compile-core/src/main/scala/sbt/internal/inc/javac/JavaErrorParser.scala @@ -270,10 +270,17 @@ class JavaErrorParser(relativeDir: File = new File(new File(".").getAbsolutePath () } + val nonProblem: Parser[Unit] = { + val skipLine = + ("Loading source file" | "Constructing Javadoc information") ~ """[^\r\n]*(\r\n|\n)?""".r + rep(skipLine) ^^ (_ => ()) + } + val potentialProblem: Parser[Problem] = warningMessage | errorMessage | noteMessage | javacError | javacWarning - val javacOutput: Parser[Seq[Problem]] = rep(potentialProblem) <~ opt(outputSumamry) + val javacOutput: Parser[Seq[Problem]] = + opt(nonProblem) ~> rep(potentialProblem) <~ opt(outputSumamry) /** * Example: diff --git a/internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/javaErrorParserSpec.scala b/internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/JavaErrorParserSpec.scala similarity index 89% rename from internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/javaErrorParserSpec.scala rename to internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/JavaErrorParserSpec.scala index 5e4d8244f9..b092adfff8 100644 --- a/internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/javaErrorParserSpec.scala +++ b/internal/zinc-compile-core/src/test/scala/sbt/internal/inc/javac/JavaErrorParserSpec.scala @@ -23,6 +23,7 @@ class JavaErrorParserSpec extends UnitSpec with Diagrams { "The JavaErrorParser" should "be able to parse Linux errors" in parseSampleLinux() it should "be able to parse windows file names" in parseWindowsFile() it should "be able to parse windows errors" in parseSampleWindows() + it should "be able to parse javac non-problems" in parseSampleNonProblem() it should "be able to parse javac warnings" in parseJavacWarning() it should "be able to parse javac errors" in parseSampleJavac() it should "register the position of errors" in parseErrorPosition() @@ -47,6 +48,14 @@ class JavaErrorParserSpec extends UnitSpec with Diagrams { problems(0).position.sourcePath.get shouldBe (windowsFile) } + def parseSampleNonProblem() = { + val parser = new JavaErrorParser() + val logger = ConsoleLogger() + val problems = parser.parseProblems(sampleNonProblemMessage, logger) + + assert(problems.size == 2) + } + def parseWindowsFile() = { val parser = new JavaErrorParser() parser.parse(parser.fileAndLineNo, sampleWindowsMessage) match { @@ -198,6 +207,21 @@ class JavaErrorParserSpec extends UnitSpec with Diagrams { |return baz(); """.stripMargin + def sampleNonProblemMessage = + raw""" + |Loading source file D:\Repos\zinc\internal\zinc-compile-core\target\jvm-2.13\test-classes\sbt\internal\inc\javac\test1.java... + |Constructing Javadoc information... + |D:\Repos\zinc\internal\zinc-compile-core\target\jvm-2.13\test-classes\sbt\internal\inc\javac\test1.java:14: error: class Test is public, should be declared in a file named Test.java + |public class Test { + | ^ + |D:\Repos\zinc\internal\zinc-compile-core\target\jvm-2.13\test-classes\sbt\internal\inc\javac\test1.java:15: error: cannot find symbol + | public NotFound foo() { return 5; } + | ^ + | symbol: class NotFound + | location: class Test + |2 errors + """.stripMargin.trim + def sampleJavacWarning = "warning: [options] system modules path not set in conjunction with -source 17" 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 95a7420242..d15c8f3be2 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 @@ -590,7 +590,7 @@ private final class AnalysisCallback( progress: Option[CompileProgress], incHandlerOpt: Option[Incremental.IncrementalCallback], log: Logger -) extends xsbti.AnalysisCallback2 { +) extends xsbti.AnalysisCallback3 { import Incremental.CompileCycleResult // This must have a unique value per AnalysisCallback @@ -674,6 +674,8 @@ private final class AnalysisCallback( () } + override def toVirtualFile(path: Path): VirtualFile = converter.toVirtualFile(path) + override def problem2( category: String, pos: Position, @@ -886,7 +888,7 @@ private final class AnalysisCallback( val externalParentsAPI = externalParents.map(analysis.apis.externalAPI) val internalParentsAPI = internalParents.map(analysis.apis.internalAPI) val parentsHashes = (externalParentsAPI ++ internalParentsAPI).map(_.extraHash()) - parentsHashes.fold(currentExtraHash)(_ ^ _) + (parentsHashes + currentExtraHash).hashCode() case None => currentExtraHash } } @@ -1089,6 +1091,25 @@ private final class AnalysisCallback( } } + def getSourceInfos: SourceInfos = { + // Collect Source Info from current run + val sources = reporteds.keySet ++ unreporteds.keySet ++ mainClasses.keySet + val sourceToInfo = sources.map { source => + val info = SourceInfos.makeInfo( + getOrNil(reporteds.iterator.map { case (k, v) => k -> v.asScala.toSeq }.toMap, source), + getOrNil(unreporteds.iterator.map { case (k, v) => k -> v.asScala.toSeq }.toMap, source), + getOrNil(mainClasses.iterator.map { case (k, v) => k -> v.asScala.toSeq }.toMap, source) + ) + (source, info) + }.toMap + val sourceInfoFromCurrentRun = SourceInfos.of(sourceToInfo) + // Collect reported problems from previous run + incHandlerOpt.map(_.previousAnalysisPruned) match { + case Some(prevAnalysis) => prevAnalysis.infos ++ sourceInfoFromCurrentRun + case None => sourceInfoFromCurrentRun + } + } + override def apiPhaseCompleted(): Unit = { // If we know we're done with cycles (presumably because all sources were invalidated) we can store early analysis // and picke data now. Otherwise, we need to wait for dependency information to decide if there are more cycles. 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 59eec02259..f78e7cf283 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 @@ -470,16 +470,10 @@ private[inc] abstract class IncrementalCommon( val dependsOnClass = findClassDependencies(_, relations) val firstClassInvalidation: Set[String] = { val invalidated = - if (invalidateTransitively) { - // Invalidate by brute force (normally happens when we've done more than 3 incremental runs) - IncrementalCommon.transitiveDeps(initial, log)(dependsOnClass) - } else { - changes.apiChanges.flatMap(invalidateClassesInternally(relations, _, isScalaClass)).toSet - } - val included = includeTransitiveInitialInvalidations(initial, invalidated, dependsOnClass) - log.debug("Final step, transitive dependencies:\n\t" + included) - included + changes.apiChanges.flatMap(invalidateClassesInternally(relations, _, isScalaClass)).toSet + includeTransitiveInitialInvalidations(initial, invalidated, dependsOnClass) } + log.debug("Final step, transitive dependencies:\n\t" + firstClassInvalidation) // Invalidate classes linked with a class file that is produced by more than one source file val secondClassInvalidation = IncrementalCommon.invalidateNamesProducingSameClassFile(relations) @@ -504,6 +498,7 @@ private[inc] abstract class IncrementalCommon( val transitive = IncrementalCommon.transitiveDeps(recompiledClasses, log)(dependsOnClass) (transitive -- recompiledClasses).filter(analysis.apis.internalAPI(_).hasMacro) } + log.debug(s"Invalidated macros due to upstream dependencies change: ${thirdClassInvalidation}") val newInvalidations = (firstClassInvalidation -- recompiledClasses) ++ secondClassInvalidation ++ thirdClassInvalidation @@ -512,7 +507,13 @@ private[inc] abstract class IncrementalCommon( Set.empty } else { if (invalidateTransitively) { - newInvalidations ++ recompiledClasses + val firstClassTransitiveInvalidation = includeTransitiveInitialInvalidations( + initial, + IncrementalCommon.transitiveDeps(initial, log)(dependsOnClass), + dependsOnClass + ) + log.debug("Invalidate by brute force:\n\t" + firstClassTransitiveInvalidation) + firstClassTransitiveInvalidation ++ secondClassInvalidation ++ thirdClassInvalidation ++ recompiledClasses } else { firstClassInvalidation ++ secondClassInvalidation ++ thirdClassInvalidation } @@ -539,14 +540,7 @@ private[inc] abstract class IncrementalCommon( val removedClasses = classNames(removedSrcs) val dependentOnRemovedClasses = removedClasses.flatMap(previous.memberRef.internal.reverse) val modifiedClasses = classNames(modifiedSrcs) - val mutualDependentOnModifiedClasses = { - val dependentOnModifiedClasses = modifiedClasses.flatMap(previous.memberRef.internal.reverse) - dependentOnModifiedClasses.filter(dependent => - previous.memberRef.internal.reverse(dependent).exists(modifiedClasses) - ) - } - val invalidatedClasses = - removedClasses ++ dependentOnRemovedClasses ++ modifiedClasses ++ mutualDependentOnModifiedClasses + val invalidatedClasses = removedClasses ++ dependentOnRemovedClasses ++ modifiedClasses val byProduct = changes.removedProducts.flatMap(previous.produced) val byLibraryDep = changes.libraryDeps.flatMap(previous.usesLibrary) diff --git a/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ConsistentAnalysisFormatSuite.scala b/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ConsistentAnalysisFormatSuite.scala index 97f9c9a12f..02f9457723 100644 --- a/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ConsistentAnalysisFormatSuite.scala +++ b/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ConsistentAnalysisFormatSuite.scala @@ -2,12 +2,7 @@ package sbt.inc.consistent import org.scalatest.funsuite.AnyFunSuite import sbt.internal.inc.consistent.* -import sbt.io.IO - import java.io.* -import java.util.Arrays -import java.util.zip.GZIPInputStream -import scala.util.Random class ConsistentAnalysisFormatSuite extends AnyFunSuite { diff --git a/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ParallelGzipOutputStreamSpecification.scala b/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ParallelGzipOutputStreamSpecification.scala index cf8b43a0f0..061064eeab 100644 --- a/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ParallelGzipOutputStreamSpecification.scala +++ b/internal/zinc-persist/src/test/scala/sbt/inc/consistent/ParallelGzipOutputStreamSpecification.scala @@ -3,8 +3,7 @@ package sbt.inc.consistent import org.scalatest.flatspec.AnyFlatSpec import org.scalatest.matchers.should.Matchers -import java.io.{ BufferedInputStream, ByteArrayInputStream, ByteArrayOutputStream } -import java.util.zip.GZIPInputStream +import java.io.{ ByteArrayInputStream, ByteArrayOutputStream } import java.nio.file.{ Files, Paths, StandardOpenOption } import sbt.internal.inc.consistent.ParallelGzipOutputStream import sbt.io.IO diff --git a/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala b/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala index 5d52f655d0..dc66e27216 100644 --- a/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala +++ b/internal/zinc-scripted/src/test/scala/sbt/internal/inc/IncHandler.scala @@ -803,7 +803,10 @@ case class ProjectStructure( } val scalacOptions: List[String] = Option(map.get("scalac.options")).toList - .flatMap(_.toString.split(" +").toList) ++ + .flatMap(_.toString.split(" +").toList.map(_.replace( + "[basedir]", + baseDirectory.toAbsolutePath.toString + ))) ++ // for now assume export pipelining for all pipelining subprojects (if (incOptions.pipelining) List("-Ypickle-java", "-Ypickle-write", earlyOutput.toString) else Nil) diff --git a/internal/zinc-testing/src/main/scala/xsbti/TestCallback.scala b/internal/zinc-testing/src/main/scala/xsbti/TestCallback.scala index 907574188b..da67307423 100644 --- a/internal/zinc-testing/src/main/scala/xsbti/TestCallback.scala +++ b/internal/zinc-testing/src/main/scala/xsbti/TestCallback.scala @@ -15,12 +15,12 @@ import java.io.File import java.nio.file.Path import java.{ util => ju } import ju.Optional - -import xsbti.api.{ DependencyContext, ClassLike } +import xsbti.api.{ ClassLike, DependencyContext } +import xsbti.compile.analysis.ReadSourceInfos import scala.collection.mutable.ArrayBuffer -class TestCallback extends AnalysisCallback2 { +class TestCallback extends AnalysisCallback3 { case class TestUsedName(name: String, scopes: ju.EnumSet[UseScope]) val classDependencies = new ArrayBuffer[(String, String, DependencyContext)] @@ -153,6 +153,12 @@ class TestCallback extends AnalysisCallback2 { override def isPickleJava: Boolean = false override def getPickleJarPair: Optional[T2[Path, Path]] = Optional.empty() + + override def toVirtualFile(path: Path): VirtualFile = { + throw new UnsupportedOperationException("This method should not be called in tests") + } + + override def getSourceInfos: ReadSourceInfos = new TestSourceInfos } object TestCallback { diff --git a/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfo.scala b/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfo.scala new file mode 100644 index 0000000000..6ded261429 --- /dev/null +++ b/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfo.scala @@ -0,0 +1,23 @@ +/* + * Zinc - The incremental compiler for Scala. + * Copyright Scala Center, Lightbend, and Mark Harrah + * + * Licensed under Apache License 2.0 + * SPDX-License-Identifier: Apache-2.0 + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package xsbti + +import xsbti.compile.analysis.SourceInfo + +class TestSourceInfo extends SourceInfo { + + override def getReportedProblems: Array[Problem] = Array.empty[Problem] + + override def getUnreportedProblems: Array[Problem] = Array.empty[Problem] + + override def getMainClasses: Array[String] = Array.empty[String] +} diff --git a/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfos.scala b/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfos.scala new file mode 100644 index 0000000000..060eec1c76 --- /dev/null +++ b/internal/zinc-testing/src/main/scala/xsbti/TestSourceInfos.scala @@ -0,0 +1,24 @@ +/* + * Zinc - The incremental compiler for Scala. + * Copyright Scala Center, Lightbend, and Mark Harrah + * + * Licensed under Apache License 2.0 + * SPDX-License-Identifier: Apache-2.0 + * + * See the NOTICE file distributed with this work for + * additional information regarding copyright ownership. + */ + +package xsbti + +import xsbti.compile.analysis.{ ReadSourceInfos, SourceInfo } + +import java.util + +class TestSourceInfos extends ReadSourceInfos { + + override def get(sourceFile: VirtualFileRef): SourceInfo = new TestSourceInfo + + override def getAllSourceInfos: util.Map[VirtualFileRef, SourceInfo] = + new util.HashMap[VirtualFileRef, SourceInfo]() +} diff --git a/project/Dependencies.scala b/project/Dependencies.scala index 9a863e20ce..0906d7f0c7 100644 --- a/project/Dependencies.scala +++ b/project/Dependencies.scala @@ -7,17 +7,17 @@ object Dependencies { val scala210 = "2.10.7" val scala211 = "2.11.12" - val scala212 = "2.12.19" - val scala213 = "2.13.14" + val scala212 = "2.12.20" + val scala213 = "2.13.15" val scala3 = "3.3.1" val scala3ForBridge = "3.3.1" - val scala213ForBridge = "2.13.13" + val scala213ForBridge = "2.13.15" val defaultScalaVersion = scala3 val compilerBridgeVersions = Seq(scala212, scala210, scala211, scala213) val scala212_213 = Seq(defaultScalaVersion, scala213) val scala3_only = Seq(scala3) - private val ioVersion = nightlyVersion.getOrElse("1.10.0") + private val ioVersion = nightlyVersion.getOrElse("1.10.1") private val utilVersion = nightlyVersion.getOrElse("2.0.0-M1") private val sbtIO = "org.scala-sbt" %% "io" % ioVersion @@ -29,7 +29,7 @@ object Dependencies { private val utilInterface = "org.scala-sbt" % "util-interface" % utilVersion private val utilScripted = "org.scala-sbt" %% "util-scripted" % utilVersion - val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.4.3" + val launcherInterface = "org.scala-sbt" % "launcher-interface" % "1.4.4" def getSbtModulePath(key: String, name: String) = { val localProps = new java.util.Properties() @@ -80,7 +80,7 @@ object Dependencies { val junit = "junit" % "junit" % "4.12" val sjsonNewVersion = "0.14.0-M1" val scalaXml = "org.scala-lang.modules" %% "scala-xml" % "2.3.0" - val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.18.0" + val scalaCheck = "org.scalacheck" %% "scalacheck" % "1.18.1" val scalatest = "org.scalatest" %% "scalatest" % "3.2.19" val verify = "com.eed3si9n.verify" %% "verify" % "1.0.0" val sjsonnew = Def.setting { diff --git a/project/build.properties b/project/build.properties index ee4c672cd0..0b699c3052 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.1 +sbt.version=1.10.2 diff --git a/project/plugins.sbt b/project/plugins.sbt index e140a1d722..140bd7b155 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,9 @@ scalacOptions += "-feature" addSbtPlugin("com.github.sbt" % "sbt-dynver" % "5.0.1") -addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.2.1") +addSbtPlugin("com.github.sbt" % "sbt-pgp" % "2.3.0") addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.5.2") -addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.5.3") +addSbtPlugin("org.scala-sbt" % "sbt-contraband" % "0.6.0") addSbtPlugin("pl.project13.scala" % "sbt-jmh" % "0.4.7") addSbtPlugin("de.heikoseeberger" % "sbt-header" % "5.10.0") addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.4") diff --git a/zinc/src/main/scala/sbt/internal/inc/IncrementalCompilerImpl.scala b/zinc/src/main/scala/sbt/internal/inc/IncrementalCompilerImpl.scala index 638c78aa24..c41e01cb0d 100644 --- a/zinc/src/main/scala/sbt/internal/inc/IncrementalCompilerImpl.scala +++ b/zinc/src/main/scala/sbt/internal/inc/IncrementalCompilerImpl.scala @@ -331,11 +331,19 @@ class IncrementalCompilerImpl extends IncrementalCompiler { try { compilerRun } catch { + case e: xsbti.CompileFailed2 => throw new sbt.internal.inc.CompileFailed( + e.arguments, + e.toString, + e.problems, + Some(e.sourceInfos()), + e, + ) // just ignore case e: xsbti.CompileFailed => throw new sbt.internal.inc.CompileFailed( e.arguments, e.toString, e.problems, + None, e ) // just ignore case e: CompileFailed => throw e // just ignore diff --git a/zinc/src/main/scala/sbt/internal/inc/MixedAnalyzingCompiler.scala b/zinc/src/main/scala/sbt/internal/inc/MixedAnalyzingCompiler.scala index b16b0fecfb..2a4ea46fda 100644 --- a/zinc/src/main/scala/sbt/internal/inc/MixedAnalyzingCompiler.scala +++ b/zinc/src/main/scala/sbt/internal/inc/MixedAnalyzingCompiler.scala @@ -37,7 +37,6 @@ import sbt.internal.inc.VirtualFileUtil.toAbsolute import sbt.internal.inc.caching.ClasspathCache import sbt.internal.inc.javac.AnalyzingJavaCompiler import sbt.internal.util.ConsoleAppender -import scala.concurrent.ExecutionContext /** An instance of an analyzing compiler that can run both javac + scalac. */ final class MixedAnalyzingCompiler( diff --git a/zinc/src/sbt-test/source-dependencies/abstract-class-to-trait/test b/zinc/src/sbt-test/source-dependencies/abstract-class-to-trait/pending similarity index 100% rename from zinc/src/sbt-test/source-dependencies/abstract-class-to-trait/test rename to zinc/src/sbt-test/source-dependencies/abstract-class-to-trait/pending diff --git a/zinc/src/sbt-test/source-dependencies/false-error/test b/zinc/src/sbt-test/source-dependencies/false-error/pending similarity index 100% rename from zinc/src/sbt-test/source-dependencies/false-error/test rename to zinc/src/sbt-test/source-dependencies/false-error/pending diff --git a/zinc/src/sbt-test/source-dependencies/nested-type-params/test b/zinc/src/sbt-test/source-dependencies/nested-type-params/pending similarity index 100% rename from zinc/src/sbt-test/source-dependencies/nested-type-params/test rename to zinc/src/sbt-test/source-dependencies/nested-type-params/pending diff --git a/zinc/src/sbt-test/source-dependencies/no-type-annotation/test b/zinc/src/sbt-test/source-dependencies/no-type-annotation/pending similarity index 100% rename from zinc/src/sbt-test/source-dependencies/no-type-annotation/test rename to zinc/src/sbt-test/source-dependencies/no-type-annotation/pending diff --git a/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/changes/B.scala b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/changes/B.scala new file mode 100644 index 0000000000..3826c673f1 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/changes/B.scala @@ -0,0 +1,3 @@ +class B { + def f: A = new A() +} diff --git a/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/incOptions.properties b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/incOptions.properties new file mode 100644 index 0000000000..6b07ac31db --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/incOptions.properties @@ -0,0 +1 @@ +scalac.options = -sourcepath [basedir]/src/main/scala diff --git a/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/A.scala b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/A.scala new file mode 100644 index 0000000000..83d15dc739 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/A.scala @@ -0,0 +1 @@ +class A diff --git a/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/B.scala b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/B.scala new file mode 100644 index 0000000000..a97bc1e396 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/src/main/scala/B.scala @@ -0,0 +1,3 @@ +class B { + def f = new A() +} diff --git a/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/test b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/test new file mode 100644 index 0000000000..45605ea4a8 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/sourcepath-virtualfile/test @@ -0,0 +1,6 @@ +> compile + +$ copy-file changes/B.scala src/main/scala/B.scala +$ touch src/main/scala/A.scala + +> compile diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/A.scala b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/A.scala new file mode 100644 index 0000000000..d264759349 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/A.scala @@ -0,0 +1,3 @@ +object A { + val a: Int = 0 +} \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/B.scala b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/B.scala new file mode 100644 index 0000000000..e2eb7968d3 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/B.scala @@ -0,0 +1,3 @@ +object B { + val b = A.a +} \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/C.scala b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/C.scala new file mode 100644 index 0000000000..75b2d7c077 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/C.scala @@ -0,0 +1,4 @@ +object C { + val c1 = B.b + val c2: Int = 0; +} \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/D.scala b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/D.scala new file mode 100644 index 0000000000..497b752059 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/D.scala @@ -0,0 +1,3 @@ +object D { + val d: Int = C.c2 +} \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/changes/A.scala b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/changes/A.scala new file mode 100644 index 0000000000..822a53e8f2 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/changes/A.scala @@ -0,0 +1,3 @@ +object A { + val a: String = "" +} \ No newline at end of file diff --git a/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/test b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/test new file mode 100644 index 0000000000..10867af1a3 --- /dev/null +++ b/zinc/src/sbt-test/source-dependencies/transitive-early-stopping/test @@ -0,0 +1,5 @@ +> compile + +$ copy-file changes/A.scala A.scala +> compile +> checkIterations 4 \ No newline at end of file diff --git a/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala b/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala index aeca3ee54f..6aced00df1 100644 --- a/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala +++ b/zinc/src/test/scala/sbt/inc/IncrementalCompilerSpec.scala @@ -240,4 +240,25 @@ class IncrementalCompilerSpec extends BaseCompilerSpec { } } finally comp.close() } + + it should "emit SourceInfos when incremental compilation fails" in withTmpDir { + tmp => + val project = VirtualSubproject(tmp.toPath / "p1") + val comp = project.setup.createCompiler() + val s1 = "object A { final val i = 1" + val f1 = StringVirtualFile("A.scala", s1) + try { + val exception = intercept[CompileFailed] { + comp.compile(f1) + } + exception.sourceInfosOption match { + case Some(sourceInfos) => + assert( + !sourceInfos.getAllSourceInfos.isEmpty, + "Expected non-empty source infos" + ) + case None => fail("Expected sourceInfos") + } + } finally comp.close() + } }