Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix source map URL #60

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,16 @@ val commonSettings: Seq[Setting[_]] = Seq(
organization := "org.scala-js",
scalacOptions ++= Seq("-deprecation", "-feature", "-Xfatal-warnings"),

scalacOptions ++= {
if (isSnapshot.value)
Seq.empty
else {
Comment on lines +18 to +20
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In our coding style, if one of the two branches of the if needs braces, then the other one must have braces as well:

Suggested change
if (isSnapshot.value)
Seq.empty
else {
if (isSnapshot.value) {
Seq.empty
} else {

val a = baseDirectory.value.toURI
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

baseDirectory depends on the project, whereas the URL is the same for all projects, so this will only work for the root project. Either move those options to the root project only (which is fine because that's the only project that gets published) or apply the following change, so that it would work in all projects:

Suggested change
val a = baseDirectory.value.toURI
val a = (baseDirectory in LocalRootProject).value.toURI

val g = "https://raw.githubusercontent.com/scala-js/scala-js-java-time"
Seq(s"-P:scalajs:mapSourceURI:$a->$g/v${version.value}/")
}
},

homepage := Some(url("http://scala-js.org/")),
licenses += ("BSD New",
url("https://github.com/scala-js/scala-js-java-time/blob/master/LICENSE")),
Expand Down