Skip to content

Commit

Permalink
Split warnUnusedImport for scala 2 and 3
Browse files Browse the repository at this point in the history
  • Loading branch information
Philippus committed Nov 7, 2024
1 parent effe62e commit 2b9678b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,22 @@ lazy val commonScalaVersionSettings = Seq(
crossScalaVersions := Nil
)

lazy val warnUnusedImport = Seq(
lazy val warnUnusedImportScala2 = Seq(
scalacOptions += "-Ywarn-unused:imports",
Compile / console / scalacOptions ~= {
_.filterNot(Set("-Ywarn-unused-import", "-Ywarn-unused:imports"))
},
Test / console / scalacOptions := (Compile / console / scalacOptions).value,
)

lazy val warnUnusedImportScala3 = Seq(
scalacOptions += "-Wunused:imports",
Compile / console / scalacOptions ~= {
_.filterNot(Set("-Wunused:imports"))
},
Test / console / scalacOptions := (Compile / console / scalacOptions).value,
)

lazy val commonSettings = Seq(
organization := "nl.gn0s1s",
resolvers += Resolver.mavenLocal,
Expand Down Expand Up @@ -86,11 +94,10 @@ lazy val allSettings = commonScalaVersionSettings ++
commonSettings ++
commonDeps ++
pomSettings ++
warnUnusedImport ++
publishSettings

lazy val scala2Settings = allSettings :+ (crossScalaVersions := scala2Versions)
lazy val scala3Settings = allSettings :+ (crossScalaVersions := scalaAllVersions)
lazy val scala2Settings = allSettings ++ warnUnusedImportScala2 :+ (crossScalaVersions := scala2Versions)
lazy val scala3Settings = allSettings ++ warnUnusedImportScala3 :+ (crossScalaVersions := scalaAllVersions)

lazy val scala3Projects: Seq[ProjectReference] = Seq(
json_builder,
Expand Down

0 comments on commit 2b9678b

Please sign in to comment.