env_files = [ { path = "./profile.env", profile = "development" }, { path = "./test.env" }, { path = "./load_only_undefined.env", defaults_only = true }, ] env_scripts = [''' #!@duckscript echo first env script... composite_env_value = get_env COMPOSITE echo COMPOSITE = ${composite_env_value} set_env COMPOSITE_2 ${composite_env_value} ''', ''' #!@duckscript echo second env script... composite_env_value = get_env COMPOSITE_2 echo COMPOSITE_2 = ${composite_env_value} '''] [config] skip_core_tasks = true [env] SIMPLE = "SIMPLE VALUE" SCRIPT = { script = ["echo SCRIPT VALUE"] } COMPOSITE = "simple value: ${SIMPLE} script value: ${SCRIPT}" ECHO_CMD = "echo" MULTI_LINE_SCRIPT = { script = ["echo 1\necho 2"], multi_line = true } CONDITIONAL_SCRIPT = { script = [ "echo conditional_script", ], condition = { env_not_set = [ "CONDITIONAL_SCRIPT", ] } } BOOL_VALUE = true LIBRARY_EXTENSION = { source = "${CARGO_MAKE_RUST_TARGET_OS}", default_value = "unknown", mapping = { "linux" = "so", "macos" = "dylib", "windows" = "dll", "openbsd" = "so" } } TO_UNSET = { unset = true } PREFER_EXISTING = "original" OVERWRITE_EXISTING = "original" ENV_FROM_LIST = [ "ARG1", "${SIMPLE}", "simple value: ${SIMPLE} script value: ${SCRIPT}", ] CONDITIONED_VALUE = { value = "${SIMPLE}", condition = { env_set = [ "SIMPLE", ] } } IF_UNDEFINED = { value = "defined_in_makefile", condition = { env_not_set = [ "IF_UNDEFINED", ] } } COMPOSITE_OF_MAPPED = "VALUE: ${IF_UNDEFINED}" PATH_GLOB = { glob = "./src/**/mod.rs", include_files = true, include_dirs = false, ignore_type = "git" } CURRENT_DATE = { script = ["date"] } COMPOSITE_MISSING = "value->${NOT_FOUND}<-value" [env.override-test] PREFER_EXISTING = { value = "new", condition = { env_not_set = [ "PREFER_EXISTING", ] } } OVERWRITE_EXISTING = { value = "new", condition = { env_set = [ "OVERWRITE_EXISTING", ] } } [tasks.init] script_runner = "@duckscript" script = ''' value = get_env SIMPLE echo The original value is:\n${value} set_env SIMPLE "The value: ${value} is modified." value = get_env SIMPLE echo The new value is:\n${value} ''' [tasks.echo] script = ''' echo var: ${SKIP_TASK} echo hello echo git branch: ${CARGO_MAKE_GIT_BRANCH} ''' [tasks.wrapper] condition = { env_not_set = ["SKIP_TASK"] } run_task = "echo" [tasks.test-flow] env = { "SKIP_TASK" = true } run_task = "wrapper" [tasks.echo-env] script_runner = "@shell" script = ''' echo SIMPLE: ${SIMPLE} echo SCRIPT: ${SCRIPT} echo BOOL_VALUE: ${BOOL_VALUE} echo COMPOSITE: ${COMPOSITE} echo LIBRARY_EXTENSION: ${LIBRARY_EXTENSION} echo PROFILE_ENV_VALUE: ${PROFILE_ENV_VALUE} echo ENV_FROM_LIST: ${ENV_FROM_LIST} echo CONDITIONED_VALUE: ${CONDITIONED_VALUE} echo CONDITIONAL_SCRIPT: ${CONDITIONAL_SCRIPT} echo ENV1_TEST: ${ENV1_TEST} echo new_env: ${new_env} echo CURRENT_DATE: ${CURRENT_DATE} echo COMPOSITE_MISSING: ${COMPOSITE_MISSING} ''' [tasks.is_linux] env = { "IS_LINUX" = "NOPE" } script = "echo IS_LINUX: ${IS_LINUX}" [tasks.is_linux.linux] env = { "IS_LINUX" = "YAP" } [tasks.expand] command = "${ECHO_CMD}" args = ["VALUE: ${SIMPLE}"] [tasks.multi-line] script = ''' echo multi line output: echo ${MULTI_LINE_SCRIPT} ''' [tasks.namespace-prefix] env = { "CARGO_MAKE_MEMBER_TASK" = "${CARGO_MAKE_CORE_TASK_NAMESPACE_PREFIX}my-task" } script = "echo ${CARGO_MAKE_MEMBER_TASK}" [tasks.conditional] script = ''' echo PREFER_EXISTING: ${PREFER_EXISTING} echo OVERWRITE_EXISTING: ${OVERWRITE_EXISTING} ''' [tasks.if-undefined-print] script = ''' echo IF_UNDEFINED: ${IF_UNDEFINED} echo COMPOSITE_OF_MAPPED: ${COMPOSITE_OF_MAPPED} ''' [tasks.if-undefined-fork] env = { IF_UNDEFINED = "defined_from_fork" } run_task = { name = "if-undefined-print", fork = true } [tasks.if-undefined-cli] command = "cargo" args = [ "make", "--makefile", "env.toml", "--env", "IF_UNDEFINED=defined_from_cli", "if-undefined-print", ] [tasks.glob] command = "echo" args = ["@@split(PATH_GLOB,;)"]