mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
maint/build ~ add cargo make
build-examples targets
This commit is contained in:
parent
bcdff338fb
commit
e759e852a9
1 changed files with 35 additions and 7 deletions
|
@ -69,15 +69,23 @@ if eq "${CARGO_MAKE_RUST_TARGET_OS}" "windows"
|
||||||
show_utils = set "util/show-utils.BAT"
|
show_utils = set "util/show-utils.BAT"
|
||||||
end_if
|
end_if
|
||||||
set_env CARGO_MAKE_VAR_SHOW_UTILS "${show_utils}"
|
set_env CARGO_MAKE_VAR_SHOW_UTILS "${show_utils}"
|
||||||
# rebuild TASK_ARGS for "--features" and package-build compatibility (using "," instead of ";")
|
# rebuild CARGO_MAKE_TASK_ARGS for various targets
|
||||||
args = set ${CARGO_MAKE_TASK_ARGS}
|
args = set ${CARGO_MAKE_TASK_ARGS}
|
||||||
args = replace ${args} ";" ","
|
# * rebuild for 'features' target
|
||||||
set_env CARGO_MAKE_TASK_BUILD_FEATURES_ARGS "${args}"
|
args_features = replace ${args} ";" ","
|
||||||
args = replace ${args} "," " -p"
|
set_env CARGO_MAKE_TASK_BUILD_FEATURES_ARGS "${args_features}"
|
||||||
if not is_empty "${args}"
|
# * rebuild for 'examples' target
|
||||||
args = set "-p${args}"
|
args_examples = replace ${args} ";" " --example "
|
||||||
|
if is_empty "${args_examples}"
|
||||||
|
args_examples = set "--examples"
|
||||||
end_if
|
end_if
|
||||||
set_env CARGO_MAKE_TASK_BUILD_UTILS_ARGS "${args}"
|
set_env CARGO_MAKE_TASK_BUILD_EXAMPLES_ARGS "${args_examples}"
|
||||||
|
# * rebuild for 'utils' target
|
||||||
|
args_utils = replace ${args} ";" " -p"
|
||||||
|
if not is_empty "${args_utils}"
|
||||||
|
args_utils = set "-p${args_utils}"
|
||||||
|
end_if
|
||||||
|
set_env CARGO_MAKE_TASK_BUILD_UTILS_ARGS "${args_utils}"
|
||||||
'''
|
'''
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -109,6 +117,15 @@ dependencies = [
|
||||||
"action-build-debug",
|
"action-build-debug",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[tasks.build-examples]
|
||||||
|
description = "## Build (release-mode) project example(s); usage: `cargo make (build-examples | examples | example) [EXAMPLE]...`"
|
||||||
|
category = "[project]"
|
||||||
|
dependencies = [
|
||||||
|
"core::pre-build",
|
||||||
|
"action-build-examples",
|
||||||
|
"core::post-build",
|
||||||
|
]
|
||||||
|
|
||||||
[tasks.build-features]
|
[tasks.build-features]
|
||||||
description = "## Build (with features; release-mode) project; usage: `cargo make (build-features | features) FEATURE...`"
|
description = "## Build (with features; release-mode) project; usage: `cargo make (build-features | features) FEATURE...`"
|
||||||
category = "[project]"
|
category = "[project]"
|
||||||
|
@ -121,6 +138,12 @@ dependencies = [
|
||||||
[tasks.debug]
|
[tasks.debug]
|
||||||
alias = "build-debug"
|
alias = "build-debug"
|
||||||
|
|
||||||
|
[tasks.example]
|
||||||
|
alias = "build-examples"
|
||||||
|
|
||||||
|
[tasks.examples]
|
||||||
|
alias = "build-examples"
|
||||||
|
|
||||||
[tasks.features]
|
[tasks.features]
|
||||||
alias = "build-features"
|
alias = "build-features"
|
||||||
|
|
||||||
|
@ -212,6 +235,11 @@ description = "`cargo build`"
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
args = ["build", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" ]
|
args = ["build", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )" ]
|
||||||
|
|
||||||
|
[tasks.action-build-examples]
|
||||||
|
description = "`cargo build (--examples|(--example EXAMPLE)...)`"
|
||||||
|
command = "cargo"
|
||||||
|
args = ["build", "--release", "@@split(CARGO_MAKE_CARGO_BUILD_TEST_FLAGS, )", "${CARGO_MAKE_TASK_BUILD_EXAMPLES_ARGS}" ]
|
||||||
|
|
||||||
[tasks.action-build-features]
|
[tasks.action-build-features]
|
||||||
description = "`cargo build --release --features FEATURES`"
|
description = "`cargo build --release --features FEATURES`"
|
||||||
command = "cargo"
|
command = "cargo"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue