From 83e80fce5498cb15a221744c90c2dcaccff199ec Mon Sep 17 00:00:00 2001 From: kenji yoshida <6b656e6a69@gmail.com> Date: Sun, 6 Oct 2024 09:42:17 +0900 Subject: [PATCH] update scalacOptions --- build.sbt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/build.sbt b/build.sbt index fb2bd3c..7594c7c 100644 --- a/build.sbt +++ b/build.sbt @@ -9,12 +9,19 @@ licenses := Seq("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0" publishMavenStyle := true scalacOptions ++= Seq("-deprecation", "-feature", "-language:implicitConversions") -val unusedWarnings = Seq("-Ywarn-unused:imports") +val unusedWarnings = Def.setting( + scalaBinaryVersion.value match { + case "2.12" => + Seq("-Ywarn-unused:imports") + case _ => + Seq("-Wunused:imports") + } +) -scalacOptions ++= unusedWarnings +scalacOptions ++= unusedWarnings.value Seq(Compile, Test).flatMap(c => - c / console / scalacOptions --= unusedWarnings + c / console / scalacOptions --= unusedWarnings.value ) def hash(): String = sys.process.Process("git rev-parse HEAD").lineStream_!.head