我有以下代码:
def compile(target: String, srcs: Seq[String]): Unit =
{
import scala.tools.nsc._
val settings = new Settings
settings.outputDirs.setSingleOutput(target)
val comp = new Global(settings)
val crun: comp.Run = new comp.Run
crun.compile(srcs.toList.flatMap(getFilesList))
}
def getFilesList(fName: String): List[String] =
{
val file = new java.io.File(fName)
if (file.isDirectory) file.listFiles.toList.flatMap(i => getFilesList(fName / i.getName))
else List(fName)
}
我想添加弃用、功能警告并显式打开隐式转换和宏。