Skip to content

Commit

Permalink
Add Scala.JS 1.0 support (#159)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault authored Mar 2, 2020
1 parent 33368e4 commit 77128cd
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ jobs:
- scala: 2.11.12
- scala: 2.12.10
- scala: 2.13.1
- env: SCALAJS_VERSION=0.6.32
name: "Scala.JS 0.6"
script: sbt -batch +testJS/test
- stage: release
script: sbt ci-release
- stage: release
env:
- SCALAJS_VERSION=0.6.32
- CI_RELEASE=+coreJS/publishSigned
name: "Scala.JS 0.6"
script: sbt ci-release
branches:
only:
- master
Expand Down
13 changes: 13 additions & 0 deletions project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@ object Settings {
lazy val shared = Seq(
scalaVersion := scala212,
crossScalaVersions := Seq(scala213, scala212, scala211),
crossScalaVersions := {
val former = crossScalaVersions.value
if (isScalaJs1.value)
former.filter(!_.startsWith("2.11."))
else
former
},
scalacOptions ++= {
scalaBinaryVersion.value match {
case "2.11" =>
Expand All @@ -33,4 +40,10 @@ object Settings {
testFrameworks += new TestFramework("utest.runner.Framework")
)

lazy val isScalaJs1 = Def.setting {
def scalaJsVersion = Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.0")
sbtcrossproject.CrossPlugin.autoImport.crossProjectPlatform.?.value.contains(scalajscrossproject.JSPlatform) &&
scalaJsVersion.startsWith("1.")
}

}
5 changes: 4 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
plugins_(
"com.geirsson" % "sbt-ci-release" % "1.5.2",
"com.typesafe" % "sbt-mima-plugin" % "0.7.0",
"org.scala-js" % "sbt-scalajs" % "0.6.32",
"org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0"
)

def plugins_(modules: ModuleID*) = modules.map(addSbtPlugin)

val scalaJsVersion = Option(System.getenv("SCALAJS_VERSION")).getOrElse("1.0.0")

addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJsVersion)

0 comments on commit 77128cd

Please sign in to comment.