Skip to content

Commit

Permalink
Add Scala.JS 1.0 support (#171)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexarchambault authored Mar 2, 2020
1 parent b82f8bb commit 5eeb88a
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,13 @@ jobs:
sudo: required
before_install:
- curl https://raw.githubusercontent.com/scala-native/scala-native/master/scripts/travis_setup.sh | bash -x
- name: Scala.JS 0.6
env: SCALAJS_VERSION=0.6.32
- stage: release
script: sbt ci-release
- name: Scala.JS 0.6
env:
- SCALAJS_VERSION=0.6.32
- CI_RELEASE=+coreJS/publishSigned
stage: release
script: sbt ci-release
2 changes: 1 addition & 1 deletion project/Deps.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ object Deps {
def refined = "eu.timepit" %% "refined" % "0.9.12"
def shapeless = setting("com.chuusai" %%% "shapeless" % "2.3.3")

def scalacheckShapeless = setting("com.github.alexarchambault" %%% "scalacheck-shapeless_1.14" % "1.2.4")
def scalacheckShapeless = setting("com.github.alexarchambault" %%% "scalacheck-shapeless_1.14" % "1.2.5")
def utest = setting {
val sv = scalaVersion.value
val ver =
Expand Down
10 changes: 9 additions & 1 deletion project/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ object Settings {
crossScalaVersions := Seq(scala213, scala212, scala211),
crossScalaVersions := {
val former = crossScalaVersions.value
if (isScalaNative.value)
if (isScalaJs1.value)
former.filter(!_.startsWith("2.11."))
else if (isScalaNative.value)
former.filter(_.startsWith("2.11."))
else
former
Expand Down Expand Up @@ -57,6 +59,12 @@ object Settings {
moduleName := name.value
}

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.")
}

lazy val isScalaNative = Def.setting {
sbtcrossproject.CrossPlugin.autoImport.crossProjectPlatform.?.value.contains(scalanativecrossproject.NativePlatform)
}
Expand Down
5 changes: 4 additions & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
addSbtPlugin("com.geirsson" % "sbt-ci-release" % "1.5.2")
addSbtPlugin("org.scalameta" % "sbt-mdoc" % "2.1.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.32")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.3.9")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")

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

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

0 comments on commit 5eeb88a

Please sign in to comment.