diff --git a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala index 084fce4d772..d1a6c5c53db 100644 --- a/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala +++ b/scalalib/worker/src/mill/scalalib/worker/ZincWorkerImpl.scala @@ -297,26 +297,6 @@ class ZincWorkerImpl( reporter: Option[CompileProblemReporter], reportCachedProblems: Boolean )(implicit ctx: ZincWorkerApi.Ctx): Result[CompilationResult] = { - - for ( - res <- compileJava0( - upstreamCompileOutput = upstreamCompileOutput.map(c => (c.analysisFile, c.classes.path)), - sources = sources, - compileClasspath = compileClasspath, - javacOptions = javacOptions, - reporter = reporter, - reportCachedProblems = reportCachedProblems - ) - ) yield CompilationResult(res._1, PathRef(res._2)) - } - def compileJava0( - upstreamCompileOutput: Seq[(os.Path, os.Path)], - sources: Agg[os.Path], - compileClasspath: Agg[os.Path], - javacOptions: Seq[String], - reporter: Option[CompileProblemReporter], - reportCachedProblems: Boolean - )(implicit ctx: ZincWorkerApi.Ctx): Result[(os.Path, os.Path)] = { compileInternal( upstreamCompileOutput = upstreamCompileOutput, sources = sources, @@ -342,37 +322,6 @@ class ZincWorkerImpl( reporter: Option[CompileProblemReporter], reportCachedProblems: Boolean )(implicit ctx: ZincWorkerApi.Ctx): Result[CompilationResult] = { - - for ( - res <- compileMixed0( - upstreamCompileOutput.map(c => (c.analysisFile, c.classes.path)), - sources, - compileClasspath, - javacOptions, - scalaVersion, - scalaOrganization, - scalacOptions, - compilerClasspath, - scalacPluginClasspath, - reporter, - reportCachedProblems - ) - ) yield CompilationResult(res._1, PathRef(res._2)) - } - - def compileMixed0( - upstreamCompileOutput: Seq[(os.Path, os.Path)], - sources: Agg[os.Path], - compileClasspath: Agg[os.Path], - javacOptions: Seq[String], - scalaVersion: String, - scalaOrganization: String, - scalacOptions: Seq[String], - compilerClasspath: Agg[PathRef], - scalacPluginClasspath: Agg[PathRef], - reporter: Option[CompileProblemReporter], - reportOldProblems: Boolean - )(implicit ctx: ZincWorkerApi.Ctx): Result[(os.Path, os.Path)] = { withCompilers( scalaVersion = scalaVersion, scalaOrganization = scalaOrganization, @@ -388,7 +337,7 @@ class ZincWorkerImpl( scalacOptions = scalacOptions, compilers = compilers, reporter = reporter, - reportOldProblems: Boolean + reportCachedProblems: Boolean ) } } @@ -463,7 +412,7 @@ class ZincWorkerImpl( } private def compileInternal( - upstreamCompileOutput: Seq[(os.Path, os.Path)], + upstreamCompileOutput: Seq[CompilationResult], sources: Agg[os.Path], compileClasspath: Agg[os.Path], javacOptions: Seq[String], @@ -471,7 +420,7 @@ class ZincWorkerImpl( compilers: Compilers, reporter: Option[CompileProblemReporter], reportCachedProblems: Boolean - )(implicit ctx: ZincWorkerApi.Ctx): Result[(os.Path, os.Path)] = { + )(implicit ctx: ZincWorkerApi.Ctx): Result[CompilationResult] = { os.makeDir.all(ctx.dest) reporter.foreach(_.start()) @@ -512,7 +461,7 @@ class ZincWorkerImpl( } } } - val analysisMap0 = upstreamCompileOutput.map(_.swap).toMap + val analysisMap0 = upstreamCompileOutput.map(c => c.classes.path -> c.analysisFile).toMap def analysisMap(f: VirtualFile): Optional[CompileAnalysis] = { val analysisFile = f match { @@ -615,7 +564,7 @@ class ZincWorkerImpl( newResult.setup() ) ) - Result.Success((zincFile, classesDir)) + Result.Success(CompilationResult(zincFile, PathRef(classesDir))) } catch { case e: CompileFailed => Result.Failure(e.toString)