# This is a configuration file for the bacon tool
#
# Bacon repository: https://github.com/Canop/bacon
# Complete help on configuration: https://dystroy.org/bacon/config/
# You can also check bacon's own bacon.toml file
#  as an example: https://github.com/Canop/bacon/blob/main/bacon.toml

default_job = "clippy-all"

[jobs.check]
command = ["cargo", "check", "--color", "always"]
need_stdout = false
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs"]

[jobs.check-all]
command = ["cargo", "check", "--all-features", "--color", "always"]
need_stdout = false
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs"]

[jobs.clippy]
command = [
    "cargo", "clippy", "--workspace",
    "--color", "always",
]
need_stdout = false
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs"]

[jobs.clippy-all]
command = [
    "cargo", "clippy", "--workspace",
    "--all-features",
    "--color", "always",
]
need_stdout = false
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs"]

[jobs.test]
command = [
    "cargo", "test", "--color", "always", "--workspace",
    "--", "--color", "always",
]
need_stdout = true
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs", "test-files", "integration-tests"]

[jobs.test-all]
command = [
    "cargo", "test", "--all-features", "--color", "always", "--workspace",
    "--", "--color", "always"
]
need_stdout = true
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs", "test-files", "integration-tests"]

[jobs.doc]
command = ["cargo", "doc", "--color", "always", "--no-deps"]
need_stdout = false
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "Cargo.toml", "build.rs"]

# If the doc compiles, then it opens in your browser and bacon switches
# to the previous job
[jobs.doc-open]
command = ["cargo", "doc", "--color", "always", "--no-deps", "--open"]
need_stdout = false
on_success = "back" # so that we don't open the browser at each change

[jobs.install]
command = ["cargo", "install", "--path", ".", "--debug", "--locked", "--color", "always"]
need_stdout = false
allow_warnings = true
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "scripts", "Cargo.toml", "build.rs"]

[jobs.install-all]
command = ["cargo", "install", "--all-features", "--path", ".", "--debug", "--locked", "--color", "always"]
need_stdout = false
allow_warnings = true
default_watch = false
watch = ["src", "process", "recipe", "template", "utils", "scripts", "Cargo.toml", "build.rs"]

# You may define here keybindings that would be specific to
# a project, for example a shortcut to launch a specific job.
# Shortcuts to internal functions (scrolling, toggling, etc.)
# should go in your personal global prefs.toml file instead.
[keybindings]
# alt-m = "job:my-job"
c = "job:clippy"
shift-c = "job:clippy-all" # comment this to have 'c' run clippy on only the default target
i = "job:install"
shift-i = "job:install-all"
t = "job:test"
shift-t = "job:test-all"
