Files
makeCAD/xtask/src/app_icons.rs
T
bherbruck 7a6c884418 Change the app id to io.tangencylabs.solidcraft, with aliases for existing installs (#7681)
The app id moves from ai.storyteller.solidcraft to io.tangencylabs.solidcraft: macOS bundle id
(the CLI signs as io.tangencylabs.solidcraft.cli), Linux desktop/metainfo/MIME file names, icon
name, Wayland app_id / X11 class, Flatpak, Snap common-id, nfpm/FreeBSD/Nix/AppImage staging,
the web app's icon paths and the docs.

Existing installs keep working: the Flatpak repository marks both old ids
(ai.storyteller.solidcraft and ai.storyteller.solvecraft) end-of-life with a rebase straight to
the new id, re-marking the solvecraft ref that pointed at the 0.8 id; the manifest grants
read-only access to both old ~/.var/app folders and the first launch copies settings and
autosaves from the newest one; AppStream <replaces>/<provides> and X-Flatpak-RenamedFrom list
both; the AppImage removes menu entries it wrote under either old id. The data and settings
folders (solidcraft / SolidCraft) are unchanged. The MSI UpgradeCode and ProgIDs are unchanged.

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-27 17:16:40 -04:00

41 lines
1.7 KiB
Rust

//! Regenerate all exports of the shared app mark together. Packaging copies these files.
use std::path::Path;
#[path = "../../assets/icons/app/shared/source/app_icon.rs"]
mod app_icon;
#[path = "../../assets/icons/app/shared/source/windows_ico.rs"]
mod windows_ico;
pub fn run(root: &Path) -> Result<(), String> {
let stage = root.join("target/resources/app-icons");
std::fs::create_dir_all(&stage).map_err(|e| e.to_string())?;
let mut exports = Vec::new();
for size in [16, 24, 32, 48, 64, 128, 256, 512] {
let png = stage.join(format!("{size}.png"));
draw(&png, size)?;
exports.push((png, format!("linux/exports/hicolor/{size}x{size}/apps/io.tangencylabs.solidcraft.png")));
}
let installer = stage.join("solidcraft.ico");
draw(&installer, 256)?;
exports.push((installer, "windows/exports/solidcraft.ico".into()));
let executable = stage.join("solidcraft-executable.ico");
std::fs::write(&executable, windows_ico::encode().map_err(|e| e.to_string())?).map_err(|e| e.to_string())?;
exports.push((executable, "windows/exports/solidcraft-executable.ico".into()));
// Finish generation before replacing any canonical exports.
for (source, relative) in exports {
let target = root.join("assets/icons/app").join(relative);
if let Some(dir) = target.parent() {
std::fs::create_dir_all(dir).map_err(|e| e.to_string())?;
}
std::fs::copy(source, target).map_err(|e| e.to_string())?;
}
Ok(())
}
fn draw(path: &Path, size: usize) -> Result<(), String> {
let mut c = crate::cargo();
c.args(["run", "-q", "--profile", "ci", "-p", "solidcraft-cli", "--", "icon", "--size", &size.to_string(), "--out"]).arg(path);
crate::run(c, "solidcraft-cli icon")
}