@@ -32,23 +32,17 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
3232 .jvmSettings(ScalaModulePlugin .scalaModuleOsgiSettings)
3333 .settings(
3434 name := " scala-xml" ,
35- scalacOptions ++= {
36- val opts =
37- if (isDotty.value)
38- " -language:Scala2"
39- else
40- // Compiler team advised avoiding the -Xsource:2.14 option for releases.
41- // The output with -Xsource should be periodically checked, though.
42- " -deprecation:false -feature -Xlint:-stars-align,-nullary-unit,_"
43- opts.split(" \\ s+" ).to[Seq ]
44- },
35+ scalacOptions ++= (CrossVersion .partialVersion(scalaVersion.value) match {
36+ case Some ((3 , _)) =>
37+ Seq (" -language:Scala2" )
38+ case _ =>
39+ // Compiler team advised avoiding the -Xsource:2.14 option for releases.
40+ // The output with -Xsource should be periodically checked, though.
41+ Seq (" -deprecation:false" , " -feature" , " -Xlint:-stars-align,-nullary-unit,_" )
42+ }),
4543
4644 Test / scalacOptions += " -Xxml:coalescing" ,
4745
48- // don't run Dottydoc, it errors and isn't needed anyway.
49- // but we leave `publishArtifact` set to true, otherwise Sonatype won't let us publish
50- Compile / doc / sources := (if (isDotty.value) Seq () else (Compile / doc/ sources).value),
51-
5246 headerLicense := Some (HeaderLicense .Custom (
5347 s """ |Scala (https://www.scala-lang.org)
5448 |
@@ -61,11 +55,11 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
6155 |additional information regarding copyright ownership.
6256 | """ .stripMargin)),
6357
64- scalaModuleMimaPreviousVersion := {
58+ scalaModuleMimaPreviousVersion := ( CrossVersion .partialVersion(scalaVersion.value) match {
6559 // pending resolution of https://github.com/scalacenter/sbt-version-policy/issues/62
66- if (isDotty.value) None
67- else Some (" 2.0.0-M5" )
68- },
60+ case Some (( 3 , _)) => None
61+ case _ => Some (" 2.0.0-M5" )
62+ }) ,
6963 mimaBinaryIssueFilters ++= {
7064 import com .typesafe .tools .mima .core ._
7165 import com .typesafe .tools .mima .core .ProblemFilters ._
@@ -74,8 +68,8 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
7468 exclude[DirectMissingMethodProblem ](" scala.xml.Utility.escapeText" ),
7569 // New MiMa checks for generic signature changes
7670 exclude[IncompatibleSignatureProblem ](" *" ),
77- // afaict this is just a JDK 8 vs 15 difference, producing a false positive when
78- // we compare classes built on JDK 15 (which we only do on CI, not at release time)
71+ // afaict this is just a JDK 8 vs 16 difference, producing a false positive when
72+ // we compare classes built on JDK 16 (which we only do on CI, not at release time)
7973 // to previous-version artifacts that were built on 8. see scala/scala-xml#501
8074 exclude[DirectMissingMethodProblem ](" scala.xml.include.sax.XIncluder.declaration" ),
8175 )
@@ -115,12 +109,12 @@ lazy val xml = crossProject(JSPlatform, JVMPlatform, NativePlatform)
115109 libraryDependencies += " junit" % " junit" % " 4.13.2" % Test ,
116110 libraryDependencies += " com.novocode" % " junit-interface" % " 0.11" % Test ,
117111 libraryDependencies += " org.apache.commons" % " commons-lang3" % " 3.12.0" % Test ,
118- libraryDependencies ++= {
119- if (isDotty.value)
112+ libraryDependencies ++= ( CrossVersion .partialVersion(scalaVersion.value) match {
113+ case Some (( 3 , _)) =>
120114 Seq ()
121- else
115+ case _ =>
122116 Seq ((" org.scala-lang" % " scala-compiler" % scalaVersion.value % Test ).exclude(" org.scala-lang.modules" , s " scala-xml_ ${scalaBinaryVersion.value}" ))
123- }
117+ }),
124118 )
125119 .jsSettings(
126120 // Scala.js cannot run forked tests
0 commit comments