Values and Types¶
- ModuleID is the type of a dependency definition. See Library Management.
- Artifact represents a single artifact (such as a jar or a pom) to be built and published. See Library Management and Artifacts.
- A Resolver can resolve and retrieve dependencies. Many types of Resolvers can publish dependencies as well. A repository is a closely linked idea that typically refers to the actual location of the dependencies. However, sbt is not very consistent with this terminology and repository and resolver are occasionally used interchangeably.
- A [ModuleConfiguration] defines a specific resolver to use for a group of dependencies.
- A Configuration is a useful Ivy construct for grouping dependencies. See Configurations. It is also used for scoping settings.
- Compile, Test, Runtime, Provided, and Optional are predefined Configurations.
Settings and Tasks¶
- A Setting describes how to initialize a specific setting in the build. It can use the values of other settings or the previous value of the setting being initialized.
- A SettingsDefinition is the actual type of an expression in a build.sbt. This allows either a single Setting or a sequence of settings (SettingList) to be defined at once. The types in a .scala Build Definition always use just a plain Setting.
- Initialize describes how to initialize a setting using other settings, but isn't bound to a particular setting yet. Combined with an initialization method and a setting to initialize, it produces a full Setting.
- TaskKey, SettingKey, and InputKey are keys that represent a task or setting. These are not the actual tasks, but keys that are used to refer to them. They can be scoped to produce ScopedTask, ScopedSetting, and ScopedInput. These form the base types that provide the Settings methods.
- InputTask parses and tab completes user input, producing a task to run.
- Task is the type of a task. A task is an action that runs on demand. This is in contrast to a setting, which is run once at project initialization.
- Build is the trait implemented for a full definition, which defines project relationships and settings.
- Plugin is the trait implemented for sbt Using Plugins.
- Project is both a trait and a companion object that declares a single module in a build. See full definition.
- Keys is an object that provides all of the built-in keys for settings and tasks.
- State contains the full state for a build. It is mainly used by Commands and sometimes Input Tasks. See also State and actions.
Settings and Tasks¶
See the Getting Started Guide for details.
- :=, <<=, +=, ++=, ~=, <+=, <++= These construct a Setting, which is the fundamental type in the settings system.
- map This defines a task initialization that uses other tasks or settings. See more about settings. It is a common name used for many other types in Scala, such as collections.
- apply This defines a setting initialization using other settings. It is not typically written out. See more about settings. This is a common name in Scala.
- in specifies the Scope or part of the Scope of a setting being referenced. See scopes.
File and IO¶
- / When called on a single File, this is new File(x,y). For Seq[File], this is applied for each member of the sequence..
- * and ** are methods for selecting children (*) or descendants (**) of a File or Seq[File] that match a filter.
- |, ||, &&, &, -, and -- are methods for combining filters, which are often used for selecting Files. See NameFilter and FileFilter. Note that methods with these names also exist for other types, such as collections (like `Seq) and Parser (see Parsing and tab completion).
- x Used to construct mappings from a File to another File or to a String. See Mapping Files.
- get forces a PathFinder (a call-by-name data structure) to a strict Seq[File] representation. This is a common name in Scala, used by types like Option.
See Library Management for full documentation.
- % This is used to build up a ModuleID.
- %% This is similar to % except that it identifies a dependency that has been cross built.
- from Used to specify the fallback URL for a dependency
- classifier Used to specify the classifier for a dependency.
- at Used to define a Maven-style resolver.
- intransitive Marks a dependency or Configuration as being intransitive.
- hide Marks a Configuration as internal and not to be included in the published metadata.
These methods are used to build up Parsers from smaller Parsers. They closely follow the names of the standard library's parser combinators. See Parsing and tab completion for the full documentation. These are used for Input Tasks and Commands.
- ~, ~>, <~ Sequencing methods.
- ??, ? Methods for making a Parser optional. ? is postfix.
- id Used for turning a Char or String literal into a Parser. It is generally used to trigger an implicit conversion to a Parser.
- |, || Choice methods. These are common method names in Scala.
- ^^^ Produces a constant value when a Parser matches.
- +, * Postfix repetition methods. These are common method names in Scala.
- map, flatMap Transforms the result of a Parser. These are common method names in Scala.
- filter Restricts the inputs that a Parser matches on. This is a common method name in Scala.
- - Prefix negation. Only matches the input when the original parser doesn't match the input.
- examples, token Tab completion
- !!! Provides an error message to use when the original parser doesn't match the input.
These methods are used to fork external processes. Note that this API has been included in the Scala standard library for version 2.9. ProcessBuilder is the builder type and Process is the type representing the actual forked process. The methods to combine processes start with # so that they share the same precedence.
- run, !, !!, !<, lines, lines_! are different ways to start a process once it has been defined. The lines variants produce a Stream[String] to obtain the output lines.
- #<, #<<, #> are used to get input for a process from a source or send the output of a process to a sink.
- #| is used to pipe output from one process into the input of another.
- #||, #&&, ### sequence processes in different ways.