From 0cb55ab88b4e799ba8b781535a26c9e409cc284e Mon Sep 17 00:00:00 2001 From: Christopher Rabotin Date: Sun, 13 Oct 2024 19:00:39 -0600 Subject: [PATCH] Attempting to change the path of embedded AstroData when building with docsrs --- Cargo.toml | 1 - anise/src/almanac/embed.rs | 7 ++++--- data/.cargokeep | 1 - 3 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 data/.cargokeep diff --git a/Cargo.toml b/Cargo.toml index 968d3c54..2d2528ac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,7 +24,6 @@ exclude = [ ".vscode", "*.sh", ] -include = ["data/.cargokeep"] [workspace.dependencies] hifitime = "4.0.0-alpha" diff --git a/anise/src/almanac/embed.rs b/anise/src/almanac/embed.rs index b2b1a1f4..796fadc1 100644 --- a/anise/src/almanac/embed.rs +++ b/anise/src/almanac/embed.rs @@ -8,9 +8,10 @@ use rust_embed::Embed; use snafu::ResultExt; #[derive(Embed)] -#[folder = "$CARGO_MANIFEST_DIR/../data/"] -#[include = "de440s.bsp"] -#[include = "pck11.pca"] +#[cfg_attr(not(docsrs), folder = "$CARGO_MANIFEST_DIR/../data/")] +#[cfg_attr(not(docsrs), include = "de440s.bsp")] +#[cfg_attr(not(docsrs), include = "pck11.pca")] +#[cfg_attr(docsrs, folder = "$OUTDIR")] struct AstroData; impl Almanac { diff --git a/data/.cargokeep b/data/.cargokeep deleted file mode 100644 index eea5b5c1..00000000 --- a/data/.cargokeep +++ /dev/null @@ -1 +0,0 @@ -Required in cargo for documenting the embed_ephem feature \ No newline at end of file