From 23ecb6e24889d8582b8fc7ef8f507d6ce1dc19cc Mon Sep 17 00:00:00 2001 From: Ondra Pelech Date: Fri, 2 Apr 2021 22:18:39 +0200 Subject: [PATCH] Add -Ywarn-macros:after only for Scala >= 2.12 (#118) --- .../sideeffffect/sbtdecentscala/DecentScalaPlugin.scala | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/scala/com/github/sideeffffect/sbtdecentscala/DecentScalaPlugin.scala b/src/main/scala/com/github/sideeffffect/sbtdecentscala/DecentScalaPlugin.scala index d544ad9..cd9e723 100644 --- a/src/main/scala/com/github/sideeffffect/sbtdecentscala/DecentScalaPlugin.scala +++ b/src/main/scala/com/github/sideeffffect/sbtdecentscala/DecentScalaPlugin.scala @@ -50,8 +50,10 @@ object DecentScalaPlugin extends AutoPlugin { ), scalacOptions ++= List( "-P:silencer:checkUnused", - "-Ywarn-macros:after", - ), + ) ++ (CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, 11)) => List() + case _ => List("-Ywarn-macros:after") + }), scalacOptions --= { if (!sys.env.contains("CI")) List("-Xfatal-warnings") // to enable Scalafix