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
27 lines
715 B
Rust
27 lines
715 B
Rust
#![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(),
|
|
}
|
|
}
|