mirror of https://github.com/sbt/sbt.git
short-circuit the macro check in the incremental compiler if the source isn't a Scala source file
This commit is contained in:
parent
68443fc047
commit
6e30bd7842
|
|
@ -16,6 +16,8 @@ object APIUtil
|
|||
new Modifiers( x(0), x(1), x(2), x(3), x(4), x(5), x(6) )
|
||||
}
|
||||
|
||||
def isScalaSourceName(name: String): Boolean = name.endsWith(".scala")
|
||||
|
||||
def hasMacro(s: SourceAPI): Boolean =
|
||||
{
|
||||
val check = new HasMacro
|
||||
|
|
|
|||
|
|
@ -128,7 +128,7 @@ private final class AnalysisCallback(internalMap: File => Option[File], external
|
|||
|
||||
def api(sourceFile: File, source: SourceAPI) {
|
||||
import xsbt.api.{APIUtil, HashAPI}
|
||||
if (APIUtil.hasMacro(source)) macroSources += sourceFile
|
||||
if (APIUtil.isScalaSourceName(sourceFile.getName) && APIUtil.hasMacro(source)) macroSources += sourceFile
|
||||
val shouldMinimize = !Incremental.apiDebug(options)
|
||||
val savedSource = if (shouldMinimize) APIUtil.minimize(source) else source
|
||||
apis(sourceFile) = (HashAPI(source), savedSource)
|
||||
|
|
|
|||
Loading…
Reference in New Issue