Skip to content

Commit 0d1e330

Browse files
authored
Merge pull request #10013 from dotty-staging/scalajs-1.3.0
Upgrade to Scala.js 1.3.0.
2 parents e56ecae + 85fd0e4 commit 0d1e330

File tree

4 files changed

+20
-9
lines changed

4 files changed

+20
-9
lines changed

community-build/src/scala/dotty/communitybuild/projects.scala

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ lazy val sbtPluginFilePath: String =
1515
new File(sys.props("user.home") + "/.sbt/1.0/plugins").mkdirs()
1616
communitybuildDir.resolve("sbt-dotty-sbt").toAbsolutePath().toString()
1717

18+
lazy val sbtScalaJSPluginFilePath: String =
19+
communitybuildDir.resolve("sbt-scalajs-sbt").toAbsolutePath().toString()
20+
1821
def log(msg: String) = println(Console.GREEN + msg + Console.RESET)
1922

2023
/** Executes shell command, returns false in case of error. */
@@ -65,6 +68,7 @@ final case class SbtCommunityProject(
6568
project: String,
6669
sbtTestCommand: String,
6770
extraSbtArgs: List[String] = Nil,
71+
forceUpgradeSbtScalajsPlugin: Boolean = false,
6872
dependencies: List[CommunityProject] = Nil,
6973
sbtPublishCommand: String = null) extends CommunityProject:
7074
override val binaryName: String = "sbt"
@@ -77,10 +81,14 @@ final case class SbtCommunityProject(
7781
val sbtProps = Option(System.getProperty("sbt.ivy.home")) match
7882
case Some(ivyHome) => List(s"-Dsbt.ivy.home=$ivyHome")
7983
case _ => Nil
84+
val scalaJSPluginArgs =
85+
if (forceUpgradeSbtScalajsPlugin) List(s"--addPluginSbtFile=$sbtScalaJSPluginFilePath")
86+
else Nil
8087
extraSbtArgs ++ sbtProps ++ List(
8188
"-sbt-version", "1.3.8",
8289
"-Dsbt.supershell=false",
83-
s"--addPluginSbtFile=$sbtPluginFilePath")
90+
s"--addPluginSbtFile=$sbtPluginFilePath"
91+
) ++ scalaJSPluginArgs
8492

8593
object projects:
8694
lazy val utest = MillCommunityProject(
@@ -310,7 +318,8 @@ object projects:
310318

311319
lazy val catsEffect2 = SbtCommunityProject(
312320
project = "cats-effect-2",
313-
sbtTestCommand = "test"
321+
sbtTestCommand = "test",
322+
forceUpgradeSbtScalajsPlugin = true
314323
)
315324

316325
lazy val catsEffect3 = SbtCommunityProject(

project/Build.scala

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,7 @@ object Build {
935935

936936
fetchScalaJSSource := {
937937
import org.eclipse.jgit.api._
938+
import org.eclipse.jgit.lib._
938939

939940
val s = streams.value
940941
val ver = scalaJSVersion
@@ -946,12 +947,14 @@ object Build {
946947
new CloneCommand()
947948
.setDirectory(trgDir)
948949
.setURI("https://github.com/scala-js/scala-js.git")
950+
.setNoCheckout(true)
949951
.call()
950952
}
951953

952954
// Checkout proper ref. We do this anyway so we fail if something is wrong
953955
val git = Git.open(trgDir)
954956
s.log.info(s"Checking out Scala.js source version $ver")
957+
git.getRepository().getConfig().setEnum("core", null, "autocrlf", CoreConfig.AutoCRLF.FALSE)
955958
git.checkout().setName(s"v$ver").call()
956959

957960
trgDir
@@ -1029,7 +1032,7 @@ object Build {
10291032
++ (dir / "shared/src/test/require-jdk7" ** "*.scala").get
10301033

10311034
++ (dir / "js/src/test/scala" ** (("*.scala": FileFilter)
1032-
-- "ExportsTest.scala" // JS exports + do not compile because of a var in a structural type
1035+
-- "ExportsTest.scala" // JS exports + IR checking error
10331036
-- "ObjectTest.scala" // compile errors caused by #9588
10341037
-- "StackTraceTest.scala" // would require `npm install source-map-support`
10351038
-- "UnionTypeTest.scala" // requires the Scala 2 macro defined in Typechecking*.scala
@@ -1045,12 +1048,8 @@ object Build {
10451048
// Putting them here instead of above makes sure that we do not regress on compilation+linking.
10461049
Test / testOptions += Tests.Filter { name =>
10471050
!Set[String](
1048-
"org.scalajs.testsuite.compiler.InteroperabilityTest", // 3 tests require JS exports, all other tests pass
1049-
10501051
"org.scalajs.testsuite.jsinterop.AsyncTest", // needs JS exports in PromiseMock.scala
1051-
"org.scalajs.testsuite.jsinterop.DynamicTest", // one test requires JS exports, all other tests pass
10521052
"org.scalajs.testsuite.jsinterop.JSExportStaticTest", // JS exports
1053-
"org.scalajs.testsuite.jsinterop.NonNativeJSTypeTest", // 1 test fails because of a progression for value class fields (needs an update upstream)
10541053

10551054
// Not investigated so far
10561055
"org.scalajs.testsuite.junit.JUnitAbstractClassTestCheck",
@@ -1205,6 +1204,9 @@ object Build {
12051204
s"""updateOptions in Global ~= (_.withLatestSnapshots(false))
12061205
|addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "$sbtDottyVersion")""".stripMargin
12071206
IO.write(baseDirectory.value / "sbt-dotty-sbt", pluginText)
1207+
val scalaJSPluginText =
1208+
s"""addSbtPlugin("org.scala-js" % "sbt-scalajs" % "$scalaJSVersion")\n"""
1209+
IO.write(baseDirectory.value / "sbt-scalajs-sbt", scalaJSPluginText)
12081210
IO.write(baseDirectory.value / "scala3-bootstrapped.version", dottyVersion)
12091211
},
12101212
testOptions in Test += Tests.Argument(

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//
33
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")
44

5-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0")
5+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")
66

77
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "3.6")
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % sys.props("plugin.version"))
2-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.2.0")
2+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.0")

0 commit comments

Comments
 (0)