Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare the Scala.js integration for SIP-51. #2988

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 19 additions & 3 deletions scalajslib/src/mill/scalajslib/ScalaJSModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,25 @@ trait ScalaJSModule extends scalalib.ScalaModule { outer =>

/** Adds the Scala.js Library as mandatory dependency. */
override def mandatoryIvyDeps = T {
super.mandatoryIvyDeps() ++ Seq(
ivy"org.scala-js::scalajs-library:${scalaJSVersion()}".withDottyCompat(scalaVersion())
)
val prev = super.mandatoryIvyDeps()
val scalaVer = scalaVersion()
val scalaJSVer = scalaJSVersion()

val scalaJSLibrary =
ivy"org.scala-js::scalajs-library:$scalaJSVer".withDottyCompat(scalaVer)

/* For Scala 2.x and Scala.js >= 1.15.0, explicitly add scalajs-scalalib,
* in order to support forward binary incompatible changesin the standard library.
*/
if (
scalaVer.startsWith("2.") && scalaJSVer.startsWith("1.")
&& scalaJSVer.drop(2).takeWhile(_.isDigit).toInt >= 15
) {
val scalaJSScalalib = ivy"org.scala-js::scalajs-scalalib:$scalaVer+$scalaJSVer"
prev ++ Seq(scalaJSLibrary, scalaJSScalalib)
} else {
prev ++ Seq(scalaJSLibrary)
}
}

// publish artifact with name "mill_sjs0.6.4_2.12" instead of "mill_sjs0.6_2.12"
Expand Down