From 4a65cea4dceaddf1db663b77589817e016eb57f3 Mon Sep 17 00:00:00 2001 From: Tobias Roeser Date: Sun, 18 Feb 2024 21:16:51 +0100 Subject: [PATCH] Fix bsp compile classpath inconsistencies (#3017) 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 https://github.com/com-lihaoyi/mill/issues/3013 Pull request: https://github.com/com-lihaoyi/mill/pull/3017 --- scalalib/src/mill/scalalib/JavaModule.scala | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/scalalib/src/mill/scalalib/JavaModule.scala b/scalalib/src/mill/scalalib/JavaModule.scala index 4e13d32f5d4..85c3d8e14d6 100644 --- a/scalalib/src/mill/scalalib/JavaModule.scala +++ b/scalalib/src/mill/scalalib/JavaModule.scala @@ -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 @@ -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)) } /**