build: add Bazel Rust workflow
This commit was merged in pull request #2.
This commit is contained in:
13
src/machoke/BUILD
Normal file
13
src/machoke/BUILD
Normal file
@@ -0,0 +1,13 @@
|
||||
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library")
|
||||
|
||||
rust_library(
|
||||
name = "machoke_lib",
|
||||
crate_name = "machoke",
|
||||
srcs = ["lib.rs"],
|
||||
)
|
||||
|
||||
rust_binary(
|
||||
name = "machoke",
|
||||
srcs = ["main.rs"],
|
||||
deps = [":machoke_lib"],
|
||||
)
|
||||
7
src/machoke/Cargo.lock
generated
Normal file
7
src/machoke/Cargo.lock
generated
Normal file
@@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "machoke"
|
||||
version = "0.1.0"
|
||||
13
src/machoke/Cargo.toml
Normal file
13
src/machoke/Cargo.toml
Normal file
@@ -0,0 +1,13 @@
|
||||
[package]
|
||||
name = "machoke"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[lib]
|
||||
path = "lib.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "machoke"
|
||||
path = "main.rs"
|
||||
|
||||
[dependencies]
|
||||
3
src/machoke/lib.rs
Normal file
3
src/machoke/lib.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub fn greeting() -> &'static str {
|
||||
"Hello from machoke"
|
||||
}
|
||||
3
src/machoke/main.rs
Normal file
3
src/machoke/main.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
fn main() {
|
||||
println!("{}", machoke::greeting());
|
||||
}
|
||||
Reference in New Issue
Block a user