diff --git a/src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala b/src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala index ca09406f..c8a59064 100644 --- a/src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala +++ b/src/main/scala/higherkindness/rules_scala/workers/zinc/compile/ZincRunner.scala @@ -14,18 +14,18 @@ import java.io.{File, PrintStream, PrintWriter} import java.net.URLClassLoader import java.nio.file.{Files, Path, Paths} import java.util -import java.util.{List => JList, Optional} +import java.util.{Optional, List as JList} import net.sourceforge.argparse4j.ArgumentParsers -import net.sourceforge.argparse4j.impl.{Arguments => Arg} +import net.sourceforge.argparse4j.impl.Arguments as Arg import net.sourceforge.argparse4j.inf.Namespace import sbt.internal.inc.classpath.ClassLoaderCache import sbt.internal.inc.caching.ClasspathCache -import sbt.internal.inc.{Analysis, CompileFailed, IncrementalCompilerImpl, Locate, PlainVirtualFile, PlainVirtualFileConverter, ZincUtil} -import scala.jdk.CollectionConverters._ +import sbt.internal.inc.{Analysis, AnalyzingCompiler, CompileFailed, IncrementalCompilerImpl, Locate, PlainVirtualFile, PlainVirtualFileConverter, ZincUtil} +import scala.jdk.CollectionConverters.* import scala.util.Try import scala.util.control.NonFatal import xsbti.{T2, VirtualFile, VirtualFileRef} -import xsbti.compile.{AnalysisContents, AnalysisStore, Changes, ClasspathOptionsUtil, CompileAnalysis, CompileOptions, CompileProgress, CompilerCache, DefaultExternalHooks, DefinesClass, ExternalHooks, FileHash, IncOptions, Inputs, MiniSetup, PerClasspathEntryLookup, PreviousResult, Setup, TastyFiles} +import xsbti.compile.{AnalysisContents, AnalysisStore, Changes, ClasspathOptionsUtil, CompileAnalysis, CompileOptions, CompileProgress, CompilerCache, DefaultExternalHooks, DefinesClass, ExternalHooks, FileHash, GlobalsCache, IncOptions, Inputs, MiniSetup, PerClasspathEntryLookup, PreviousResult, Setup, TastyFiles} // The list in this docstring gets clobbered by the formatter, unfortunately. //format: off @@ -51,10 +51,11 @@ object ZincRunner extends WorkerMain[Namespace] { private[this] val compilerCache: GlobalsCache = CompilerCache.fresh + private[this] def labelToPath(label: String): Path = { + Paths.get(label.replaceAll("^/+", "").replaceAll(raw"[^\w/]", "_")) + } - private[this] def labelToPath(label: String) = Paths.get(label.replaceAll("^/+", "").replaceAll(raw"[^\w/]", "_")) - - protected[this] def init(args: Option[Array[String]]) = { + protected[this] def init(args: Option[Array[String]]): Namespace = { val parser = ArgumentParsers.newFor("zinc-worker").addHelp(true).build parser.addArgument("--persistence_dir", /* deprecated */ "--persistenceDir").metavar("path") parser.addArgument("--use_persistence").`type`(Arg.booleanType) @@ -281,7 +282,6 @@ object ZincRunner extends WorkerMain[Namespace] { analysisStoreText.set(AnalysisContents.create(compileResult.analysis, compileResult.setup)) analysisStore.set(AnalysisContents.create(compileResult.analysis, compileResult.setup)) - // create used deps val resultAnalysis = compileResult.analysis.asInstanceOf[Analysis] val usedDeps =