Fix Java output when export pipelining is disabled

This commit is contained in:
Anatolii Kmetiuk 2026-07-24 11:48:25 +09:00
parent 1c4abbbcbd
commit d387b7fe11
6 changed files with 42 additions and 9 deletions

View File

@ -2325,13 +2325,11 @@ object Defaults extends BuildCommon with DefExtra {
val reporter = (compile / bspReporter).value val reporter = (compile / bspReporter).value
val log = CompileDebugLogger(projectId, s.log) val log = CompileDebugLogger(projectId, s.log)
try { try {
if (r.hasModified) { val result0 = incCompiler
val result0 = incCompiler .asInstanceOf[sbt.internal.inc.IncrementalCompilerImpl]
.asInstanceOf[sbt.internal.inc.IncrementalCompilerImpl] .compileAllJava(in, log)
.compileAllJava(in, log) reporter.sendSuccessReport(result0.analysis())
reporter.sendSuccessReport(result0.analysis()) result0.withHasModified(result0.hasModified || r.hasModified)
result0.withHasModified(result0.hasModified || r.hasModified)
} else r
} catch { } catch {
case NonFatal(e) => case NonFatal(e) =>
reporter.sendFailureReport(in.options.sources) reporter.sendFailureReport(in.options.sources)
@ -4415,8 +4413,8 @@ object Classpaths {
def makeProducts: Initialize[Task[Seq[File]]] = Def.task { def makeProducts: Initialize[Task[Seq[File]]] = Def.task {
val c = fileConverter.value val c = fileConverter.value
val resourceDirs = resourceDirectories.value val resourceDirs = resourceDirectories.value
val vfBackendDir = compileIncremental.value._2 val _ = compile.value
val backendDir = c.toPath(vfBackendDir) val backendDir = c.toPath(backendOutput.value)
val _ = resources.value val _ = resources.value
backendDir.toFile() :: resourceDirs.toList.filter(_.exists()) backendDir.toFile() :: resourceDirs.toList.filter(_.exists())
} }

View File

@ -0,0 +1,14 @@
ThisBuild / scalaVersion := "2.13.18"
ThisBuild / usePipelining := true
lazy val root = (project in file("."))
.aggregate(upstream, downstream)
lazy val upstream = project
.settings(
exportJars := true,
exportPipelining := false,
)
lazy val downstream = project
.dependsOn(upstream)

View File

@ -0,0 +1,5 @@
package example
object Main {
def run(): String = Greeter.greet("world")
}

View File

@ -0,0 +1,4 @@
> compile
$ exists target/**/upstream/classes/example/Greeter.class
$ exists target/**/downstream/classes/example/Main.class

View File

@ -0,0 +1,7 @@
package example;
public class Greeter {
public static String greet(String name) {
return "Hello, " + name;
}
}

View File

@ -0,0 +1,5 @@
package example
object Marker {
val tag = "upstream"
}