mirror of https://github.com/sbt/sbt.git
This commit is contained in:
parent
b5ecb37ae7
commit
7d77f44cdc
|
|
@ -2839,7 +2839,7 @@ object Classpaths {
|
|||
case (false, _) =>
|
||||
Def.task { filteredDependencyClasspath.value }
|
||||
case (true, DependencyMode.Transitive) =>
|
||||
Def.task { dependencyClasspath.value }
|
||||
Def.task { internalDependencyPicklePath.value ++ externalDependencyClasspath.value }
|
||||
case (true, DependencyMode.Direct) =>
|
||||
Def.task {
|
||||
val internalFiltered = ClasspathImpl.filterInternalByMode(
|
||||
|
|
@ -2847,7 +2847,7 @@ object Classpaths {
|
|||
thisProjectRef.value,
|
||||
settingsData.value,
|
||||
buildDependencies.value,
|
||||
internalDependencyClasspath.value,
|
||||
internalDependencyPicklePath.value,
|
||||
)
|
||||
val externalFiltered = ClasspathImpl.filterByDirectDeps(
|
||||
allDependencies.value,
|
||||
|
|
@ -2862,7 +2862,7 @@ object Classpaths {
|
|||
thisProjectRef.value,
|
||||
settingsData.value,
|
||||
buildDependencies.value,
|
||||
internalDependencyClasspath.value,
|
||||
internalDependencyPicklePath.value,
|
||||
)
|
||||
val externalFiltered = ClasspathImpl.filterByPlusOne(
|
||||
allDependencies.value,
|
||||
|
|
|
|||
|
|
@ -0,0 +1,28 @@
|
|||
ThisBuild / scalaVersion := "2.13.18"
|
||||
ThisBuild / usePipelining := true
|
||||
|
||||
lazy val root = (project in file("."))
|
||||
.aggregate(upstream, `downstream-transitive`, `downstream-direct`, `downstream-plusone`)
|
||||
.settings(
|
||||
name := "pipelining Java then Scala",
|
||||
)
|
||||
|
||||
lazy val upstream = project
|
||||
|
||||
lazy val `downstream-transitive` = project
|
||||
.in(file("downstream-transitive"))
|
||||
.dependsOn(upstream)
|
||||
|
||||
lazy val `downstream-direct` = project
|
||||
.in(file("downstream-direct"))
|
||||
.dependsOn(upstream)
|
||||
.settings(
|
||||
dependencyMode := DependencyMode.Direct,
|
||||
)
|
||||
|
||||
lazy val `downstream-plusone` = project
|
||||
.in(file("downstream-plusone"))
|
||||
.dependsOn(upstream)
|
||||
.settings(
|
||||
dependencyMode := DependencyMode.PlusOne,
|
||||
)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package example
|
||||
|
||||
object Main {
|
||||
def run(): String = Greeter.greet("world")
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package example
|
||||
|
||||
object Main {
|
||||
def run(): String = Greeter.greet("world")
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package example
|
||||
|
||||
object Main {
|
||||
def run(): String = Greeter.greet("world")
|
||||
}
|
||||
|
|
@ -0,0 +1,13 @@
|
|||
# Regression test for https://github.com/sbt/sbt/issues/9343
|
||||
# With usePipelining := true, a downstream Scala source that references a
|
||||
# Java class defined in an upstream project must still compile; the early
|
||||
# pickle artifacts from upstream must stay visible on the pipelined classpath.
|
||||
# Three downstream projects exercise Transitive, Direct, and PlusOne modes.
|
||||
# A single aggregate compile fans out from one upstream pickle-producing task
|
||||
# to all three downstream compilations without reusing a pipelining promise.
|
||||
|
||||
> compile
|
||||
|
||||
$ exists target/**/downstream-transitive/classes/example/Main.class
|
||||
$ exists target/**/downstream-direct/classes/example/Main.class
|
||||
$ exists target/**/downstream-plusone/classes/example/Main.class
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
package example;
|
||||
|
||||
public class Greeter {
|
||||
public static String greet(String name) {
|
||||
return "Hello, " + name;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
package example
|
||||
|
||||
object Marker {
|
||||
val tag = "upstream"
|
||||
}
|
||||
Loading…
Reference in New Issue