@@ -140,7 +140,15 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
140140 )
141141 .jsEnablePlugins(ScalaJSJUnitPlugin )
142142 .nativeSettings(
143- crossScalaVersions := Seq (" 2.13.8" , " 2.12.15" ),
143+ crossScalaVersions := Seq (" 2.13.8" , " 2.12.15" , " 3.1.1" ),
144+ mimaPreviousArtifacts := {
145+ // TODO remove this setting when 2.0.2 released
146+ if (scalaBinaryVersion.value == " 3" ) {
147+ mimaPreviousArtifacts.value.filterNot(_.revision == " 2.0.1" )
148+ } else {
149+ mimaPreviousArtifacts.value
150+ }
151+ },
144152 // Scala Native cannot run forked tests
145153 Test / fork := false ,
146154 libraryDependencies += " org.scala-native" %%% " junit-runtime" % nativeVersion % Test ,
@@ -161,5 +169,21 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
161169 .getOrElse(throw new Exception (" Can't find Scala Native junit-plugin jar" ))
162170 s " -Xplugin: $jarPath"
163171 },
164- Test / testOptions += Tests .Argument (TestFrameworks .JUnit , " -a" , " -s" , " -v" )
172+ Test / testOptions += Tests .Argument (TestFrameworks .JUnit , " -a" , " -s" , " -v" ),
173+ // Scala Native doesn't support Scala 3.0
174+ Compile / nativeLink := { if (isScala30(scalaVersion.value)) null else (Compile / nativeLink).value },
175+ Test / nativeLink := { if (isScala30(scalaVersion.value)) null else (Test / nativeLink).value },
176+ Test / test := { if (isScala30(scalaVersion.value)) {} else (Test / test).value },
177+ Compile / sources := { if (isScala30(scalaVersion.value)) Nil else (Compile / sources).value },
178+ Test / sources := { if (isScala30(scalaVersion.value)) Nil else (Test / sources).value },
179+ libraryDependencies := { if (isScala30(scalaVersion.value)) Nil else libraryDependencies.value },
180+ Test / scalacOptions := { if (isScala30(scalaVersion.value)) Nil else (Test / scalacOptions).value },
181+ publish / skip := { isScala30(scalaVersion.value) },
165182 )
183+
184+ def isScala30 (scalaVersion : String ) = {
185+ CrossVersion .partialVersion(scalaVersion) match {
186+ case Some ((3 , 0 )) => true
187+ case _ => false
188+ }
189+ }
0 commit comments