Skip to content

Commit e4b0262

Browse files
authored
Merge pull request scala#38 from retronym/topic/inline-from
Only inline from current project sources under enableOptimizer
2 parents d9e512d + 7aee2b5 commit e4b0262

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/main/scala/ScalaModulePlugin.scala

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,11 @@ object ScalaModulePlugin extends AutoPlugin {
5151
}
5252
scalaVersions
5353
},
54-
54+
enableOptimizerInlineFrom := "<sources>",
5555
scalaVersion := crossScalaVersions.value.head
5656
)
5757

58+
val enableOptimizerInlineFrom = settingKey[String]("The value passed to -opt-inline-from by `enableOptimizer` on 2.13 and higher")
5859
/**
5960
* Enable `-opt:l:inline`, `-opt:l:classpath` or `-optimize`, depending on the scala version.
6061
*/
@@ -63,8 +64,8 @@ object ScalaModulePlugin extends AutoPlugin {
6364
val Ver("2", maj, min) = scalaVersion.value
6465
(maj.toInt, min.toInt) match {
6566
case (m, _) if m < 12 => Seq("-optimize")
66-
case (12, n) if n < 3 => Seq("-opt:l:classpath")
67-
case _ => Seq("-opt:l:inline", "-opt-inline-from:scala/**")
67+
case (12, n) if n < 3 => Seq("-opt:l:project")
68+
case _ => Seq("-opt:l:inline", "-opt-inline-from:" + enableOptimizerInlineFrom.value)
6869
}
6970
}
7071

0 commit comments

Comments
 (0)