macro_rules! additional_buildpack_binary_path {
($target_name:expr) => { ... };
}
Expand description
Resolves the path to an additional buildpack binary by Cargo target name.
This can be used to copy additional binaries to layers or use them for exec.d.
To add an additional binary to a buildpack, add a new file with a main function to bin/
.
Cargo will automatically configure it as a binary target
with the name of file.
Note: This only works properly if the buildpack is packaged with libcnb-cargo
/libcnb-test
.
ⓘ
use libcnb::additional_buildpack_binary_path;
std::fs::copy(
// This would not compile in this doctest since there is no `runtime_tool` binary target.
additional_buildpack_binary_path!("runtime_tool"),
layer_dir.join("runtime_tool"),
)
.unwrap();