@@ -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,27 @@ 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+ Test / scalacOptions += {
172+ val log = streams.value.log
173+ val retrieveDir = baseDirectory.value / " scala-native-junit-plugin-jars"
174+ val lm = dependencyResolution.value
175+ val cp = lm
176+ .retrieve(
177+ " org.scala-native" % s " junit-plugin_ ${scalaVersion.value}" % nativeVersion,
178+ scalaModuleInfo = None ,
179+ retrieveDir,
180+ log
181+ )
182+ .fold(w => throw w.resolveException, identity(_))
183+ val jarPath = cp
184+ .find(_.toString.contains(" junit-plugin" ))
185+ .getOrElse(throw new Exception (" Can't find Scala Native junit-plugin jar" ))
186+ s " -Xplugin: $jarPath"
187+ },
188+ Test / testOptions += Tests .Argument (TestFrameworks .JUnit , " -a" , " -s" , " -v" )
189+ )
0 commit comments