Skip to content

Commit

Permalink
Merge pull request #6538 from adpi2/fix-mkScalaInstance
Browse files Browse the repository at this point in the history
Fix compiler class loader jars
  • Loading branch information
eed3si9n committed Jun 12, 2021
2 parents f18faaf + 75a55a1 commit a9402a6
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 18 deletions.
7 changes: 1 addition & 6 deletions main/src/main/scala/sbt/Defaults.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1182,12 +1182,7 @@ object Defaults extends BuildCommon {
val allJars = libraryJars ++ compilerJars ++ docJars

val libraryLoader = classLoaderCache(libraryJars.toList, jansiExclusionLoader)
val compilerLoader = classLoaderCache(
// It should be `compilerJars` but it would break on `3.0.0-M2` because of
// https://github.com/lampepfl/dotty/blob/d932af954ef187d7bdb87500d49ed0ff530bd1e7/sbt-bridge/src/xsbt/CompilerClassLoader.java#L108-L117
allCompilerJars.toList,
libraryLoader
)
val compilerLoader = classLoaderCache(compilerJars.toList, libraryLoader)
val fullLoader =
if (docJars.isEmpty) compilerLoader
else classLoaderCache(docJars.distinct.toList, compilerLoader)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import xsbti.compile.TastyFiles

ThisBuild / scalaVersion := "3.0.0-M2"
ThisBuild / scalaVersion := "3.0.0-M3"

TaskKey[Unit]("check") := {
assert((Compile / auxiliaryClassFiles).value == Seq(TastyFiles.instance))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
> check
> compile

$ exists target/scala-3.0.0-M2/classes/A.tasty
$ exists target/scala-3.0.0-M2/classes/B.tasty
$ exists target/scala-3.0.0-M3/classes/A.tasty
$ exists target/scala-3.0.0-M3/classes/B.tasty

$ delete src/main/scala/B.scala

> compile

$ exists target/scala-3.0.0-M2/classes/A.tasty
-$ exists target/scala-3.0.0-M2/classes/B.tasty
$ exists target/scala-3.0.0-M3/classes/A.tasty
-$ exists target/scala-3.0.0-M3/classes/B.tasty
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
ThisBuild / scalaVersion := "3.0.0-M2"
ThisBuild / scalaVersion := "3.0.0-M3"

lazy val check = taskKey[Unit]("")

Expand Down
6 changes: 3 additions & 3 deletions sbt-app/src/sbt-test/project/scala3-sandwich-sjs/build.sbt
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
ThisBuild / scalaVersion := "2.13.4"
ThisBuild / scalaVersion := "2.13.6"
ThisBuild / scalacOptions += "-Ytasty-reader"

lazy val scala3code = project
.enablePlugins(ScalaJSPlugin)
.settings(scalaVersion := "3.0.0-M1")
.settings(scalaVersion := "3.0.0")

lazy val app = project
.enablePlugins(ScalaJSPlugin)
.dependsOn(scala3code)
.settings(
scalaVersion := "2.13.4",
scalaVersion := "2.13.6",
scalacOptions += "-Ytasty-reader",
scalaJSUseMainModuleInitializer := true
)
Original file line number Diff line number Diff line change
@@ -1 +1 @@
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.3.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.6.0")
4 changes: 2 additions & 2 deletions sbt-app/src/sbt-test/project/scala3-sandwich/build.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ThisBuild / scalaVersion := "3.0.0-M1"
ThisBuild / scalaVersion := "3.0.0"

lazy val scala213 = "2.13.4"
lazy val scala213 = "2.13.6"

lazy val root = (project in file("."))
.aggregate(fooApp, fooCore, barApp, barCore)
Expand Down

0 comments on commit a9402a6

Please sign in to comment.