Crate re_build_tools

Source
Expand description

This crate is to be used from build.rs build scripts.

Enums§

Environment
Where is this build.rs build script running?

Functions§

cargo_metadata
Returns info parsed from an invocation of the cargo metadata command.
compute_crate_hash
Given a crate name, computes the sha256 hash of its source code (ordered by filename) and returns an hexadecimal string for it.
compute_dir_filtered_hash
Given a directory path, computes the sha256 hash of the accumulated contents of all of its files (ordered by filename) except those failing a custom filter, and returns an hexadecimal string for it.
compute_dir_hash
Given a directory path, computes the sha256 hash of the accumulated contents of all of its files (ordered by filename), and returns an hexadecimal string for it.
compute_file_hash
Given a file path, computes the sha256 hash of its contents and returns an hexadecimal string for it.
compute_strings_hash
Given a bunch of strings, computes the sha256 hash of their contents (in the order they were passed in) and returns an hexadecimal string for it.
enabled_features_of
Returns a list of all the enabled features of the given package.
export_build_info_vars_for_crate
Call from the build.rs file of any crate you want to generate build info for.
get_and_track_env_var
Read the environment variable and trigger a rebuild whenever the environment variable changes.
git_branch
Get the current git branch name
git_commit_hash
Get the full commit hash
git_commit_short_hash
Get the first 7 characters of the commit hash
is_tracked_env_var_set
Read the environment variable and trigger a rebuild whenever the environment variable changes.
iter_dir
Recursively walks the directory at path in filename order.
read_versioning_hash
Reads back a versioning hash that was written with write_versioning_hash.
rebuild_if_crate_changed
Call from build.rs to trigger a rebuild whenever any source file of the given package or any of its dependencies changes, recursively.
rerun_if_changed
Call from build.rs to trigger a rebuild whenever the file at path changes.
rerun_if_changed_glob
Call from build.rs to trigger a rebuild whenever any of the files identified by the given globbed path change.
rerun_if_changed_or_doesnt_exist
Call from build.rs to trigger a rebuild whenever the file at path changes, or it doesn’t exist.
set_output_cargo_build_instructions
Change whether or not this library should output cargo build instructions
write_file_if_necessary
Writes content to a file iff it differs from what’s already there.
write_versioning_hash
Writes the given hash at the specified path.