# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
load("//build_defs:rust.bzl", "rust_binary", "rust_library", "rust_test")
licenses(["notice"])
package(
default_applicable_licenses = ["//chart_live:license"],
default_visibility = ["//visibility:public"],
)
filegroup(
name = "oss_sources",
srcs = glob(["**/*"]),
)
CLI_DEPS = [
"//chart_live/crates/d3-cli:d3_live_cli",
"//chart_live/crates/mermaid-cli:mermaid_live_cli",
"//deps/rust:serde_json",
]
# `chart-live`: routes to the mermaid-live and d3-live command lines and merges their MCP tools.
rust_library(
name = "chart_live_cli",
srcs = glob(
["src/**/*.rs"],
exclude = ["src/main.rs"],
),
edition = "2021",
rustc_env = {"CARGO_PKG_VERSION": "0.1.0"},
deps = CLI_DEPS,
)
rust_binary(
name = "chart_live_bin",
srcs = ["src/main.rs"],
edition = "2021",
deps = [":chart_live_cli"],
)
rust_test(
name = "chart_live_cli_test",
size = "small",
crate = ":chart_live_cli",
edition = "2021",
rustc_env = {"CARGO_PKG_VERSION": "0.1.0"},
)