Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ copyright_checker(
visibility = ["//visibility:public"],
)

filegroup(
name = "cargo_lock",
srcs = [
"Cargo.lock",
],
visibility = ["//visibility:public"],
)

dash_license_checker(
src = ":cargo_lock",
file_type = "", # let it auto-detect based on project_config
Expand All @@ -45,3 +37,7 @@ dash_license_checker(

# Add target for formatting checks
use_format_targets()

exports_files([
"MODULE.bazel",
])
24 changes: 12 additions & 12 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
[package]
name = "rust-kvs"
[workspace]
resolver = "2"
members=[
"src",
]

[workspace.package]
version = "0.1.0"
edition = "2021"

[dependencies]
adler32 = "1.2.0"
tinyjson = "2.5.1"
pico-args = "0.5"

[[bin]]
name = "kvs_tool"
path = "src/kvs_tool.rs"
[workspace.dependencies]
rust-kvs = { path = "src" }

[lib]
name = "rust_kvs"
path = "src/lib.rs"
adler32 = "1.2.0"
tinyjson = "2.5.1"
pico-args = "0.5"
19 changes: 19 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,22 @@ bazel_dep(name = "buildifier_prebuilt", version = "7.3.1")

#docs-as-code
bazel_dep(name = "score_docs_as_code", version = "0.3.3")

# Module deps

rust = use_extension("@rules_rust//rust:extensions.bzl", "rust")
rust.toolchain(
edition = "2021",
versions = ["1.85.0"],
)

crate = use_extension("@rules_rust//crate_universe:extensions.bzl", "crate")
crate.from_cargo(
name = "crates",
cargo_lockfile = "//:Cargo.lock",
manifests = [
"//:Cargo.toml",
"//src:Cargo.toml",
],
)
use_repo(crate, "crates")
43 changes: 43 additions & 0 deletions src/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# *******************************************************************************
# Copyright (c) 2025 Contributors to the Eclipse Foundation
#
# See the NOTICE file(s) distributed with this work for additional
# information regarding copyright ownership.
#
# This program and the accompanying materials are made available under the
# terms of the Apache License Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@crates//:defs.bzl", "all_crate_deps")
load("@rules_rust//rust:defs.bzl", "rust_binary", "rust_library", "rust_test")

rust_library(
name = "rust_kvs",
srcs = ["lib.rs"],
crate_name = "rust_kvs",
visibility = ["//visibility:public"],
deps = all_crate_deps(
normal = True,
),
)

rust_binary(
name = "kvs_tool",
srcs = [
"kvs_tool.rs",
],
crate_name = "rust_kvs",
visibility = ["//visibility:public"],
deps = all_crate_deps(
normal = True,
) + [
":rust_kvs",
],
)

rust_test(
name = "tests",
crate = ":rust_kvs",
)
18 changes: 18 additions & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[package]
name = "rust-kvs"
version.workspace = true
edition.workspace = true

[dependencies]
adler32.workspace = true
tinyjson.workspace = true
pico-args.workspace = true


[[bin]]
name = "kvs_tool"
path = "kvs_tool.rs"

[lib]
name = "rust_kvs"
path = "lib.rs"
Loading