feat(xatu): scaffold project

Add the Xatu Rust package as a minimal hello-world skeleton with Cargo workspace metadata and Bazel library, binary, and test targets.
This commit is contained in:
2026-09-17 00:23:39 -04:00
parent f98af6ad3f
commit ca83390323
7 changed files with 62 additions and 19 deletions

20
src/xatu/BUILD Normal file
View File

@@ -0,0 +1,20 @@
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")
rust_library(
name = "xatu_lib",
crate_name = "xatu",
srcs = ["lib.rs"],
)
rust_binary(
name = "xatu",
crate_name = "xatu_cli",
srcs = ["main.rs"],
deps = [":xatu_lib"],
)
rust_test(
name = "lib_test",
srcs = ["lib_test.rs"],
deps = [":xatu_lib"],
)

13
src/xatu/Cargo.toml Normal file
View File

@@ -0,0 +1,13 @@
[package]
name = "xatu"
version = "0.1.0"
edition = "2024"
[lib]
path = "lib.rs"
[[bin]]
name = "xatu"
path = "main.rs"
[dependencies]

5
src/xatu/lib.rs Normal file
View File

@@ -0,0 +1,5 @@
pub const GREETING: &str = "Hello from Xatu";
pub fn greeting() -> &'static str {
GREETING
}

4
src/xatu/lib_test.rs Normal file
View File

@@ -0,0 +1,4 @@
#[test]
fn greeting_returns_hello_message() {
assert_eq!(xatu::greeting(), "Hello from Xatu");
}

3
src/xatu/main.rs Normal file
View File

@@ -0,0 +1,3 @@
fn main() {
println!("{}", xatu::greeting());
}