-
-
Notifications
You must be signed in to change notification settings - Fork 358
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
Support Scala 3 on ScalaJSModule #1103
Comments
FYI, technically, the only thing we need to do is to adapt the Scala libraries. See this Gitter thread from Sept. 2020: https://gitter.im/lihaoyi/mill?at=5f52a9d759ac794e02ea6b82 I'm quoting the ad-hoc solution: override def mapDependencies = T.task{ d: coursier.Dependency =>
d match {
case d if d.module.name.value == "scalajs-library_0.27" =>
d.withModule(d.module.withName(coursier.core.ModuleName("scalajs-library_2.13")))
case d if d.module.name.value == "scalajs-compiler_0.27.0-RC1" =>
d.withModule(d.module.withName(coursier.core.ModuleName("scalajs-compiler_2.13.3")))
case x => x
}
} |
Artifacts on the 3.0.0-x branch requires slightly different intervention, as the scalajs compiler is builtin and enabled by a compiler flag. I had some success with this setup but I'm not sure if it's a 100 % correct: trait Scala3JSModule extends ScalaJSModule {
override def scalacPluginIvyDeps = T { Seq() }
def scalacOptions = Seq("-scalajs")
override def scalaLibraryIvyDeps = T {
Agg(
ivy"org.scala-lang:scala3-library_sjs1_${scalaVersion()}:${scalaVersion()}",
ivy"org.scala-js:scalajs-test-bridge_2.13:${scalaJSVersion()}"
)
}
}
object myJSModule extends Scala3JSModule {
// …
} |
I saw that Scala 3 + Scala.js is supported in mill 0.9.6 - is this still the best way to go about it in 0.9.6? |
@bbarker No, you just need a normal Scala.js module and set the Scala version to 3.0.0-RC2. It should work just fine. |
Currently
ScalaJSModule
doesn't support Scala 3.The support should be something along the lines of what is done in the Scala.js sbt plugin
The text was updated successfully, but these errors were encountered: