From b10e8365cbbe0151f727eb4a19d6fd808f8b2bc9 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Mon, 11 Sep 2023 12:18:38 +0200 Subject: [PATCH] Add inliner for Scala 2 --- build.sbt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build.sbt b/build.sbt index 63a5eeeb..43916d13 100644 --- a/build.sbt +++ b/build.sbt @@ -48,6 +48,17 @@ def commonSettings: Seq[Setting[_]] = Seq( compile / javacOptions ++= Seq("-Xlint", "-Xlint:-serial"), crossScalaVersions := Seq(scala212, scala213, scala3), headerLicense := (ThisBuild / headerLicense).value, + scalacOptions ++= { + val scala2InlineOptions = List( + "-opt-inline-from:", + "-opt:l:inline" + ) + CrossVersion.partialVersion(scalaVersion.value) match { + case Some((2, n)) if n == 12 => scala2InlineOptions + case Some((2, n)) if n == 13 => scala2InlineOptions + case _ => Nil + } + } ) lazy val ioRoot = (project in file("."))