Dependencies
Recipe Dependencies
Section titled “Recipe Dependencies”Run other recipes first using brackets:
task build: echo "Building..."
task test: [build] echo "Testing..."
task deploy: [build, test] echo "Deploying..."Running jake deploy executes: build → test → deploy
File Dependencies
Section titled “File Dependencies”For file recipes, list source files/patterns after the colon:
file dist/bundle.js: src/index.ts src/utils.ts esbuild src/index.ts --bundle --outfile=dist/bundle.jsGlob Patterns
Section titled “Glob Patterns”Use glob patterns for file dependencies:
file dist/app.js: src/**/*.ts esbuild src/index.ts --bundle --outfile=dist/app.jsSupported patterns:
*- Match any characters except/**- Match any characters including/(recursive)?- Match single character[abc]- Match character class[a-z]- Match character range
Dependency Chains
Section titled “Dependency Chains”File recipes automatically run recipes that produce their dependencies:
file dist/compiled.js: src/**/*.ts tsc --outFile dist/compiled.js
file dist/bundle.js: dist/compiled.js terser dist/compiled.js -o dist/bundle.js
task build: [dist/bundle.js] echo "Build complete!"Running jake build automatically runs compilation first.
Mixed Dependencies
Section titled “Mixed Dependencies”Combine recipe and file dependencies:
task setup: npm install
file dist/app.js: src/**/*.ts tsc --outDir dist
task build: [setup, dist/app.js] echo "Build complete!"Avoiding Cycles
Section titled “Avoiding Cycles”Jake detects cyclic dependencies:
# This will error!task a: [b] echo "A"
task b: [a] echo "B"error: Cyclic dependency detected in 'a'