@@ -482,6 +482,20 @@ object Build {
482
482
},
483
483
)
484
484
485
+ def addWconfSettingIf2_13 (conf : String ): Def .Setting [_] = {
486
+ scalacOptions ++= {
487
+ /* We exclude 2.13.0 and 2.13.1 because they did not support -Wconf yet.
488
+ * Fortunately, our use cases for -Wconf are only triggered with later
489
+ * versions.
490
+ */
491
+ val v = scalaVersion.value
492
+ if (v.startsWith(" 2.13." ) && v != " 2.13.0" && v != " 2.13.1" )
493
+ List (" -Wconf:" + conf)
494
+ else
495
+ Nil
496
+ }
497
+ }
498
+
485
499
val commonSettings = Seq (
486
500
organization := " org.scala-js" ,
487
501
version := scalaJSVersion,
@@ -517,6 +531,14 @@ object Build {
517
531
" -encoding" , " utf8"
518
532
),
519
533
534
+ /* Ignore the deprecation of mutable.AnyRefMap in Scala 2.13.16+.
535
+ * It was deprecated because mutable.HashMap is just as fast, starting
536
+ * from 2.13.0. However we still use it for performance in Scala 2.12.x,
537
+ * which is important because that's the version of the linker used by
538
+ * the sbt plugin.
539
+ */
540
+ addWconfSettingIf2_13(" cat=deprecation&origin=scala\\ .collection\\ .mutable\\ .AnyRefMap.*:s" ),
541
+
520
542
scalastyleCheck := Def .task {
521
543
val _ = (scalastyle in Compile ).toTask(" " ).value
522
544
(scalastyle in Test ).toTask(" " ).value
@@ -1816,17 +1838,7 @@ object Build {
1816
1838
/* Silence a Scala 2.13.13+ warning that we cannot address without breaking our API.
1817
1839
* See `js.WrappedDictionary.keys` and `js.WrappedMap.keys`.
1818
1840
*/
1819
- scalacOptions ++= {
1820
- /* We only need the option in 2.13.13+, but listing all previous 2.13.x
1821
- * versions is cumberson. We only exclude 2.13.0 and 2.13.1 because
1822
- * they did not support -Wconf at all.
1823
- */
1824
- val v = scalaVersion.value
1825
- if (v.startsWith(" 2.13." ) && v != " 2.13.0" && v != " 2.13.1" )
1826
- List (" -Wconf:msg=overriding method keys in trait MapOps is deprecated:s" )
1827
- else
1828
- Nil
1829
- },
1841
+ addWconfSettingIf2_13(" msg=overriding method keys in trait MapOps is deprecated:s" ),
1830
1842
1831
1843
test in Test := {
1832
1844
streams.value.log.warn(" Skipping library/test. Run testSuite/test to test library." )
0 commit comments