Skip to content

Commit

Permalink
Exclude trees from ammonite dep.
Browse files Browse the repository at this point in the history
The reason for doing this is to ensure that the version of
trees that mill wants is indeed used instead of the newer
version that is being pulled in by ammonite-interp. Before
this was using `forceVersion()`, but by doing this the forced
version doesn't end up in the POM meaning that when someone
bootstraps/uses mill via coursier, they are getting the newer
trees, which is causing issues with how the main class is detected.

You can see more details on this coursier/apps#56
and a huge props to @alexarchambault for finding this.
  • Loading branch information
ckipp01 committed Nov 3, 2020
1 parent d81662f commit e6b8792
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ object Deps {

val acyclic = ivy"com.lihaoyi::acyclic:0.2.0"
val ammonite = ivy"com.lihaoyi:::ammonite:2.2.0"
// Exclude trees here to force the version of we have defined. We use this
// here instead of a `forceVersion()` on scalametaTrees since it's not
// respected in the POM causing issues for Coursier Mill users.
val ammoniteExcludingTrees = ammonite.exclude(
"org.scalameta" -> "trees_2.13"
)
val scalametaTrees = ivy"org.scalameta::trees:4.3.7"
val bloopConfig = ivy"ch.epfl.scala::bloop-config:1.4.0-RC1"
val coursier = ivy"io.get-coursier::coursier:2.0.0-RC6-15"
Expand Down Expand Up @@ -161,8 +167,8 @@ object main extends MillModule {
)

def ivyDeps = Agg(
Deps.ammonite,
Deps.scalametaTrees.forceVersion(),
Deps.ammoniteExcludingTrees,
Deps.scalametaTrees,
Deps.coursier,
// Necessary so we can share the JNA classes throughout the build process
Deps.jna,
Expand Down

0 comments on commit e6b8792

Please sign in to comment.