Skip to content

Commit

Permalink
Merge pull request #43 from japgolly/sourcemap
Browse files Browse the repository at this point in the history
Use Github URL in source maps (#37)
  • Loading branch information
lihaoyi committed Oct 10, 2014
2 parents 29c84ad + 26fc018 commit c346646
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ object Build extends sbt.Build{
</developers>

)

def sourceMapsToGithub: Project => Project =
p => p.settings(
scalacOptions ++= (if (isSnapshot.value) Seq.empty else Seq({
val a = p.base.toURI.toString.replaceFirst("[^/]+/?$", "")
val g = "https://raw.githubusercontent.com/lihaoyi/scalatags"
s"-P:scalajs:mapSourceURI:$a->$g/v${version.value}/"
}))
)

lazy val root = cross.root

lazy val js = cross.js.settings(
Expand All @@ -55,9 +65,9 @@ object Build extends sbt.Build{
),
test in Test := (test in (Test, fastOptStage)).value,
requiresDOM := true
)
).configure(sourceMapsToGithub)

lazy val jvm = cross.jvm
lazy val jvm = cross.jvm.configure(sourceMapsToGithub)

lazy val example = project.in(file("example"))
.dependsOn(js)
Expand Down

0 comments on commit c346646

Please sign in to comment.