-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4773a92
commit 0a40a46
Showing
11 changed files
with
249 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package definitions | ||
|
||
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | ||
import sbt.Keys._ | ||
import sbt._ | ||
|
||
object JvmModule { | ||
|
||
val settings: Seq[Setting[_]] = Seq( | ||
// avoid double-publishing when cross-compiling to Scala.js 1.1+ | ||
skip in publish := !scalaJSVersion.startsWith("0.6") | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package definitions | ||
|
||
import org.scalajs.jsenv.nodejs.NodeJSEnv | ||
import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ | ||
import sbt.Keys._ | ||
import sbt._ | ||
import scoverage.ScoverageKeys.{coverageEnabled, coverageScalacPluginVersion} | ||
import scoverage.ScoverageSbtPlugin._ | ||
|
||
object ScalaJsModule { | ||
|
||
val settings: Seq[Setting[_]] = Seq( | ||
// required for node.js >= v12.12.0 | ||
// see: | ||
// https://github.com/nodejs/node/pull/29919 | ||
jsEnv in Test := new NodeJSEnv(NodeJSEnv.Config().withArgs(List("--enable-source-maps"))), | ||
scalaJSLinkerConfig in Test ~= { | ||
_.withSourceMap(true) | ||
}, | ||
//Opt-in @ScalaJSDefined by default | ||
scalacOptions += { | ||
if (scalaJSVersion.startsWith("0.6")) "-P:scalajs:sjsDefinedByDefault" | ||
else "" | ||
}, | ||
|
||
//TODO: remove these temporal fixes for Scala.js 1.1+ and scoverage | ||
coverageScalacPluginVersion := { | ||
val current = coverageScalacPluginVersion.value | ||
if (scalaJSVersion.startsWith("0.6")) current | ||
else "1.4.2" //the only version that supports Scala.js 1.1+ | ||
}, | ||
libraryDependencies ~= { modules => | ||
if (scalaJSVersion.startsWith("0.6")) modules | ||
else modules.filter(_.organization != OrgScoverage) | ||
}, | ||
libraryDependencies ++= { | ||
if (coverageEnabled.value) { | ||
if (scalaJSVersion.startsWith("0.6")) Nil | ||
else Seq( | ||
OrgScoverage %% s"${ScalacRuntimeArtifact}_sjs1" % coverageScalacPluginVersion.value, | ||
OrgScoverage %% ScalacPluginArtifact % coverageScalacPluginVersion.value % ScoveragePluginConfig.name | ||
) | ||
} | ||
else Nil | ||
} | ||
) | ||
} |
Oops, something went wrong.