From 82a60c8181dff41325f1e087c2b0dd67f5656213 Mon Sep 17 00:00:00 2001 From: hosted-fornet Date: Tue, 8 Oct 2024 15:01:23 -0700 Subject: [PATCH] build: use `kit` to build FEs --- scripts/build_packages/src/main.rs | 33 +++++------------------------- 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/scripts/build_packages/src/main.rs b/scripts/build_packages/src/main.rs index c5edbc3d..20a63099 100644 --- a/scripts/build_packages/src/main.rs +++ b/scripts/build_packages/src/main.rs @@ -41,13 +41,14 @@ fn zip_directory(dir_path: &Path) -> anyhow::Result> { fn build_and_zip_package( entry_path: PathBuf, parent_pkg_path: &str, + skip_frontend: bool, features: &str, ) -> anyhow::Result<(PathBuf, String, Vec)> { let rt = tokio::runtime::Runtime::new().unwrap(); rt.block_on(async { kit::build::execute( &entry_path, - true, + skip_frontend, false, true, features, @@ -105,33 +106,6 @@ fn main() -> anyhow::Result<()> { let kinode_dir = top_level_dir.join("kinode"); let packages_dir = kinode_dir.join("packages"); - if matches.get_flag("SKIP_FRONTEND") { - println!("skipping frontend builds"); - } else { - // build core frontends - let core_frontends = vec![ - "src/register-ui", - "packages/app_store/ui", - "packages/homepage/ui", - // chess when brought in - ]; - - // for each frontend, execute build.sh - for frontend in core_frontends { - let frontend_path = kinode_dir.join(frontend); - if !frontend_path.exists() { - panic!("couldn't find frontend at {frontend_path:?}"); - } - let status = std::process::Command::new("sh") - .current_dir(frontend_path) - .arg("./build.sh") - .status()?; - if !status.success() { - return Err(anyhow::anyhow!("Failed to build frontend: {}", frontend)); - } - } - } - let mut features = matches .get_many::("FEATURES") .unwrap_or_default() @@ -140,6 +114,8 @@ fn main() -> anyhow::Result<()> { features.sort(); let features = features.join(","); + let skip_frontend = matches.get_flag("SKIP_FRONTEND"); + let results: Vec)>> = fs::read_dir(&packages_dir)? .filter_map(|entry| { let entry_path = match entry { @@ -154,6 +130,7 @@ fn main() -> anyhow::Result<()> { Some(build_and_zip_package( entry_path.clone(), child_pkg_path.to_str().unwrap(), + skip_frontend, &features, )) })