Skip to content

Commit

Permalink
Removed platform notation handling from ivy deps pre-processor
Browse files Browse the repository at this point in the history
We always resolve dependencies with `ScalaModule`s,
so we already handle the platform
  • Loading branch information
lefou committed Jun 27, 2023
1 parent e3d140a commit 619a71b
Showing 1 changed file with 10 additions and 16 deletions.
26 changes: 10 additions & 16 deletions runner/src/mill/runner/MillIvy.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,18 @@ package mill.runner

object MillIvy {
def processMillIvyDepSignature(signatures: Set[String]): Set[String] = {
// replace platform notation and empty version
val millSigs: Set[String] = for (signature <- signatures) yield {

if (signature.endsWith(":") && signature.count(_ == ":") == 4) signature + "$MILL_VERSION"
// else
signature.split("[:]") match {
case Array(org, "", pname, "", version)
if org.length > 0 && pname.length > 0 && version.length > 0 =>
s"${org}::${pname}_mill$$MILL_BIN_PLATFORM:${version}"
case Array(org, "", "", pname, "", version)
if org.length > 0 && pname.length > 0 && version.length > 0 =>
s"${org}:::${pname}_mill$$MILL_BIN_PLATFORM:${version}"
case Array(org, "", name) if org.length > 0 && name.length > 0 && signature.endsWith(":") =>
s"${org}::${name}:$$MILL_VERSION"
case _ => signature
val millSigs: Set[String] =
for (signature <- signatures) yield {
signature.split("[:]") match {
case Array(org, "", name)
if org.length > 0 && name.length > 0 && signature.endsWith(":") =>
// replace empty version with Mill Version Placeholder
signature + "$MILL_VERSION"
case _ => signature
}
}
}

// replace special MILL_ placeholders
val replaced = millSigs.map(_
.replace("$MILL_VERSION", mill.main.BuildInfo.millVersion)
.replace("${MILL_VERSION}", mill.main.BuildInfo.millVersion)
Expand Down

0 comments on commit 619a71b

Please sign in to comment.