diff --git a/.gitignore b/.gitignore index fd23274..a29d4bb 100644 --- a/.gitignore +++ b/.gitignore @@ -2,10 +2,10 @@ /Nomu_Engine *.hash compile_commands.json -ruxos_bld +ruxgo_bld sqlite-amalgamation-3410100 file.sqlite dump.rdb iperf -ruxos_pkg +ruxgo_pkg my_project \ No newline at end of file diff --git a/doc/ruxgo_book/src/commands/ruxgo-build.md b/doc/ruxgo_book/src/commands/ruxgo-build.md index edb54f6..28249ac 100644 --- a/doc/ruxgo_book/src/commands/ruxgo-build.md +++ b/doc/ruxgo_book/src/commands/ruxgo-build.md @@ -16,10 +16,10 @@ ruxgo -b [--path <路径>] [--gen-cc] [--gen-vsc] ## 命令行为 -当执行 `ruxgo -b` 命令后,将会在当前目录下创建一个名为 `ruxos_bld/` 的构建目录,包括以下内容: +当执行 `ruxgo -b` 命令后,将会在当前目录下创建一个名为 `ruxgo_bld/` 的构建目录,包括以下内容: ```bash -ruxos_bld/ +ruxgo_bld/ ├── bin/ ├── obj_linux/ 或 obj_win32/ ├── target/ diff --git a/doc/ruxgo_book/src/commands/ruxgo-pkg.md b/doc/ruxgo_book/src/commands/ruxgo-pkg.md index 89d8971..78d8314 100644 --- a/doc/ruxgo_book/src/commands/ruxgo-pkg.md +++ b/doc/ruxgo_book/src/commands/ruxgo-pkg.md @@ -20,7 +20,7 @@ ruxgo pkg [选项] - `--clean-all`: 清理所有软件包。 - `-h, --help`: 打印帮助信息。 -下载的文件保存在 `ruxos_pkg/` 目录中,具体内容如下: +下载的文件保存在 `ruxgo_pkg/` 目录中,具体内容如下: - `app-bin/`: 存放 app 可执行文件及其对应脚本。 - `ruxos/`: ruxos 存储位置。 diff --git a/doc/ruxgo_book/src/guide/ruxgo_features.md b/doc/ruxgo_book/src/guide/ruxgo_features.md index 06452c2..a917864 100644 --- a/doc/ruxgo_book/src/guide/ruxgo_features.md +++ b/doc/ruxgo_book/src/guide/ruxgo_features.md @@ -9,6 +9,6 @@ Ruxgo 设计充分考虑构建过程的效率、可靠性和可维护性,同 - **构建过程模块化**:构建过程以 Target 为中心,按照不同的 Target 模块来配置源文件和依赖库。构建应用程序可以像搭积木一样进行。 -- **源码和构建目录分离**:构建过程中生成的中间文件都会被放置在构建目录`ruxos_bld/`中,防止构建过程中文件冲突和混乱。 +- **源码和构建目录分离**:构建过程中生成的中间文件都会被放置在构建目录`ruxgo_bld/`中,防止构建过程中文件冲突和混乱。 - **友好的编译错误诊断**:使用更友好的编译器错误输出显示,包括清晰的错误提示、指向源代码行数等信息。 \ No newline at end of file diff --git a/src/builder.rs b/src/builder.rs index 331b0ee..bd27e9a 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -14,12 +14,12 @@ use std::sync::{Arc, Mutex}; use indicatif::{ProgressBar, ProgressStyle}; use colored::Colorize; -static BUILD_DIR: &str = "ruxos_bld"; -static BIN_DIR: &str = "ruxos_bld/bin"; +static BUILD_DIR: &str = "ruxgo_bld"; +static BIN_DIR: &str = "ruxgo_bld/bin"; #[cfg(target_os = "windows")] -static OBJ_DIR: &str = "ruxos_bld/obj_win32"; +static OBJ_DIR: &str = "ruxgo_bld/obj_win32"; #[cfg(target_os = "linux")] -static OBJ_DIR: &str = "ruxos_bld/obj_linux"; +static OBJ_DIR: &str = "ruxgo_bld/obj_linux"; // ruxlibc info and ld script lazy_static! { @@ -42,12 +42,12 @@ lazy_static! { } }; } -static RUXLIBC_BIN: &str = "ruxos_bld/bin/libc.a"; +static RUXLIBC_BIN: &str = "ruxgo_bld/bin/libc.a"; static RUXLIBC_RUST_LIB: &str = "libruxlibc.a"; // ruxmusl info -static RUXMUSL_INC: &str = "ruxos_bld/ruxmusl/install/include"; -static RUXMUSL_BIN: &str = "ruxos_bld/ruxmusl/install/lib/libc.a"; +static RUXMUSL_INC: &str = "ruxgo_bld/ruxmusl/install/include"; +static RUXMUSL_BIN: &str = "ruxgo_bld/ruxmusl/install/lib/libc.a"; static RUXMUSL_RUST_LIB: &str = "libruxmusl.a"; /// Represents a target @@ -112,9 +112,9 @@ impl<'a> Target<'a> { _ => (), } #[cfg(target_os = "windows")] - let hash_file_path = format!("ruxos_bld/{}.win32.hash", &target_config.name); + let hash_file_path = format!("ruxgo_bld/{}.win32.hash", &target_config.name); #[cfg(target_os = "linux")] - let hash_file_path = format!("ruxos_bld/{}.linux.hash", &target_config.name); + let hash_file_path = format!("ruxgo_bld/{}.linux.hash", &target_config.name); let path_hash = Hasher::load_hashes_from_file(&hash_file_path); let mut dependant_libs = Vec::new(); @@ -266,7 +266,7 @@ impl<'a> Target<'a> { return; } - // Add progress bar + // Parallel built let progress_bar = Arc::new(Mutex::new(ProgressBar::new(srcs_needed as u64))); let num_complete = Arc::new(Mutex::new(0)); let src_hash_to_update = Arc::new(Mutex::new(Vec::new())); @@ -281,8 +281,8 @@ impl<'a> Target<'a> { } src_hash_to_update.lock().unwrap().push(src); log(LogLevel::Info, &format!("Compiled: {}", src.path)); - // If the RUXOS_LOG_LEVEL is not "Info" or "Debug", update the compilation progress bar - let log_level = std::env::var("RUXOS_LOG_LEVEL").unwrap_or("".to_string()); + // If the RUXGO_LOG_LEVEL is not "Info" or "Debug", update the compilation progress bar + let log_level = std::env::var("RUXGO_LOG_LEVEL").unwrap_or("".to_string()); if !(log_level == "Info" || log_level == "Debug") { let mut num_complete = num_complete.lock().unwrap(); *num_complete += 1; @@ -356,7 +356,7 @@ impl<'a> Target<'a> { .expect("failed to execute process"); if output.status.success() { log(LogLevel::Log, "Linking successful"); - Hasher::save_hashes_to_file(&self.hash_file_path, &self.path_hash); + Hasher::save_hashes_to_file(&self.hash_file_path, &self.path_hash); // ? check if repeated } else { log(LogLevel::Error, "Linking failed"); log(LogLevel::Error, &format!(" Command: {}", &cmd)); diff --git a/src/commands.rs b/src/commands.rs index 0bd28fc..d3d4796 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -10,21 +10,21 @@ use std::fs; use std::process::{Command, Stdio}; use crate::hasher::Hasher; -static BUILD_DIR: &str = "ruxos_bld"; -static BIN_DIR: &str = "ruxos_bld/bin"; +static BUILD_DIR: &str = "ruxgo_bld"; +static BIN_DIR: &str = "ruxgo_bld/bin"; #[cfg(target_os = "windows")] -static OBJ_DIR: &str = "ruxos_bld/obj_win32"; +static OBJ_DIR: &str = "ruxgo_bld/obj_win32"; #[cfg(target_os = "linux")] -static OBJ_DIR: &str = "ruxos_bld/obj_linux"; -static TARGET_DIR: &str = "ruxos_bld/target"; -static PACKAGES_DIR: &str = "ruxos_bld/packages"; +static OBJ_DIR: &str = "ruxgo_bld/obj_linux"; +static TARGET_DIR: &str = "ruxgo_bld/target"; +static PACKAGES_DIR: &str = "ruxgo_bld/packages"; // OSConfig hash file -static OSCONFIG_HASH_FILE: &str = "ruxos_bld/os_config.hash"; +static OSCONFIG_HASH_FILE: &str = "ruxgo_bld/os_config.hash"; // ruxlibc info -static RUXLIBC_BIN: &str = "ruxos_bld/bin/libc.a"; -static RUXLIBC_HASH_PATH: &str = "ruxos_bld/libc.linux.hash"; +static RUXLIBC_BIN: &str = "ruxgo_bld/bin/libc.a"; +static RUXLIBC_HASH_PATH: &str = "ruxgo_bld/libc.linux.hash"; lazy_static! { static ref RUXLIBC_SRC: String = { let path1 = "../ruxos/ulib/ruxlibc/c"; @@ -38,7 +38,7 @@ lazy_static! { } // ruxmusl info -static RUXMUSL_DIR: &str = "ruxos_bld/ruxmusl"; +static RUXMUSL_DIR: &str = "ruxgo_bld/ruxmusl"; lazy_static! { static ref ULIB_RUXMUSL: String = { let path1 = "../ruxos/ulib/ruxmusl"; @@ -105,9 +105,9 @@ pub fn clean(targets: &Vec, os_config: &OSConfig, packages: &Vec

, os_config: &OSConfig, packages: &Vec

, config: &GlobalConfi std::process::exit(1); }); gitignore_file - .write_all(b"ruxos_bld\ncompile_commands.json\n.cache\n") + .write_all(b"ruxgo_bld\ncompile_commands.json\n.cache\n") .unwrap_or_else(|why| { log(LogLevel::Error, &format!("Could not write to .gitignore: {}", why)); std::process::exit(1); diff --git a/src/packages.rs b/src/packages.rs index e851ee6..f67a314 100644 --- a/src/packages.rs +++ b/src/packages.rs @@ -14,9 +14,9 @@ use std::error::Error; static PACKAGES_URL: &str = "https://mirror.ghproxy.com/https://raw.githubusercontent.com/Ybeichen/ruxos-pkgs/master/"; static SYSWONDER_URL: &str = "https://mirror.ghproxy.com/https://github.com/syswonder"; -static PKG_DIR: &str = "ruxos_pkg"; -static BIN_DIR: &str = "ruxos_pkg/app-bin"; -static CACHE_DIR: &str = "ruxos_pkg/cache"; +static PKG_DIR: &str = "ruxgo_pkg"; +static BIN_DIR: &str = "ruxgo_pkg/app-bin"; +static CACHE_DIR: &str = "ruxgo_pkg/cache"; /// Enum describing the Package type #[derive(Serialize, Deserialize, Debug, Clone, PartialEq)] diff --git a/src/utils.rs b/src/utils.rs index 74d5e8e..a84d275 100644 --- a/src/utils.rs +++ b/src/utils.rs @@ -719,7 +719,7 @@ impl Package { let repo = deets[0].to_string().replace(",", ""); let branch = deets[1].to_string(); let name = repo.split("/").collect::>()[1].to_string(); - let source_dir = format!("./ruxos_bld/packages/{}/", name); + let source_dir = format!("./ruxgo_bld/packages/{}/", name); let mut sub_packages: Vec = Vec::new(); // git clone packages if !Path::new(&source_dir).exists() {