Skip to content

Update for Scala Native 0.4.0 #387

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

Merged
merged 3 commits into from
Jan 19, 2021
Merged
Show file tree
Hide file tree
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
32 changes: 15 additions & 17 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,39 +11,37 @@ scala:
- 3.0.0-M3

env:
- SCALAJS_VERSION= ADOPTOPENJDK=8
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=8
- SCALAJS_VERSION= ADOPTOPENJDK=11
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=11
- SCALAJS_VERSION= ADOPTOPENJDK=8
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=8
- SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8
- SCALAJS_VERSION= ADOPTOPENJDK=11
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=11
- SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=11

matrix:

include:

# run migration test
- scala: 2.12.12
env: TEST_SCALAFIX=true ADOPTOPENJDK=8
env: TEST_SCALAFIX=true ADOPTOPENJDK=8

# run binary compatibility test
- scala: 2.12.12
env: TEST_BINARY_COMPAT=true ADOPTOPENJDK=8
env: TEST_BINARY_COMPAT=true ADOPTOPENJDK=8

# run scalafmt
- scala: 2.12.12
env: TEST_SCALAFMT=true ADOPTOPENJDK=8
env: TEST_SCALAFMT=true ADOPTOPENJDK=8

# Scala Native includes
- scala: 2.11.12
env: SCALANATIVE_VERSION=0.3.9 ADOPTOPENJDK=8
exclude:

- scala: 2.11.12
env: SCALANATIVE_VERSION=0.4.0-M2 ADOPTOPENJDK=8
# not supported yet
- scala: 3.0.0-M3
env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8

- scala: 2.11.12
env: SCALANATIVE_VERSION=0.3.9 ADOPTOPENJDK=11

- scala: 2.11.12
env: SCALANATIVE_VERSION=0.4.0-M2 ADOPTOPENJDK=11
- scala: 3.0.0-M3
env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=11

install:
- git fetch --tags # get all tags for sbt-dynver
Expand Down
16 changes: 11 additions & 5 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,10 @@ lazy val root = project
compat211Native,
compat212JVM,
compat212JS,
compat212Native,
compat213JVM,
compat213JS,
compat213Native,
compat30JVM,
compat30JS,
`scalafix-data211`,
Expand All @@ -51,7 +53,7 @@ lazy val root = project
lazy val junit = libraryDependencies += "com.novocode" % "junit-interface" % "0.11" % Test

lazy val scala211 = "2.11.12"
lazy val scala212 = "2.12.12"
lazy val scala212 = "2.12.13"
lazy val scala213 = "2.13.4"
lazy val scala30 = "3.0.0-M3"

Expand Down Expand Up @@ -96,10 +98,12 @@ lazy val compat = MultiScalaCrossProject(JSPlatform, JVMPlatform, NativePlatform
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
.disablePlugins(ScalafixPlugin)
.nativeSettings(
crossScalaVersions := List(scala211),
scalaVersion := scala211, // allows to compile if scalaVersion set not 2.11
nativeLinkStubs := true,
Test / test := {}
addCompilerPlugin(
"org.scala-native" % "junit-plugin" % nativeVersion cross CrossVersion.full
),
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion,
Test / fork := false // Scala Native cannot run forked tests
)
)

Expand All @@ -113,8 +117,10 @@ lazy val compat211JS = compat211.js
lazy val compat211Native = compat211.native
lazy val compat212JVM = compat212.jvm
lazy val compat212JS = compat212.js
lazy val compat212Native = compat212.native
lazy val compat213JVM = compat213.jvm
lazy val compat213JS = compat213.js
lazy val compat213Native = compat213.native
lazy val compat30JVM = compat30.jvm
lazy val compat30JS = compat30.js

Expand Down Expand Up @@ -353,7 +359,7 @@ inThisBuild(

Seq(
List(s"$projectPrefix/clean"),
if (isScalaNative) List() else List(s"$testProjectPrefix/test"),
List(s"$testProjectPrefix/test"),
List(s"$projectPrefix/publishLocal"),
publishTask
).flatten
Expand Down
2 changes: 2 additions & 0 deletions project/MultiScalaProject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import sbtcrossproject.{Platform, CrossProject}
import sbtcrossproject.CrossPlugin.autoImport.{crossProject, CrossType}
import sbtcrossproject.CrossPlugin.autoImport._
import scalajscrossproject.ScalaJSCrossPlugin.autoImport._
import scalanativecrossproject.ScalaNativeCrossPlugin.autoImport._

import java.io.File

Expand Down Expand Up @@ -87,6 +88,7 @@ class MultiScalaCrossProject(platforms: Seq[Platform],
.settings(moduleName := name)
.jvmSettings(scalaVersion := scalaV)
.jsSettings(scalaVersion := scalaVJs)
.nativeSettings(scalaVersion := scalaV)
.settings(srcFull(name))

configurePerScala(configure(resultingProject))
Expand Down
2 changes: 1 addition & 1 deletion project/plugins.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ val crossVer = "1.0.0"
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.4.0")
val scalaNativeVersion =
Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.3.9")
Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.4.0")

addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.1")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
Expand Down