Wire Forge-native release infrastructure
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Waiting to run
Build Rust / Cargo Test (push) Successful in 4m14s
Build Site / Next.js Build (push) Failing after 6s
Infra: OpenTofu / OpenTofu (grafana) (push) Successful in 5s
Lint Governance / BEP Metadata (push) Successful in 0s
Build: Android / Android Rust Core Stub (push) Failing after 23s
Some checks failed
Cache: Publish Nix / Publish Nix Cache (push) Waiting to run
Build Rust / Cargo Test (push) Successful in 4m14s
Build Site / Next.js Build (push) Failing after 6s
Infra: OpenTofu / OpenTofu (grafana) (push) Successful in 5s
Lint Governance / BEP Metadata (push) Successful in 0s
Build: Android / Android Rust Core Stub (push) Failing after 23s
This commit is contained in:
parent
97c569fb35
commit
002bd382e9
199 changed files with 14268 additions and 185 deletions
61
crates/burrow-core/src/lib.rs
Normal file
61
crates/burrow-core/src/lib.rs
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
#![deny(missing_debug_implementations)]
|
||||
|
||||
/// Version of the Rust core linked into platform shells.
|
||||
pub fn version() -> &'static str {
|
||||
env!("CARGO_PKG_VERSION")
|
||||
}
|
||||
|
||||
/// Platform family reported by the current Rust target.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub enum PlatformFamily {
|
||||
Android,
|
||||
Apple,
|
||||
Linux,
|
||||
Windows,
|
||||
Other,
|
||||
}
|
||||
|
||||
impl PlatformFamily {
|
||||
pub fn current() -> Self {
|
||||
if cfg!(target_os = "android") {
|
||||
Self::Android
|
||||
} else if cfg!(target_vendor = "apple") {
|
||||
Self::Apple
|
||||
} else if cfg!(target_os = "linux") {
|
||||
Self::Linux
|
||||
} else if cfg!(target_os = "windows") {
|
||||
Self::Windows
|
||||
} else {
|
||||
Self::Other
|
||||
}
|
||||
}
|
||||
|
||||
pub fn as_str(self) -> &'static str {
|
||||
match self {
|
||||
Self::Android => "android",
|
||||
Self::Apple => "apple",
|
||||
Self::Linux => "linux",
|
||||
Self::Windows => "windows",
|
||||
Self::Other => "other",
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Human-readable core identity for stubs and smoke tests.
|
||||
pub fn identity() -> String {
|
||||
format!(
|
||||
"burrow-core/{} ({})",
|
||||
version(),
|
||||
PlatformFamily::current().as_str()
|
||||
)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn identity_includes_project_name() {
|
||||
assert!(identity().starts_with("burrow-core/"));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue