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
9
crates/burrow-core/Cargo.toml
Normal file
9
crates/burrow-core/Cargo.toml
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
[package]
|
||||
name = "burrow-core"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Cross-platform Burrow protocol and application core."
|
||||
license = "GPL-3.0-or-later"
|
||||
|
||||
[lib]
|
||||
crate-type = ["lib", "staticlib"]
|
||||
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/"));
|
||||
}
|
||||
}
|
||||
13
crates/burrow-mobile-ffi/Cargo.toml
Normal file
13
crates/burrow-mobile-ffi/Cargo.toml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
[package]
|
||||
name = "burrow-mobile-ffi"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Mobile FFI boundary for the Burrow Rust core."
|
||||
license = "GPL-3.0-or-later"
|
||||
|
||||
[lib]
|
||||
crate-type = ["cdylib", "staticlib"]
|
||||
|
||||
[dependencies]
|
||||
burrow-core = { path = "../burrow-core" }
|
||||
jni = "0.21"
|
||||
27
crates/burrow-mobile-ffi/src/lib.rs
Normal file
27
crates/burrow-mobile-ffi/src/lib.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
#![deny(missing_debug_implementations)]
|
||||
|
||||
use std::ffi::c_char;
|
||||
|
||||
use jni::objects::JClass;
|
||||
use jni::sys::jstring;
|
||||
use jni::JNIEnv;
|
||||
|
||||
static CORE_VERSION: &[u8] = concat!(env!("CARGO_PKG_VERSION"), "\0").as_bytes();
|
||||
|
||||
/// C ABI entrypoint for platform shells that do not use JNI.
|
||||
#[no_mangle]
|
||||
pub extern "C" fn burrow_core_version() -> *const c_char {
|
||||
CORE_VERSION.as_ptr().cast()
|
||||
}
|
||||
|
||||
/// JNI entrypoint used by the Android Kotlin stub.
|
||||
#[no_mangle]
|
||||
pub extern "system" fn Java_net_burrow_android_BurrowCore_version(
|
||||
env: JNIEnv<'_>,
|
||||
_class: JClass<'_>,
|
||||
) -> jstring {
|
||||
match env.new_string(burrow_core::identity()) {
|
||||
Ok(value) => value.into_raw(),
|
||||
Err(_) => std::ptr::null_mut(),
|
||||
}
|
||||
}
|
||||
10
crates/burrow-windows-stub/Cargo.toml
Normal file
10
crates/burrow-windows-stub/Cargo.toml
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
[package]
|
||||
name = "burrow-windows-stub"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
description = "Windows release placeholder for Burrow"
|
||||
license = "GPL-3.0-or-later"
|
||||
|
||||
[[bin]]
|
||||
name = "burrow"
|
||||
path = "src/main.rs"
|
||||
8
crates/burrow-windows-stub/src/main.rs
Normal file
8
crates/burrow-windows-stub/src/main.rs
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
use std::process::ExitCode;
|
||||
|
||||
fn main() -> ExitCode {
|
||||
println!("Burrow for Windows is not ready yet.");
|
||||
println!("This release stub exists so the Windows lane can exercise signing, packaging, and upload plumbing before the native client lands.");
|
||||
println!("Install a Linux or Apple build for a functional Burrow client today.");
|
||||
ExitCode::from(64)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue