-
Notifications
You must be signed in to change notification settings - Fork 127
/
Makefile.toml
executable file
·103 lines (85 loc) · 2.73 KB
/
Makefile.toml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
[config]
additional_profiles = [
"all-default-tasks",
"multi-phase-tests",
"ci-coverage-tasks",
"ci-static-code-analysis-tasks",
"ci-all-build-tasks",
"publish-pre-cleanup",
]
[env]
CARGO_MAKE_SKIP_SLOW_SECONDARY_FLOWS = true
CARGO_MAKE_ADDITIONAL_BINARY_EXECUTABLE_NAME = "makers"
CARGO_MAKE_TEST_COVERAGE_BINARY_FILTER = "cli-[a-z0-9]*$\\|makers-[a-z0-9]*$\\|${CARGO_MAKE_TEST_COVERAGE_DEFAULT_BINARY_FILTER}"
CARGO_MAKE_TEMP_UNSTABLE_KEY = "${CARGO_MAKE_RUST_TARGET_OS}-${CARGO_MAKE_RUST_CHANNEL}-${CARGO_MAKE_CI}"
CARGO_MAKE_TEMP_UNSTABLE_TEST_ENV = { source = "${CARGO_MAKE_TEMP_UNSTABLE_KEY}", default_value = "false", mapping = { "none" = "true" } }
[tasks.post-print-env]
category = "Tools"
script = '''
#!@duckscript
echo "*************************************"
echo "Extended Info:"
echo " Unstable Environment Key: ${CARGO_MAKE_TEMP_UNSTABLE_KEY}"
echo " Unstable Test Environment: ${CARGO_MAKE_TEMP_UNSTABLE_TEST_ENV}"
echo "*************************************"
'''
[tasks.test-multi-phases-cleanup]
script = '''
#!@duckscript
fn <scope> delete_all
files = set ${1}
for file in ${files}
echo Deleting lock file: ${file}
rm ${file}
end
release ${files}
end
handle = glob_array ./src/**/Cargo.lock
delete_all ${handle}
handle = glob_array ./examples/**/Cargo.lock
delete_all ${handle}
'''
[tasks.test-multi-phases-flow]
condition = { env_false = ["CARGO_MAKE_TEMP_UNSTABLE_TEST_ENV"] }
[tasks.audit]
ignore_errors = true
[tasks.generate-readme]
script = '''
#!@duckscript
echo Generating README
rm ./README.md
# concat templates
readme_text = readfile ./docs/_includes/README.md
text = readfile ./docs/_includes/nav.md
readme_text = set "${readme_text}${text}"
text = readfile ./docs/_includes/content.md
readme_text = set "${readme_text}${text}"
# modify templates
crate_version = get_env CARGO_MAKE_CRATE_VERSION
readme_text = replace ${readme_text} https://github.com/sagiegurari/cargo-make/blob/master/.github .github
readme_text = replace ${readme_text} "{{ site.version }}" ${crate_version}
writefile ./README.md ${readme_text}
'''
[tasks.generate-task-list]
command = "cargo"
args = [
"run",
"--bin",
"cargo-make",
"--",
"make",
"--list-all-steps",
"--output-format",
"markdown-single-page",
"--output-file",
"${CARGO_MAKE_WORKING_DIRECTORY}/docs/cargo_make_task_list.md",
"--makefile",
"${CARGO_MAKE_WORKING_DIRECTORY}/src/lib/test/makefiles/empty.toml",
]
[tasks.generate-docs]
condition = { env_false = ["CARGO_MAKE_CI"], platforms = ["linux"] }
run_task = { name = ["generate-readme", "generate-task-list"] }
[tasks.post-docs]
linux_alias = "generate-docs"
[tasks.pre-build-file-increment]
env = { CARGO_MAKE_BUILD_NUMBER_FILE = "${CARGO_MAKE_WORKING_DIRECTORY}/.buildnumber" }