Misc
sbt
- Projects -> Configurations -> Tasks
- Projects are contained in a directory
project.in(file("core"))
file is same as java.io.File
- Configurations are like mini-projects with their own source directory and dependencies; for example,
Compile and Test
- Configurations can have dependencies between them. For example,
Test configuration depends on Compile configuration
- A special scope is
Zero, when Configuration is not specified
- Tasks perform actions, can accept parameters, and are always executed v/s Settings which are evaluated only once
- A special scope is
Zero, when Task is not specified
- Projects, Configuration and Tasks are scope axis
- Project and Configuration names start with uppercase and tasks with lowercase
- All three scopes above can have settings
- sbt is a DAG that evaluates tasks and settings
- Scope delegation order
- Task ->
Zero -> Configuration -> Configuration Dependencies -> Zero -> Project -> ThisBuild -> Zero
Global is same as specifying Zero, Zero, Zero for project, configuration and task
Keys
- Settings and Tasks have Keys
- Custom Keys can be added by plugins
- 3 types of Keys:
settingKey, taskKey and inputTaskKey
inputTaskKey are tasks that accept parameters, e.g. run takes main class name and other arguments