Skip to content

Commit 01e92e0

Browse files
[build] Add missing mapSourceURI for scala-library-sjs project (#24450)
`-scalajs-mapSourceURI` was missing, it's required to emit correct debug informaiton in Scala.js debuggers
1 parent 7615aa3 commit 01e92e0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

project/Build.scala

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ object Build {
163163
val homepageUrl = "https://scala-lang.org/"
164164
val dottyOrganization = "org.scala-lang"
165165
val dottyGithubUrl = "https://github.com/scala/scala3"
166+
val dottyGithubRawUserContentUrl = "https://raw.githubusercontent.com/scala/scala3"
166167

167168
// Run tests with filter through vulpix test suite
168169
val testCompilation = inputKey[Unit]("runs integration test with the supplied filter")
@@ -1457,6 +1458,16 @@ object Build {
14571458
Compile / scalacOptions += "-Yno-stdlib-patches",
14581459
Compile / scalacOptions += "-Yexplicit-nulls",
14591460
Compile / scalacOptions += "-scalajs",
1461+
// Configure the source maps to point to GitHub for releases
1462+
Compile / scalacOptions ++= {
1463+
if (isRelease) {
1464+
val baseURI = (LocalRootProject / baseDirectory).value.toURI
1465+
val dottyVersion = version.value
1466+
Seq(s"-scalajs-mapSourceURI:$baseURI->$dottyGithubRawUserContentUrl/$dottyVersion/")
1467+
} else {
1468+
Nil
1469+
}
1470+
},
14601471
// Packaging configuration of the stdlib
14611472
Compile / packageBin / publishArtifact := true,
14621473
Compile / packageDoc / publishArtifact := false,

0 commit comments

Comments
 (0)