Files
2026-08-17 08:59:24 +00:00

52 lines
1.4 KiB
Python

load("@crates//:defs.bzl", "aliases", "all_crate_deps")
load("@rules_rs//rs:rust_library.bzl", "rust_library")
load("@rules_rs//rs:rust_test.bzl", "rust_test")
load("@rules_rust//rust:defs.bzl", "rustfmt_test")
load("@workspace_version//:version.bzl", "WORKSPACE_VERSION")
rust_library(
name = "openshell-core",
srcs = glob(["src/**/*.rs"]),
aliases = aliases(),
compile_data = [
"//proto:openshell_proto_descriptor_set",
"//proto:openshell_rust_proto_src",
],
crate_features = [
"driver-extraction",
"telemetry",
],
rustc_env = {
"OPENSHELL_DESCRIPTOR_PATH": "$(execpath //proto:openshell_proto_descriptor_set)",
"OPENSHELL_PROTO_PATH": "$(execpath //proto:openshell_rust_proto_src)",
},
rustc_flags = ["--cfg=bazel"],
version = WORKSPACE_VERSION,
visibility = ["//visibility:public"],
deps = all_crate_deps(normal = True) + [
"//proto:descriptor_rust_proto",
"//proto:empty_rust_proto",
"//proto:struct_rust_proto",
],
)
rust_test(
name = "openshell-core_test",
crate = ":openshell-core",
crate_features = [
"driver-extraction",
"telemetry",
],
rustc_flags = ["--cfg=bazel"],
deps = all_crate_deps(normal_dev = True),
)
rustfmt_test(
name = "rustfmt_test",
targets = [
":openshell-core",
":openshell-core_test",
],
visibility = ["//crates:__pkg__"],
)