diff options
Diffstat (limited to 'scalalib')
-rw-r--r-- | scalalib/src/mill/scalalib/Lib.scala | 10 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 2 |
2 files changed, 8 insertions, 4 deletions
diff --git a/scalalib/src/mill/scalalib/Lib.scala b/scalalib/src/mill/scalalib/Lib.scala index 827c6bf4..17eeba3e 100644 --- a/scalalib/src/mill/scalalib/Lib.scala +++ b/scalalib/src/mill/scalalib/Lib.scala @@ -40,9 +40,13 @@ object Lib{ } } - def grepJar(classPath: Agg[Path], name: String, version: String) = { - val mavenStylePath = s"$name-$version.jar" - val ivyStylePath = s"$version/$name.jar" + def grepJar(classPath: Agg[Path], name: String, version: String, sources: Boolean = false) = { + val suffix = if (sources) "-sources" else "" + val mavenStylePath = s"$name-$version$suffix.jar" + val ivyStylePath = { + val dir = if (sources) "srcs" else "jars" + s"$version/$dir/$name$suffix.jar" + } classPath .find(p => p.toString.endsWith(mavenStylePath) || p.toString.endsWith(ivyStylePath)) diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 3e90521e..8c7d40fc 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -91,7 +91,7 @@ trait ScalaModule extends JavaModule { outer => Seq(bridgeDep), sources = true ).map(deps => - grepJar(deps.map(_.path), bridgeName, s"$bridgeVersion-sources") + grepJar(deps.map(_.path), bridgeName, bridgeVersion, sources = true) ) } |