Extract CEF rendered UI into a separate process and crate

This commit is contained in:
Timon
2026-07-08 23:34:00 +00:00
parent 97f8113fe4
commit 5daea64585
79 changed files with 4159 additions and 1257 deletions

View File

@@ -28,12 +28,16 @@ pub(crate) fn cef_path() -> PathBuf {
PathBuf::from(env!("CEF_PATH"))
}
pub(crate) fn build_bin(package: &str, bin: Option<&str>) -> Result<PathBuf, Box<dyn Error>> {
pub(crate) fn build_bin(package: &str, bin: Option<&str>, features: Option<&str>) -> Result<PathBuf, Box<dyn Error>> {
let mut args = vec!["build", "--package", package, "--profile", profile_name()];
if let Some(bin) = bin {
args.push("--bin");
args.push(bin);
}
if let Some(features) = features {
args.push("--features");
args.push(features);
}
run_command("cargo", &args)?;
let profile_path = profile_path();
let mut bin_path = if let Some(bin) = bin { profile_path.join(bin) } else { profile_path.join(APP_BIN) };

View File

@@ -1,7 +1,7 @@
use crate::common::*;
pub fn main() -> Result<(), Box<dyn std::error::Error>> {
let app_bin = build_bin("graphite-desktop-platform-linux", None)?;
let app_bin = build_bin("graphite-desktop-platform-linux", None, None)?;
// TODO: Implement bundling for linux

View File

@@ -18,8 +18,8 @@ const GRAPHITE_FILE_EXTENSION: &str = "graphite";
const GRAPHITE_MIME_TYPE: &str = "application/graphite+json";
pub fn main() -> Result<(), Box<dyn Error>> {
let app_bin = build_bin("graphite-desktop-platform-mac", None)?;
let helper_bin = build_bin("graphite-desktop-platform-mac", Some("helper"))?;
let app_bin = build_bin("graphite-desktop-platform-mac", None, Some("main"))?;
let helper_bin = build_bin("graphite-desktop-platform-mac", Some("helper"), Some("helper"))?;
let profile_path = profile_path();
let app_dir = bundle(&profile_path, &app_bin, &helper_bin);

View File

@@ -7,7 +7,7 @@ use crate::common::*;
const EXECUTABLE: &str = "Graphite.exe";
pub fn main() -> Result<(), Box<dyn Error>> {
let app_bin = build_bin("graphite-desktop-platform-win", None)?;
let app_bin = build_bin("graphite-desktop-platform-win", None, None)?;
let executable = bundle(&profile_path(), &app_bin);