@@ -41,6 +41,11 @@ import scala.collection.mutable
4141class ExtractAPI extends Phase {
4242 override def phaseName : String = " sbt-api"
4343
44+ override def isRunnable (implicit ctx : Context ): Boolean = {
45+ def forceRun = ctx.settings.YdumpSbtInc .value || ctx.settings.YforceSbtPhases .value
46+ super .isRunnable && (ctx.sbtCallback != null || forceRun)
47+ }
48+
4449 // SuperAccessors need to be part of the API (see the scripted test
4550 // `trait-super` for an example where this matters), this is only the case
4651 // after `PostTyper` (unlike `ExtractDependencies`, the simplication to trees
@@ -50,9 +55,7 @@ class ExtractAPI extends Phase {
5055
5156 override def run (implicit ctx : Context ): Unit = {
5257 val unit = ctx.compilationUnit
53- val dumpInc = ctx.settings.YdumpSbtInc .value
54- val forceRun = dumpInc || ctx.settings.YforceSbtPhases .value
55- if ((ctx.sbtCallback != null || forceRun) && ! unit.isJava) {
58+ if (! unit.isJava) {
5659 val sourceFile = unit.source.file
5760 if (ctx.sbtCallback != null )
5861 ctx.sbtCallback.startSource(sourceFile.file)
@@ -61,7 +64,7 @@ class ExtractAPI extends Phase {
6164 val classes = apiTraverser.apiSource(unit.tpdTree)
6265 val mainClasses = apiTraverser.mainClasses
6366
64- if (dumpInc ) {
67+ if (ctx.settings. YdumpSbtInc .value ) {
6568 // Append to existing file that should have been created by ExtractDependencies
6669 val pw = new PrintWriter (File (sourceFile.jpath).changeExtension(" inc" ).toFile
6770 .bufferedWriter(append = true ), true )
0 commit comments