@@ -28,7 +28,16 @@ object SdPlugin extends AutoPlugin {
28
28
)
29
29
30
30
override def projectSettings : Seq [Setting [? ]] = Seq (
31
- scalacOptions ++= sdScalacOptions(scalaVersion.value)
31
+ scalacOptions ++= sdScalacOptions(scalaVersion.value),
32
+ Compile / scalacOptions ++= (scalaBinaryVersion.value match {
33
+ // scala 2.11 don't support -Wconf.
34
+ // So, for convenience, we don't add -Xfatal-warnings
35
+ case " 2.11" => Nil
36
+ // TODO enable -Xfatal-warnings when this is RELEASED in scala3:
37
+ // https://github.com/lampepfl/dotty/pull/12857
38
+ case " 3" => Nil
39
+ case _ => Seq (" -Xfatal-warnings" )
40
+ }),
32
41
)
33
42
34
43
val skipPublish : Seq [Setting [? ]] = Seq (
@@ -39,14 +48,15 @@ object SdPlugin extends AutoPlugin {
39
48
/** @param scalaVersion scala version. Ex 2.11.12, 3.1.0-RC2,..
40
49
* @return default scalacOptions for all sandinh's projects
41
50
* @see [[https://docs.scala-lang.org/scala3/guides/migration/options-lookup.html Compiler Options Lookup Table ]]
51
+ * @see [[https://www.scala-lang.org/2021/01/12/configuring-and-suppressing-warnings.html Configuring and suppressing warnings ]]
52
+ * @see [[https://github.com/lampepfl/dotty/pull/12857 Support -Wconf and @nowarn in scala3 ]]
42
53
*/
43
54
def sdScalacOptions (scalaVersion : String ): Seq [String ] = {
44
55
val Some ((major, minor)) = CrossVersion .scalaApiVersion(scalaVersion)
45
56
val opts = ListBuffer ( // format: off
46
57
" -encoding" , " UTF-8" , // format: on
47
58
" -deprecation" ,
48
59
" -feature" ,
49
- " -Xfatal-warnings" ,
50
60
)
51
61
if ((major, minor) == (2 , 11 )) opts += " -Ybackend:GenBCode"
52
62
if (major == 2 && minor < 13 ) opts += " -target:jvm-1.8"
0 commit comments