@@ -19,6 +19,9 @@ import dotty.tools.sbtplugin.DottyPlugin.autoImport._
19
19
import dotty .tools .sbtplugin .DottyIDEPlugin .{ installCodeExtension , prepareCommand , runProcess }
20
20
import dotty .tools .sbtplugin .DottyIDEPlugin .autoImport ._
21
21
22
+ import org .scalajs .sbtplugin .ScalaJSPlugin
23
+ import org .scalajs .sbtplugin .ScalaJSPlugin .autoImport ._
24
+
22
25
import sbtbuildinfo .BuildInfoPlugin
23
26
import sbtbuildinfo .BuildInfoPlugin .autoImport ._
24
27
@@ -633,14 +636,14 @@ object Build {
633
636
634
637
run := dotc.evaluated,
635
638
dotc := runCompilerMain().evaluated,
636
- repl := runCompilerMain(repl = true ).evaluated
639
+ repl := runCompilerMain(repl = true ).evaluated,
637
640
638
641
// FIXME: Adding the sources of scala-js ir doesn't work anymore because scalajs-ir has a few
639
642
// compilation errors when compiled by Dotty:
640
643
// - inline is now a keyword
641
644
// - methods defined with () need to be called with ()
642
645
// Until they're fixed, we rely on scalajs-ir compiled by Scala 2:
643
- libraryDependencies += (" org.scala-js" %% " scalajs-ir" % scalaJSVersion).withDottyCompat(),
646
+ libraryDependencies += (" org.scala-js" %% " scalajs-ir" % scalaJSVersion).withDottyCompat(scalaVersion.value ),
644
647
/*
645
648
/* Add the sources of scalajs-ir.
646
649
* To guarantee that dotty can bootstrap without depending on a version
@@ -650,7 +653,7 @@ object Build {
650
653
ivyConfigurations += config("sourcedeps").hide,
651
654
transitiveClassifiers := Seq("sources"),
652
655
libraryDependencies +=
653
- ("org.scala-js" %% "scalajs-ir" % scalaJSVersion % "sourcedeps").withDottyCompat(),
656
+ ("org.scala-js" %% "scalajs-ir" % scalaJSVersion % "sourcedeps").withDottyCompat(scalaVersion.value ),
654
657
sourceGenerators in Compile += Def.task {
655
658
val s = streams.value
656
659
val cacheDir = s.cacheDirectory
@@ -925,30 +928,25 @@ object Build {
925
928
/* Remove the Scala.js compiler plugin for scalac, and enable the
926
929
* Scala.js back-end of dotty instead.
927
930
*/
928
- libraryDependencies ~= { deps =>
929
- deps.filterNot(_.name.startsWith(" scalajs-compiler" )).map(_.withDottyCompat())
931
+ libraryDependencies := {
932
+ val deps = libraryDependencies.value
933
+ deps.filterNot(_.name.startsWith(" scalajs-compiler" )).map(_.withDottyCompat(scalaVersion.value))
930
934
},
931
935
scalacOptions += " -scalajs" ,
932
936
933
937
// The main class cannot be found automatically due to the empty inc.Analysis
934
- mainClass in Compile := Some (" hello.world " ),
938
+ mainClass in Compile := Some (" hello.HelloWorld " ),
935
939
936
940
scalaJSUseMainModuleInitializer := true ,
937
941
938
942
/* Debug-friendly Scala.js optimizer options.
939
943
* In particular, typecheck the Scala.js IR found on the classpath.
940
944
*/
941
- scalaJSOptimizerOptions ~= {
942
- _.withCheckScalaJSIR (true ).withParallel(false )
945
+ scalaJSLinkerConfig ~= {
946
+ _.withCheckIR (true ).withParallel(false )
943
947
}
944
948
).
945
- settings(compileWithDottySettings).
946
- settings(inConfig(Compile )(Seq (
947
- /* Make sure jsDependencyManifest runs after compile, otherwise compile
948
- * might remove the entire directory afterwards.
949
- */
950
- jsDependencyManifest := jsDependencyManifest.dependsOn(compile).value
951
- )))
949
+ settings(compileWithDottySettings)
952
950
953
951
lazy val `dotty-bench` = project.in(file(" bench" )).asDottyBench(NonBootstrapped )
954
952
lazy val `dotty-bench-bootstrapped` = project.in(file(" bench" )).asDottyBench(Bootstrapped )
0 commit comments