Skip to content
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
3 changes: 3 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,6 @@ workflows:
- scalanative_job:
name: native0.4_2.13
scala_version: 2.13.8
- scalanative_job:
name: native0.4_3
scala_version: 3.1.1
28 changes: 26 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,15 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
)
.jsEnablePlugins(ScalaJSJUnitPlugin)
.nativeSettings(
crossScalaVersions := Seq("2.13.8", "2.12.15"),
crossScalaVersions := Seq("2.13.8", "2.12.15", "3.1.1"),
mimaPreviousArtifacts := {
// TODO remove this setting when 2.0.2 released
if (scalaBinaryVersion.value == "3") {
mimaPreviousArtifacts.value.filterNot(_.revision == "2.0.1")
} else {
mimaPreviousArtifacts.value
}
},
// Scala Native cannot run forked tests
Test / fork := false,
libraryDependencies += "org.scala-native" %%% "junit-runtime" % nativeVersion % Test,
Expand All @@ -161,5 +169,21 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
.getOrElse(throw new Exception("Can't find Scala Native junit-plugin jar"))
s"-Xplugin:$jarPath"
},
Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v")
Test / testOptions += Tests.Argument(TestFrameworks.JUnit, "-a", "-s", "-v"),
// Scala Native doesn't support Scala 3.0
Compile / nativeLink := { if(isScala30(scalaVersion.value)) null else (Compile / nativeLink).value },
Test / nativeLink := { if(isScala30(scalaVersion.value)) null else (Test / nativeLink).value },
Test / test := { if(isScala30(scalaVersion.value)) {} else (Test / test).value },
Compile / sources := { if(isScala30(scalaVersion.value)) Nil else (Compile / sources).value },
Test / sources := { if(isScala30(scalaVersion.value)) Nil else (Test / sources).value },
libraryDependencies := { if(isScala30(scalaVersion.value)) Nil else libraryDependencies.value },
Test / scalacOptions := { if(isScala30(scalaVersion.value)) Nil else (Test / scalacOptions).value },
publish / skip := { isScala30(scalaVersion.value) },
)

def isScala30(scalaVersion: String) = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((3, 0)) => true
case _ => false
}
}