Skip to content

Commit

Permalink
Merge pull request #3825 from fthomas/topic/use-scalajs-mapSourceURI
Browse files Browse the repository at this point in the history
Use -scalajs-mapSourceURI in Scala 3 builds
  • Loading branch information
larsrh authored Mar 20, 2021
2 parents 8d692b6 + 4bd61ef commit 144c617
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 144c617

Please sign in to comment.