Skip to content

Commit

Permalink
Fix Bazel build
Browse files Browse the repository at this point in the history
Include link-data.json as core-macros build time, so that later at
run-time the extracted sources don't have to be around anymore.
  • Loading branch information
tronical committed Dec 31, 2024
1 parent cf910d3 commit 27f1767
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions internal/core-macros/slint_doc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ impl syn::visit_mut::VisitMut for Visitor {

impl Visitor {
pub fn new() -> Self {
let link_path = concat!(env!("CARGO_MANIFEST_DIR"), "/link-data.json");
let link_data = std::fs::read_to_string(link_path).expect("Failed to read {link_path}");
let link_data: serde_json::Value =
serde_json::from_str(&link_data).expect("Failed to parse link-data.json");
let link_data: serde_json::Value = serde_json::from_str(include_str!(concat!(
env!("CARGO_MANIFEST_DIR"),
"/link-data.json"
)))
.expect("Failed to parse link-data.json");
Self(link_data, false)
}

Expand Down

0 comments on commit 27f1767

Please sign in to comment.