Skip to content

Commit 1310a3c

Browse files
authored
Scala Native Support (#188)
1 parent 001579f commit 1310a3c

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

build.sbt

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ ThisBuild / scalaVersion := "3.1.3"
22
ThisBuild / crossScalaVersions := Seq((ThisBuild / scalaVersion).value, "2.13.8")
33

44
lazy val root = project.in(file("."))
5-
.aggregate(collectionContrib.jvm, collectionContrib.js)
5+
.aggregate(collectionContrib.jvm, collectionContrib.js, collectionContrib.native)
66
.settings(
77
publish / skip := true,
88
// With CrossType.Pure, the root project also picks up the sources in `src`
99
Compile / unmanagedSourceDirectories := Nil,
1010
Test / unmanagedSourceDirectories := Nil,
1111
)
1212

13-
lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform)
13+
lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform, NativePlatform)
1414
.crossType(CrossType.Pure)
1515
.in(file("."))
1616
.settings(ScalaModulePlugin.scalaModuleSettings)
@@ -21,7 +21,7 @@ lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform)
2121
Compile / compile / scalacOptions ++= {
2222
CrossVersion.partialVersion(scalaVersion.value) match {
2323
case Some((2, _)) => Seq("-opt-warnings", "-Werror", "-Wconf:origin=scala.collection.IterableOps.toIterable:s")
24-
case _ => Seq("-Xfatal-warnings", "-scala-output-version:3.0", "-Wconf:cat=deprecation:s")
24+
case _ => Seq("-Xfatal-warnings", "-Wconf:cat=deprecation:s")
2525
}
2626
},
2727
Compile / doc / scalacOptions ++= {
@@ -42,6 +42,12 @@ lazy val collectionContrib = crossProject(JVMPlatform, JSPlatform)
4242
// Scala.js cannot run forked tests
4343
Test / fork := false
4444
)
45+
.nativeEnablePlugins(ScalaNativeJUnitPlugin)
46+
.nativeSettings(
47+
// Scala native cannot run forked tests
48+
Test / fork := false
49+
)
4550

46-
lazy val collectionContribJVM = collectionContrib.jvm
47-
lazy val collectionContribJS = collectionContrib.js
51+
lazy val collectionContribJVM = collectionContrib.jvm
52+
lazy val collectionContribJS = collectionContrib.js
53+
lazy val collectionContribNative = collectionContrib.native

project/plugins.sbt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "3.0.1")
22
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.2.0")
3+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.2.0")
34
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.10.1")
5+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.4.7")

0 commit comments

Comments
 (0)