StateOps

sbt.StateOps
trait StateOps

Convenience methods for State transformations and operations.

Attributes

Graph
Supertypes
class Any
Known subtypes
class StateOpsImpl

Members list

Value members

Abstract methods

def +(newCommand: Command): State

Registers newCommand as an available command.

Registers newCommand as an available command.

Attributes

def ++(newCommands: Seq[Command]): State

Registers newCommands as available commands.

Registers newCommands as available commands.

Attributes

def ++:(newCommands: List[Exec]): State

Schedules commands to be run before any remaining commands.

Schedules commands to be run before any remaining commands.

Attributes

def +:(command: Exec): State

Schedules command to be run before any remaining commands.

Schedules command to be run before any remaining commands.

Attributes

def ::(command: String): State

Schedules command to be run before any remaining commands.

Schedules command to be run before any remaining commands.

Attributes

def :::(newCommands: List[String]): State

Schedules commands to be run before any remaining commands.

Schedules commands to be run before any remaining commands.

Attributes

def addExitHook(f: => Unit): State

Registers a new exit hook, which will run when sbt exits or restarts.

Registers a new exit hook, which will run when sbt exits or restarts.

Attributes

def baseDir: File

The application base directory, which is not necessarily the current working directory.

The application base directory, which is not necessarily the current working directory.

Attributes

def classLoaderCache: ClassLoaderCache

Get the class loader cache for the application.

Get the class loader cache for the application.

Attributes

Sets the next command processing action to be to rotate the global log and continue executing commands.

Sets the next command processing action to be to rotate the global log and continue executing commands.

Attributes

Sets the next command processing action to be to continue processing the next command.

Sets the next command processing action to be to continue processing the next command.

Attributes

def exit(ok: Boolean): State

Sets the next command processing action to be to exit with a zero exit code if ok is true and a nonzero exit code if ok if false.

Sets the next command processing action to be to exit with a zero exit code if ok is true and a nonzero exit code if ok if false.

Attributes

def fail: State

Marks the currently executing command as failing. This triggers failure handling by the command processor. See also State.onFailure

Marks the currently executing command as failing. This triggers failure handling by the command processor. See also State.onFailure

Attributes

def get[T](key: AttributeKey[T]): Option[T]

Gets the value associated with key from the custom attributes map.

Gets the value associated with key from the custom attributes map.

Attributes

def handleError(t: Throwable): State

Marks the currently executing command as failing due to the given exception. This displays the error appropriately and triggers failure handling by the command processor. Note that this does not throw an exception and returns normally. It is only once control is returned to the command processor that failure handling at the command level occurs.

Marks the currently executing command as failing due to the given exception. This displays the error appropriately and triggers failure handling by the command processor. Note that this does not throw an exception and returns normally. It is only once control is returned to the command processor that failure handling at the command level occurs.

Attributes

def has(key: AttributeKey[_]): Boolean

Returns true if key exists in the custom attributes map, false if it does not exist.

Returns true if key exists in the custom attributes map, false if it does not exist.

Attributes

Create and register a class loader cache. This should be called once at the application entry-point.

Create and register a class loader cache. This should be called once at the application entry-point.

Attributes

def interactive: Boolean

An advisory flag that is true if this application will execute commands based on user input.

An advisory flag that is true if this application will execute commands based on user input.

Attributes

Sets the next command processing action to be to keep the previous log and continue executing commands.

Sets the next command processing action to be to keep the previous log and continue executing commands.

Attributes

def locked[T](file: File)(t: => T): T

Evaluates the provided expression with a JVM-wide and machine-wide lock on file.

Evaluates the provided expression with a JVM-wide and machine-wide lock on file.

Attributes

def log: Logger

The Logger used for general command logging.

The Logger used for general command logging.

Attributes

def process(f: (Exec, State) => State): State
def put[T](key: AttributeKey[T], value: T): State

Sets the value associated with key in the custom attributes map.

Sets the value associated with key in the custom attributes map.

Attributes

def reboot(full: Boolean): State

Reboots sbt. A reboot restarts execution from the entry point of the launcher. A reboot is designed to be as close as possible to actually restarting the JVM without actually doing so. Because the JVM is not restarted, JVM exit hooks are not run. State.exitHooks should be used instead and those will be run before rebooting. If full is true, the boot directory is deleted before starting again. This command is currently implemented to not return, but may be implemented in the future to only reboot at the next command processing step.

Reboots sbt. A reboot restarts execution from the entry point of the launcher. A reboot is designed to be as close as possible to actually restarting the JVM without actually doing so. Because the JVM is not restarted, JVM exit hooks are not run. State.exitHooks should be used instead and those will be run before rebooting. If full is true, the boot directory is deleted before starting again. This command is currently implemented to not return, but may be implemented in the future to only reboot at the next command processing step.

Attributes

def reload: State

Restarts sbt without dropping loaded Scala classes. It is a shallower restart than reboot. This method takes a snapshot of the remaining commands and will resume executing those commands after reload. This means that any commands added to this State will be dropped.

Restarts sbt without dropping loaded Scala classes. It is a shallower restart than reboot. This method takes a snapshot of the remaining commands and will resume executing those commands after reload. This means that any commands added to this State will be dropped.

Attributes

def remove(key: AttributeKey[_]): State

Removes the key and any associated value from the custom attributes map.

Removes the key and any associated value from the custom attributes map.

Attributes

Runs any defined exitHooks and then clears them.

Runs any defined exitHooks and then clears them.

Attributes

def setInteractive(flag: Boolean): State

Changes the advisory interactive flag.

Changes the advisory interactive flag.

Attributes

def setNext(n: Next): State

Sets the next command processing action to do.

Sets the next command processing action to do.

Attributes

def update[T](key: AttributeKey[T])(f: Option[T] => T): State

Sets the value associated with key in the custom attributes map by transforming the current value.

Sets the value associated with key in the custom attributes map by transforming the current value.

Attributes