Imports
Basic Import
Section titled “Basic Import”Import all recipes from another file:
@import "scripts/docker.jake"This makes all recipes from docker.jake available.
Namespaced Import
Section titled “Namespaced Import”Import with a prefix to avoid name collisions:
@import "scripts/deploy.jake" as deployAccess recipes as deploy.production, deploy.staging, etc.
Example
Section titled “Example”scripts/docker.jake:
task build: docker build -t myapp .
task push: docker push myappJakefile:
@import "scripts/docker.jake" as docker
task release: [build, docker.build, docker.push] echo "Released!"Project Organization
Section titled “Project Organization”project/├── Jakefile└── jake/ ├── docker.jake ├── deploy.jake └── test.jake# Jakefile@import "jake/docker.jake" as docker@import "jake/deploy.jake" as deploy@import "jake/test.jake" as test
@defaulttask all: [docker.build, test.unit, deploy.staging] echo "Done!"Import Resolution
Section titled “Import Resolution”- Paths are relative to the importing file
- Variables from imports are not shared (scoped)
- Recipes from imports can be used as dependencies