Skip to content

Commit 61fa0fd

Browse files
committed
Add support for Scala Native 0.4
1 parent 97a9018 commit 61fa0fd

File tree

4 files changed

+22
-6
lines changed

4 files changed

+22
-6
lines changed

.travis.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ scala:
1111
- 2.13.4
1212

1313
env:
14-
- SCALAJS_VERSION= ADOPTOPENJDK=8
15-
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=8
16-
- SCALAJS_VERSION= ADOPTOPENJDK=11
17-
- SCALAJS_VERSION= ADOPTOPENJDK=15
14+
- SCALAJS_VERSION= ADOPTOPENJDK=8
15+
- SCALAJS_VERSION=1.4.0 ADOPTOPENJDK=8
16+
- SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8
17+
- SCALAJS_VERSION= ADOPTOPENJDK=11
18+
- SCALAJS_VERSION= ADOPTOPENJDK=15
1819

1920
install:
2021
- git fetch --tags # get all tags for sbt-dynver

build.sbt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ lazy val configSettings: Seq[Setting[_]] = Seq(
1818
}
1919
)
2020

21-
lazy val xml = crossProject(JSPlatform, JVMPlatform)
21+
lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
2222
.withoutSuffixFor(JVMPlatform)
2323
.crossType(CrossType.Full)
2424
.in(file("."))
@@ -163,3 +163,11 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
163163
Test / fork := false
164164
)
165165
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
166+
.nativeSettings(
167+
scalaModuleMimaPreviousVersion := None, // No such release yet
168+
// Scala Native cannot run forked tests
169+
Test / fork := false,
170+
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion % Test,
171+
addCompilerPlugin("org.scala-native" % "junit-plugin" % nativeVersion cross CrossVersion.full),
172+
Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v")
173+
)

build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ isReleaseJob() {
2525
fi
2626
}
2727

28-
if [[ "$SCALAJS_VERSION" == "" ]]; then
28+
if [[ "$SCALAJS_VERSION" == "" ]] && [[ "$SCALANATIVE_VERSION" == "" ]]; then
2929
projectPrefix="xml/"
30+
elif [[ "$SCALAJS_VERSION" == "" ]]; then
31+
projectPrefix="xmlNative/"
3032
else
3133
projectPrefix="xmlJS/"
3234
fi

project/plugins.sbt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
val scalaJSVersion =
22
Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.4.0")
33

4+
val scalaNativeVersion =
5+
Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.4.0")
6+
47
addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3")
58
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
9+
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
610
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
11+
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
712
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.2")

0 commit comments

Comments
 (0)