From 1c0729bda0b9175a1d5f5717564a5508e265f8eb Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Wed, 10 Jul 2024 14:56:29 +0800 Subject: [PATCH 1/2] rename `mega_app` to `mega` Signed-off-by: HouXiaoxuan --- neptune/{mega_app => mega}/tunnel/api.js | 0 neptune/{mega_app => mega}/tunnel/cli.js | 0 neptune/{mega_app => mega}/tunnel/main.js | 0 3 files changed, 0 insertions(+), 0 deletions(-) rename neptune/{mega_app => mega}/tunnel/api.js (100%) rename neptune/{mega_app => mega}/tunnel/cli.js (100%) rename neptune/{mega_app => mega}/tunnel/main.js (100%) diff --git a/neptune/mega_app/tunnel/api.js b/neptune/mega/tunnel/api.js similarity index 100% rename from neptune/mega_app/tunnel/api.js rename to neptune/mega/tunnel/api.js diff --git a/neptune/mega_app/tunnel/cli.js b/neptune/mega/tunnel/cli.js similarity index 100% rename from neptune/mega_app/tunnel/cli.js rename to neptune/mega/tunnel/cli.js diff --git a/neptune/mega_app/tunnel/main.js b/neptune/mega/tunnel/main.js similarity index 100% rename from neptune/mega_app/tunnel/main.js rename to neptune/mega/tunnel/main.js From 17a2d39f154ca4fdd7d72ac169f5def160586e20 Mon Sep 17 00:00:00 2001 From: HouXiaoxuan Date: Wed, 10 Jul 2024 15:20:20 +0800 Subject: [PATCH 2/2] fix windows run `npm install` Signed-off-by: HouXiaoxuan --- neptune/build.rs | 29 ++++++++++++++++++++++------- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/neptune/build.rs b/neptune/build.rs index 0507daf35..fb99531ea 100644 --- a/neptune/build.rs +++ b/neptune/build.rs @@ -54,24 +54,39 @@ fn copy_mega_apps() { } } +/// run npm install in the libs/ztm +fn run_npm_install() { + #[cfg(any(target_os = "linux", target_os = "macos"))] + let _ = std::process::Command::new("npm") + .current_dir("libs/ztm/pipy") + .arg("install") + .output() + .expect("failed to run npm install in ztm/pipy"); + + #[cfg(target_os = "windows")] + let _ = std::process::Command::new("cmd.exe") + .current_dir("libs/ztm/pipy") + // .arg("install") + .arg("/C") + .arg("npm install") + .output() + .expect("failed to run npm install in ztm/pipy"); +} + fn main() { // check submodule exists let check_file = Path::new("libs/ztm/pipy/CMakeLists.txt"); if !check_file.exists() { panic!("Please run `git submodule update --init --recursive` to get the submodule"); } + copy_mega_apps(); build_agent_ui(); + run_npm_install(); + /* compile ztm & pipy */ - // run npm install in the libs/ztm - let _ = std::process::Command::new("npm") - .current_dir("libs/ztm/pipy") - .arg("install") - .output() - .expect("failed to run npm install in ztm/pipy"); - let mut config = Config::new("libs/ztm/pipy"); // set to use clang/clang++ to compile