forked from zzeneg/qmk-hid-host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile.toml
43 lines (33 loc) · 1.38 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
[env]
CARGO_MAKE_PROJECT_NAME = "qmk-hid-host"
CARGO_MAKE_OUTPUT_DIRECTORY_NAME = "dist"
[tasks.build-release-no-features]
env = {"CARGO_MAKE_CARGO_BUILD_TEST_FLAGS" = ""}
run_task = "build-release"
[tasks.build-release-with-silent]
env = {"CARGO_MAKE_CARGO_BUILD_TEST_FLAGS" = "--features silent"}
run_task = "build-release"
[tasks.dist-default]
env.CARGO_MAKE_OUTPUT_TYPE = ""
run_task = [{ name = ["build-release-no-features", "copy-dist"] }]
[tasks.dist-with-silent]
env.CARGO_MAKE_OUTPUT_TYPE = "silent"
run_task = [{ name = ["build-release-with-silent", "copy-dist"] }]
[tasks.dist]
run_task = "dist-default"
[tasks.dist.windows]
env = { "EXECUTABLE_EXTENSION" = ".exe" }
run_task = [{ name = ["dist-default", "dist-with-silent"] }]
[tasks.copy-dist]
env.TARGET_RELEASE_DIRECTORY = "target/release"
script = '''
#!@duckscript
executable_file = set ${CARGO_MAKE_PROJECT_NAME}${EXECUTABLE_EXTENSION}
output_executable_file = set ${CARGO_MAKE_PROJECT_NAME}${EXECUTABLE_EXTENSION}
if not is_empty ${CARGO_MAKE_OUTPUT_TYPE}
output_executable_file = set ${CARGO_MAKE_PROJECT_NAME}.${CARGO_MAKE_OUTPUT_TYPE}${EXECUTABLE_EXTENSION}
end
echo Copying executable ${executable_file} to ${CARGO_MAKE_OUTPUT_DIRECTORY_NAME}/${output_executable_file}...
mkdir ${CARGO_MAKE_OUTPUT_DIRECTORY_NAME}
cp ${TARGET_RELEASE_DIRECTORY}/${executable_file} ${CARGO_MAKE_OUTPUT_DIRECTORY_NAME}/${output_executable_file}
'''