All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.sciss.proc.impl.MacroCompilerImpl.scala Maven / Gradle / Ivy

The newest version!
/*
 *  MacroCompilerImpl.scala
 *  (SoundProcesses)
 *
 *  Copyright (c) 2010-2024 Hanns Holger Rutz. All rights reserved.
 *
 *	This software is published under the GNU Affero General Public License v3+
 *
 *
 *  For further information, please contact Hanns Holger Rutz at
 *  [email protected]
 */

package de.sciss.proc
package impl

import java.io.File

import scala.tools.nsc.interpreter.IMain
import scala.tools.nsc.{ConsoleWriter, Global, NewLinePrintWriter}

object MacroCompilerImpl {
  def apply(peer: Global): IMain = {
    // this is the trick to get the right class-path -- we steal it from the macro compiler
    val cSet       = peer.settings.copy()
    cSet.warnUnused.clear()
    cSet.classpath.value += File.pathSeparator + sys.props("java.class.path")
    val writer    = new NewLinePrintWriter(new ConsoleWriter, autoFlush = true)
    new IMain(cSet, writer)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy