Skip to content

Commit

Permalink
Fix bsp compile classpath inconsistencies (#3017)
Browse files Browse the repository at this point in the history
Resolve some inconsistencies between the BSP and non-BSP versions of
`compileClasspath` and `transitiveCompileClasspath`.

The `bspTransitiveCompileClasspath` contained resolved ivy dependencies,
which resulted in too many and potentially conflicting jars ending up in
the same classpath.

Fix #3013

Pull request: #3017
  • Loading branch information
lefou authored Feb 18, 2024
1 parent e3ef411 commit 4a65cea
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions scalalib/src/mill/scalalib/JavaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,8 @@ trait JavaModule
def bspTransitiveCompileClasspath: T[Agg[UnresolvedPath]] = T {
T.traverse(transitiveModuleCompileModuleDeps)(m =>
T.task {
m.bspCompileClasspath() ++ Agg(m.bspCompileClassesPath())
m.localCompileClasspath().map(p => UnresolvedPath.ResolvedPath(p.path)) ++
Agg(m.bspCompileClassesPath())
}
)()
.flatten
Expand Down Expand Up @@ -468,9 +469,9 @@ trait JavaModule
// Keep in sync with [[compileClasspath]]
@internal
def bspCompileClasspath: T[Agg[UnresolvedPath]] = T {
bspTransitiveCompileClasspath() ++
(localCompileClasspath() ++ resolvedIvyDeps())
.map(p => UnresolvedPath.ResolvedPath(p.path))
resolvedIvyDeps().map(p => UnresolvedPath.ResolvedPath(p.path)) ++
bspTransitiveCompileClasspath() ++
localCompileClasspath().map(p => UnresolvedPath.ResolvedPath(p.path))
}

/**
Expand Down

0 comments on commit 4a65cea

Please sign in to comment.