Reduce unnecessary rebuilds
- Only embed commit on release builds. - Add CI and scripts to excluded cargo files. Signed-off-by: Evan Lloyd New-Schmidt <evan@new-schmidt.com>
This commit is contained in:
parent
33174511dd
commit
c3162c9fed
3 changed files with 10 additions and 3 deletions
|
@ -6,6 +6,7 @@ edition = "2021"
|
|||
repository = "https://github.com/organicmaps/wikiparser/"
|
||||
default-run = "om-wikiparser"
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
exclude = ["*.sh", "/.github/"]
|
||||
|
||||
[dependencies]
|
||||
anyhow = { version = "1.0.71", features = ["backtrace"] }
|
||||
|
|
10
build.rs
10
build.rs
|
@ -1,4 +1,4 @@
|
|||
use std::process::Command;
|
||||
use std::{env, process::Command};
|
||||
|
||||
/// Pass git-describe through CARGO_GIT_VERSION env variable
|
||||
///
|
||||
|
@ -28,5 +28,11 @@ fn set_version_from_git() {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
set_version_from_git();
|
||||
// Only embed on release builds.
|
||||
if env::var("PROFILE")
|
||||
.map(|p| p == "release")
|
||||
.unwrap_or_default()
|
||||
{
|
||||
set_version_from_git();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -159,7 +159,7 @@ fn get_thread_count(requested: Option<isize>) -> anyhow::Result<NonZeroUsize> {
|
|||
/// - `v2.0` if a git tag
|
||||
/// - the commit hash `034ac04` if not a tag
|
||||
/// - `034ac04-dirty` if uncommited changes are present,
|
||||
/// or the crate version if not available (if installed from crates.io).
|
||||
/// or the crate version if not available (debug build or installed from crates.io).
|
||||
///
|
||||
/// See `build.rs` file for more info.
|
||||
fn version() -> &'static str {
|
||||
|
|
Loading…
Add table
Reference in a new issue