-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #81 from ThoughtWorksInc/cross-build-scala-js
Cross build for Scala.js 1.x and 0.6
- Loading branch information
Showing
6 changed files
with
50 additions
and
17 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType} | ||
|
||
Global / parallelExecution := false | ||
|
||
publish / skip := true | ||
|
||
organization in ThisBuild := "com.thoughtworks.binding" | ||
|
||
lazy val bindable = crossProject in file(".") | ||
lazy val bindableJVM = bindable.jvm | ||
lazy val bindableJS = bindable.js | ||
lazy val bindable = crossProject(JVMPlatform, JSPlatform) in file(".") |
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 |
---|---|---|
@@ -1,11 +1,9 @@ | ||
enablePlugins(ScalaJSBundlerPlugin) | ||
|
||
enablePlugins(Example) | ||
|
||
libraryDependencies += "com.thoughtworks.binding" %%% "jspromisebinding" % "12.0.0-M0" | ||
libraryDependencies += "com.thoughtworks.binding" %%% "jspromisebinding" % "12.0.0-M1" | ||
|
||
addCompilerPlugin("org.typelevel" %% "kind-projector" % "0.10.3") | ||
|
||
jsDependencies in Test += RuntimeDOM | ||
|
||
inConfig(Test) { | ||
jsEnv := RhinoJSEnv().value | ||
} | ||
requireJsDomEnv in Test := true |
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,28 @@ | ||
// An optional sbt file to replace Scala.js 1.0 with 0.6 | ||
dependencyOverrides += Defaults.sbtPluginExtra( | ||
"org.scala-js" % "sbt-scalajs" % "0.6.32", | ||
sbtBinaryVersion.value, | ||
scalaBinaryVersion.value, | ||
) | ||
|
||
dependencyOverrides += Defaults.sbtPluginExtra( | ||
"ch.epfl.scala" % "sbt-scalajs-bundler" % "0.15.0-0.6", | ||
sbtBinaryVersion.value, | ||
scalaBinaryVersion.value, | ||
) | ||
|
||
Compile / sourceGenerators += Def.task { | ||
val file = (Compile / sourceManaged).value / "SkipPublishForNonScalaJSProjects.scala" | ||
IO.write(file, """ | ||
import scalajscrossproject.ScalaJSCrossPlugin.autoImport._ | ||
import sbtcrossproject.CrossPlugin.autoImport._ | ||
import sbt._, Keys._ | ||
object SkipPublishForNonScalaJSProjects extends AutoPlugin { | ||
override def trigger = allRequirements | ||
override def projectSettings = Seq( | ||
publish / skip := crossProjectPlatform.value != JSPlatform | ||
) | ||
} | ||
""") | ||
Seq(file) | ||
}.taskValue |
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 |
---|---|---|
@@ -1,14 +1,11 @@ | ||
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.1.1" % Test | ||
|
||
libraryDependencies += "com.thoughtworks.binding" %%% "binding" % "12.0.0-M0" | ||
|
||
libraryDependencies += "com.thoughtworks.binding" %%% "futurebinding" % "12.0.0-M0" | ||
|
||
libraryDependencies += "com.thoughtworks.binding" %%% "futurebinding" % "12.0.0-M0" | ||
libraryDependencies += "com.thoughtworks.binding" %%% "binding" % "12.0.0-M1" | ||
|
||
libraryDependencies += "com.thoughtworks.binding" %%% "futurebinding" % "12.0.0-M1" | ||
|
||
libraryDependencies += "org.typelevel" %% "simulacrum" % "1.0.0" | ||
|
||
libraryDependencies += "com.thoughtworks.enableIf" %% "enableif" % "1.1.7" | ||
|
||
scalacOptions += "-Ymacro-annotations" | ||
scalacOptions += "-Ymacro-annotations" |