diff --git a/community-build/src/scala/dotty/communitybuild/projects.scala b/community-build/src/scala/dotty/communitybuild/projects.scala index 3856ce4e8b22..37c8b5df1adb 100644 --- a/community-build/src/scala/dotty/communitybuild/projects.scala +++ b/community-build/src/scala/dotty/communitybuild/projects.scala @@ -15,6 +15,9 @@ lazy val sbtPluginFilePath: String = new File(sys.props("user.home") + "/.sbt/1.0/plugins").mkdirs() communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString() +lazy val sbtScalaJSPluginFilePath: String = + communitybuildDir.resolve("sbt-scalajs-sbt").toAbsolutePath().toString() + def log(msg: String) = println(Console.GREEN + msg + Console.RESET) /** Executes shell command, returns false in case of error. */ @@ -65,6 +68,7 @@ final case class SbtCommunityProject( project: String, sbtTestCommand: String, extraSbtArgs: List[String] = Nil, + forceUpgradeSbtScalajsPlugin: Boolean = false, dependencies: List[CommunityProject] = Nil, sbtPublishCommand: String = null) extends CommunityProject: override val binaryName: String = "sbt" @@ -77,10 +81,14 @@ final case class SbtCommunityProject( val sbtProps = Option(System.getProperty("sbt.ivy.home")) match case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome") case _ => Nil + val scalaJSPluginArgs = + if (forceUpgradeSbtScalajsPlugin) List(s"--addPluginSbtFile=$sbtScalaJSPluginFilePath") + else Nil extraSbtArgs ++ sbtProps ++ List( "-sbt-version", "1.3.8", "-Dsbt.supershell=false", - s"--addPluginSbtFile=$sbtPluginFilePath") + s"--addPluginSbtFile=$sbtPluginFilePath" + ) ++ scalaJSPluginArgs object projects: lazy val utest = MillCommunityProject( @@ -310,7 +318,8 @@ object projects: lazy val catsEffect2 = SbtCommunityProject( project = "cats-effect-2", - sbtTestCommand = "test" + sbtTestCommand = "test", + forceUpgradeSbtScalajsPlugin = true ) lazy val catsEffect3 = SbtCommunityProject( diff --git a/project/Build.scala b/project/Build.scala index 97f111b77f78..7b761dc32694 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -935,6 +935,7 @@ object Build { fetchScalaJSSource := { import org.eclipse.jgit.api._ + import org.eclipse.jgit.lib._ val s = streams.value val ver = scalaJSVersion @@ -946,12 +947,14 @@ object Build { new CloneCommand() .setDirectory(trgDir) .setURI("https://github.com/scala-js/scala-js.git") + .setNoCheckout(true) .call() } // Checkout proper ref. We do this anyway so we fail if something is wrong val git = Git.open(trgDir) s.log.info(s"Checking out Scala.js source version $ver") + git.getRepository().getConfig().setEnum("core", null, "autocrlf", CoreConfig.AutoCRLF.FALSE) git.checkout().setName(s"v$ver").call() trgDir @@ -1029,7 +1032,7 @@ object Build { ++ (dir / "shared/src/test/require-jdk7" ** "*.scala").get ++ (dir / "js/src/test/scala" ** (("*.scala": FileFilter) - -- "ExportsTest.scala" // JS exports + do not compile because of a var in a structural type + -- "ExportsTest.scala" // JS exports + IR checking error -- "ObjectTest.scala" // compile errors caused by #9588 -- "StackTraceTest.scala" // would require `npm install source-map-support` -- "UnionTypeTest.scala" // requires the Scala 2 macro defined in Typechecking*.scala @@ -1045,12 +1048,8 @@ object Build { // Putting them here instead of above makes sure that we do not regress on compilation+linking. Test / testOptions += Tests.Filter { name => !Set[String]( - "org.scalajs.testsuite.compiler.InteroperabilityTest", // 3 tests require JS exports, all other tests pass - "org.scalajs.testsuite.jsinterop.AsyncTest", // needs JS exports in PromiseMock.scala - "org.scalajs.testsuite.jsinterop.DynamicTest", // one test requires JS exports, all other tests pass "org.scalajs.testsuite.jsinterop.JSExportStaticTest", // JS exports - "org.scalajs.testsuite.jsinterop.NonNativeJSTypeTest", // 1 test fails because of a progression for value class fields (needs an update upstream) // Not investigated so far "org.scalajs.testsuite.junit.JUnitAbstractClassTestCheck", @@ -1205,6 +1204,9 @@ object Build { s"""updateOptions in Global ~= (_.withLatestSnapshots(false)) |addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")""".stripMargin IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText) + val scalaJSPluginText = + s"""addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")\n""" + IO.write(baseDirectory.value / "sbt-scalajs-sbt", scalaJSPluginText) IO.write(baseDirectory.value / "scala3-bootstrapped.version", dottyVersion) }, testOptions in Test += Tests.Argument( diff --git a/project/plugins.sbt b/project/plugins.sbt index 924c174b3c7c..6f83bef934f9 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,7 +2,7 @@ // // e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0") addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.6") diff --git a/sbt-dotty/sbt-test/scalajs/basic/project/plugins.sbt b/sbt-dotty/sbt-test/scalajs/basic/project/plugins.sbt index 0cd6969bf6e2..70503e9f7c7a 100644 --- a/sbt-dotty/sbt-test/scalajs/basic/project/plugins.sbt +++ b/sbt-dotty/sbt-test/scalajs/basic/project/plugins.sbt @@ -1,2 +1,2 @@ addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version")) -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")