From 27f17676222165bfd0648a213363c1a183ec49ed Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Tue, 31 Dec 2024 15:46:28 +0100 Subject: [PATCH] Fix Bazel build 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. --- internal/core-macros/slint_doc.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/core-macros/slint_doc.rs b/internal/core-macros/slint_doc.rs index fcb86ac2d50..eb5339ae8e9 100644 --- a/internal/core-macros/slint_doc.rs +++ b/internal/core-macros/slint_doc.rs @@ -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) }