Skip to content

Commit

Permalink
Use -scalajs-mapSourceURI in Scala 3 builds
Browse files Browse the repository at this point in the history
  • Loading branch information
fthomas committed Mar 10, 2021
1 parent ed3d407 commit 4bd61ef
Showing 1 changed file with 9 additions and 11 deletions.
20 changes: 9 additions & 11 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -186,17 +186,15 @@ lazy val tagName = Def.setting {

lazy val commonJsSettings = Seq(
publishConfiguration := publishConfiguration.value.withOverwrite(true), // needed since we double-publish on release
scalacOptions ++= {
if (isDotty.value) Seq()
else {
val tv = tagName.value
val tagOrHash =
if (isSnapshot.value) sys.process.Process("git rev-parse HEAD").lineStream_!.head
else tv
val a = (baseDirectory in LocalRootProject).value.toURI.toString
val g = "https://raw.githubusercontent.com/typelevel/cats/" + tagOrHash
Seq(s"-P:scalajs:mapSourceURI:$a->$g/")
}
scalacOptions += {
val tv = tagName.value
val tagOrHash =
if (isSnapshot.value) sys.process.Process("git rev-parse HEAD").lineStream_!.head
else tv
val a = (baseDirectory in LocalRootProject).value.toURI.toString
val g = "https://raw.githubusercontent.com/typelevel/cats/" + tagOrHash
val opt = if (isDotty.value) "-scalajs-mapSourceURI" else "-P:scalajs:mapSourceURI"
s"$opt:$a->$g/"
},
scalaJSStage in Global := FullOptStage,
scalaJSStage in Test := FastOptStage,
Expand Down

0 comments on commit 4bd61ef

Please sign in to comment.