0

I have the following code:

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)
}

I want to add deprecation, feature warnings and explicitly turn on implicit conversions and macros.

Rich Oliver
  • 6,001
  • 4
  • 34
  • 57
  • 1
    You might find some inspiration in tests (https://github.com/scala/scala/blob/2.12.x/test/files/run/delambdafy_uncurry_method.scala). DirectTest is defined here: https://github.com/scala/scala-partest/blob/master/src/main/scala/scala/tools/partest/DirectTest.scala – Lukas Rytz Jun 05 '14 at 13:42

1 Answers1

0

Using Lukas Rytz's comment (thanks) this seems to work:

settings.processArgumentString(
  "-feature -language implicitConversions  experimental.macros")
Rich Oliver
  • 6,001
  • 4
  • 34
  • 57