scala.tools.nsc

ScriptRunner

class ScriptRunner extends HasCompileSocket

An object that runs Scala code in script files.

For example, here is a complete Scala script on Unix:

   #!/bin/sh
   exec scala "$0" "[email protected]"
   !#
   Console.println("Hello, world!")
   argv.toList foreach Console.println

And here is a batch file example on Windows XP:

   ::#!
   @echo off
   call scala %0 %*
   goto :eof
   ::!#
   Console.println("Hello, world!")
   argv.toList foreach Console.println

Source
ScriptRunner.scala
Version

1.0, 15/05/2006

Linear Supertypes
HasCompileSocket, AnyRef, Any
Known Subclasses
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. Hide All
  2. Show all
  1. ScriptRunner
  2. HasCompileSocket
  3. AnyRef
  4. Any
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ScriptRunner ()

Value Members

  1. def != (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  2. def != (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  3. def ## (): Int

    Attributes
    final
    Definition Classes
    AnyRef → Any
  4. def == (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  5. def == (arg0: Any): Boolean

    Attributes
    final
    Definition Classes
    Any
  6. def asInstanceOf [T0] : T0

    Attributes
    final
    Definition Classes
    Any
  7. def clone (): AnyRef

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  8. def compileOnServer (sock: Socket, args: Seq[String]): Boolean

    Definition Classes
    HasCompileSocket
  9. lazy val compileSocket : scala.tools.nsc.CompileSocket.type

    Definition Classes
    ScriptRunnerHasCompileSocket
  10. val defaultScriptMain : String

    Default name to use for the wrapped script

  11. def eq (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  12. def equals (arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  13. val errorMarkers : Set[String]

    Definition Classes
    HasCompileSocket
  14. def finalize (): Unit

    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws()
  15. def getClass (): java.lang.Class[_]

    Attributes
    final
    Definition Classes
    AnyRef → Any
  16. def hashCode (): Int

    Definition Classes
    AnyRef → Any
  17. def isErrorMessage (msg: String): Boolean

    Definition Classes
    HasCompileSocket
  18. def isInstanceOf [T0] : Boolean

    Attributes
    final
    Definition Classes
    Any
  19. def isScript (settings: Settings): Boolean

  20. def ne (arg0: AnyRef): Boolean

    Attributes
    final
    Definition Classes
    AnyRef
  21. def newGlobal (settings: Settings, reporter: Reporter): Global

    Attributes
    protected
  22. def notify (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  23. def notifyAll (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
  24. def runCommand (settings: GenericRunnerSettings, command: String, scriptArgs: List[String]): Boolean

    Run a command

    Run a command

    returns

    true if compilation and execution succeeded, false otherwise.

  25. def runScript (settings: GenericRunnerSettings, scriptFile: String, scriptArgs: List[String]): Boolean

    Run a script file with the specified arguments and compilation settings.

    Run a script file with the specified arguments and compilation settings.

    returns

    true if compilation and execution succeeded, false otherwise.

  26. def runScriptAndCatch (settings: GenericRunnerSettings, scriptFile: String, scriptArgs: List[String]): Either[Throwable, Boolean]

    Calls runScript and catches the enumerated exceptions, routing them to Left(ex) if thrown.

  27. def scriptMain (settings: Settings): String

    Pick a main object name from the specified settings

  28. def synchronized [T0] (arg0: ⇒ T0): T0

    Attributes
    final
    Definition Classes
    AnyRef
  29. def toString (): String

    Definition Classes
    AnyRef → Any
  30. def wait (): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  31. def wait (arg0: Long, arg1: Int): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()
  32. def wait (arg0: Long): Unit

    Attributes
    final
    Definition Classes
    AnyRef
    Annotations
    @throws()

Inherited from HasCompileSocket

Inherited from AnyRef

Inherited from Any