diff options
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 5a355bc6..119d4d47 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -71,6 +71,7 @@ trait ScalaModule extends mill.Module with TaskModule { outer => def transitiveIvyDeps: T[Agg[Dep]] = T{ ivyDeps() ++ Task.traverse(moduleDeps)(_.transitiveIvyDeps)().flatten } + def upstreamCompileOutput = T{ Task.traverse(moduleDeps)(_.compile) } @@ -247,6 +248,20 @@ trait ScalaModule extends mill.Module with TaskModule { outer => ) } + def ivyDepsTree(inverse: Boolean = false) = T.command { + import coursier.{Cache, Fetch, Resolution} + + val flattened = ivyDeps().map(depToDependency(_, scalaVersion(), platformSuffix())).toSeq + val start = Resolution(flattened.toSet) + val fetch = Fetch.from(repositories, Cache.fetch()) + val resolution = start.process.run(fetch).unsafePerformSync + + println(coursier.util.Print.dependencyTree(flattened, resolution, + printExclusions = false, reverse = inverse)) + + Result.Success() + } + def runLocal(args: String*) = T.command { Jvm.runLocal( finalMainClass(), |