Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 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
16 changes: 12 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@ scala:
- 2.13.4

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

jobs:
exclude:
- scala: 3.0.0-M2
env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8
- scala: 3.0.0-M3
env: SCALANATIVE_VERSION=0.4.0 ADOPTOPENJDK=8

install:
- git fetch --tags # get all tags for sbt-dynver
Expand Down
26 changes: 25 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ lazy val configSettings: Seq[Setting[_]] = Seq(
}
)

lazy val xml = crossProject(JSPlatform, JVMPlatform)
lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.withoutSuffixFor(JVMPlatform)
.crossType(CrossType.Full)
.in(file("."))
Expand Down Expand Up @@ -163,3 +163,27 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform)
Test / fork := false
)
.jsConfigure(_.enablePlugins(ScalaJSJUnitPlugin))
.nativeSettings(
scalaModuleMimaPreviousVersion := None, // No such release yet
// Scala Native cannot run forked tests
Test / fork := false,
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion % Test,
Test / scalacOptions += {
val log = streams.value.log
val retrieveDir = baseDirectory.value / "scala-native-junit-plugin-jars"
val lm = dependencyResolution.value
val cp = lm
.retrieve(
"org.scala-native" % s"junit-plugin_${scalaVersion.value}" % nativeVersion,
scalaModuleInfo = None,
retrieveDir,
log
)
.fold(w => throw w.resolveException, identity(_))
val jarPath = cp
.find(_.toString.contains("junit-plugin"))
.getOrElse(throw new Exception("Can't find Scala Native junit-plugin jar"))
s"-Xplugin:$jarPath"
},
Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v")
)
4 changes: 3 additions & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,10 @@ isReleaseJob() {
fi
}

if [[ "$SCALAJS_VERSION" == "" ]]; then
if [[ "$SCALAJS_VERSION" == "" ]] && [[ "$SCALANATIVE_VERSION" == "" ]]; then
projectPrefix="xml/"
elif [[ "$SCALAJS_VERSION" == "" ]]; then
projectPrefix="xmlNative/"
else
projectPrefix="xmlJS/"
fi
Expand Down
5 changes: 5 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
val scalaJSVersion =
Option(System.getenv("SCALAJS_VERSION")).filter(_.nonEmpty).getOrElse("1.4.0")

val scalaNativeVersion =
Option(System.getenv("SCALANATIVE_VERSION")).filter(_.nonEmpty).getOrElse("0.4.0")

addSbtPlugin("org.scala-lang.modules" % "sbt-scala-module" % "2.2.3")
addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.0.0")
addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.0.0")
addSbtPlugin("org.scala-js" % "sbt-scalajs" % scalaJSVersion)
addSbtPlugin("org.scala-native" % "sbt-scala-native" % scalaNativeVersion)
addSbtPlugin("ch.epfl.lamp" % "sbt-dotty" % "0.5.2")