From a6bc2d3537fca6d84f07c37c6fb8e71a03662d47 Mon Sep 17 00:00:00 2001 From: Matthew de Detrich Date: Mon, 11 Sep 2023 10:58:52 +0200 Subject: [PATCH] Add inliner for Scala 2 --- build.sbt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/build.sbt b/build.sbt index 70ffc174..1ec74041 100644 --- a/build.sbt +++ b/build.sbt @@ -54,12 +54,22 @@ def commonSettings: Seq[Setting[_]] = Def.settings( resolvers += Resolver.sonatypeRepo("public"), scalacOptions := { val old = scalacOptions.value + val scala2InlineOptions = List( + "-opt-inline-from:", + "-opt:l:inline" + ) scalaVersion.value match { case sv if sv.startsWith("2.10") => old diff List("-Xfuture", "-Ywarn-unused", "-Ywarn-unused-import") case sv if sv.startsWith("2.11") => old ++ List("-Ywarn-unused", "-Ywarn-unused-import") case sv if sv.startsWith("2.12") => - old ++ List("-Ywarn-unused", "-Ywarn-unused-import", "-YdisableFlatCpCaching") + old ++ List( + "-Ywarn-unused", + "-Ywarn-unused-import", + "-YdisableFlatCpCaching" + ) ++ scala2InlineOptions + case sv if sv.startsWith("2.13") => + old ++ scala2InlineOptions case _ => old } },