Skip to content

Commit 91752a7

Browse files
committed
Upgrade to Scala.js 1.0.0-M6 and source-depend on scalajs-ir.
1 parent bfde1ab commit 91752a7

File tree

5 files changed

+14
-43
lines changed

5 files changed

+14
-43
lines changed

compiler/test/dotty/Properties.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,4 @@ object Properties {
5858

5959
/** jline-reader jar */
6060
def jlineReader: String = sys.props("dotty.tests.classes.jlineReader")
61-
62-
/** scalajs-ir jar */
63-
def scalaJSIR: String = sys.props("dotty.tests.classes.scalaJSIR")
6461
}

compiler/test/dotty/tools/dotc/CompilationTests.scala

Lines changed: 8 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,7 @@ class CompilationTests extends ParallelTesting {
216216
defaultOutputDir + dotty1Group + "/dotty/" + sep +
217217
// and the other compiler dependenies:
218218
Properties.compilerInterface + sep + Properties.scalaLibrary + sep + Properties.scalaAsm + sep +
219-
Properties.dottyInterfaces + sep + Properties.jlineTerminal + sep + Properties.jlineReader + sep +
220-
Properties.scalaJSIR,
219+
Properties.dottyInterfaces + sep + Properties.jlineTerminal + sep + Properties.jlineReader,
221220
Array("-Ycheck-reentrant", "-Yemit-tasty-in-class")
222221
)
223222

@@ -233,6 +232,7 @@ class CompilationTests extends ParallelTesting {
233232

234233
val backendDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend")
235234
val backendJvmDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend/jvm")
235+
val scalaJSIRDir = Paths.get("compiler/target/scala-2.12/src_managed/main/scalajs-ir-src/org/scalajs/ir")
236236

237237
// NOTE: Keep these exclusions synchronized with the ones in the sbt build (Build.scala)
238238
val backendExcluded =
@@ -244,9 +244,11 @@ class CompilationTests extends ParallelTesting {
244244
sources(Files.list(backendDir), excludedFiles = backendExcluded)
245245
val backendJvmSources =
246246
sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
247+
val scalaJSIRSources =
248+
sources(Files.list(scalaJSIRDir))
247249

248-
val dotty1 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(dotty1Group)
249-
val dotty2 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources, opt)(dotty2Group)
250+
val dotty1 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources ++ scalaJSIRSources, opt)(dotty1Group)
251+
val dotty2 = compileList("dotty", compilerSources ++ backendSources ++ backendJvmSources ++ scalaJSIRSources, opt)(dotty2Group)
250252

251253
val tests = {
252254
lib.keepOutput :: dotty1.keepOutput :: {
@@ -263,7 +265,8 @@ class CompilationTests extends ParallelTesting {
263265
compileShallowFilesInDir("compiler/src/dotty/tools/dotc/typer", opt) +
264266
compileShallowFilesInDir("compiler/src/dotty/tools/dotc/util", opt) +
265267
compileList("shallow-backend", backendSources, opt) +
266-
compileList("shallow-backend-jvm", backendJvmSources, opt)
268+
compileList("shallow-backend-jvm", backendJvmSources, opt) +
269+
compileList("shallow-scalajs-ir", scalaJSIRSources, opt)
267270
}.keepOutput :: Nil
268271
}.map(_.checkCompile())
269272

@@ -301,27 +304,6 @@ class CompilationTests extends ParallelTesting {
301304

302305
compileFilesInDir("tests/plugins/neg").checkExpectedErrors()
303306
}
304-
305-
private val (compilerSources, backendSources, backendJvmSources) = {
306-
val compilerDir = Paths.get("compiler/src")
307-
val compilerSources0 = sources(Files.walk(compilerDir))
308-
309-
val backendDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend")
310-
val backendJvmDir = Paths.get("scala-backend/src/compiler/scala/tools/nsc/backend/jvm")
311-
312-
// NOTE: Keep these exclusions synchronized with the ones in the sbt build (Build.scala)
313-
val backendExcluded =
314-
List("JavaPlatform.scala", "Platform.scala", "ScalaPrimitives.scala")
315-
val backendJvmExcluded =
316-
List("BCodeICodeCommon.scala", "GenASM.scala", "GenBCode.scala", "ScalacBackendInterface.scala", "BackendStats.scala")
317-
318-
val backendSources0 =
319-
sources(Files.list(backendDir), excludedFiles = backendExcluded)
320-
val backendJvmSources0 =
321-
sources(Files.list(backendJvmDir), excludedFiles = backendJvmExcluded)
322-
323-
(compilerSources0, backendSources0, backendJvmSources0)
324-
}
325307
}
326308

327309
object CompilationTests {

compiler/test/dotty/tools/vulpix/TestConfiguration.scala

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ object TestConfiguration {
3131
Properties.scalaAsm,
3232
Properties.jlineTerminal,
3333
Properties.jlineReader,
34-
Properties.scalaJSIR,
3534
Properties.compilerInterface,
3635
Properties.dottyInterfaces,
3736
Properties.dottyLibrary,

project/Build.scala

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,8 @@ object Build {
117117
lazy val ideTestsCompilerArguments = taskKey[Seq[String]]("Compiler arguments to use in IDE tests")
118118
lazy val ideTestsDependencyClasspath = taskKey[Seq[File]]("Dependency classpath to use in IDE tests")
119119

120+
lazy val SourceDeps = config("sourcedeps")
121+
120122
// Settings shared by the build (scoped in ThisBuild). Used in build.sbt
121123
lazy val thisBuildSettings = Def.settings(
122124
organization := dottyOrganization,
@@ -613,8 +615,7 @@ object Build {
613615
"-Ddotty.tests.classes.scalaAsm=" + findLib(attList, "scala-asm"),
614616
"-Ddotty.tests.classes.scalaXml=" + findLib(attList, "scala-xml"),
615617
"-Ddotty.tests.classes.jlineTerminal=" + findLib(attList, "jline-terminal"),
616-
"-Ddotty.tests.classes.jlineReader=" + findLib(attList, "jline-reader"),
617-
"-Ddotty.tests.classes.scalaJSIR=" + findLib(attList, "scalajs-ir")
618+
"-Ddotty.tests.classes.jlineReader=" + findLib(attList, "jline-reader")
618619
)
619620

620621
jarOpts ::: tuning ::: agentOptions ::: ci_build
@@ -657,19 +658,12 @@ object Build {
657658
dotc := runCompilerMain().evaluated,
658659
repl := runCompilerMain(repl = true).evaluated,
659660

660-
// FIXME: Adding the sources of scala-js ir doesn't work anymore because scalajs-ir has a few
661-
// compilation errors when compiled by Dotty:
662-
// - inline is now a keyword
663-
// - methods defined with () need to be called with ()
664-
// Until they're fixed, we rely on scalajs-ir compiled by Scala 2:
665-
libraryDependencies += ("org.scala-js" %% "scalajs-ir" % scalaJSVersion).withDottyCompat(scalaVersion.value),
666-
/*
667661
/* Add the sources of scalajs-ir.
668662
* To guarantee that dotty can bootstrap without depending on a version
669663
* of scalajs-ir built with a different Scala compiler, we add its
670664
* sources instead of depending on the binaries.
671665
*/
672-
ivyConfigurations += config("sourcedeps").hide,
666+
ivyConfigurations += SourceDeps.hide,
673667
transitiveClassifiers := Seq("sources"),
674668
libraryDependencies +=
675669
("org.scala-js" %% "scalajs-ir" % scalaJSVersion % "sourcedeps").withDottyCompat(scalaVersion.value),
@@ -680,7 +674,7 @@ object Build {
680674

681675
val report = updateClassifiers.value
682676
val scalaJSIRSourcesJar = report.select(
683-
configuration = Set("sourcedeps"),
677+
configuration = configurationFilter("sourcedeps"),
684678
module = (_: ModuleID).name.startsWith("scalajs-ir_"),
685679
artifact = artifactFilter(`type` = "src")).headOption.getOrElse {
686680
sys.error(s"Could not fetch scalajs-ir sources")
@@ -696,7 +690,6 @@ object Build {
696690
(trgDir ** "*.scala").get.toSet
697691
} (Set(scalaJSIRSourcesJar)).toSeq
698692
}.taskValue,
699-
*/
700693
)
701694

702695
def runCompilerMain(repl: Boolean = false) = Def.inputTaskDyn {

project/plugins.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Scala IDE project file generator
66
addSbtPlugin("com.typesafe.sbteclipse" % "sbteclipse-plugin" % "5.2.4")
77

8-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M5")
8+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.0.0-M6")
99

1010
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.1")
1111

0 commit comments

Comments
 (0)