Skip to content

updated build system script commands #490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion build_system/src/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@ struct BuildArg {
}

impl BuildArg {
/// Creates a new `BuildArg` instance by parsing command-line arguments.
fn new() -> Result<Option<Self>, String> {
let mut build_arg = Self::default();
// We skip binary name and the `build` command.
// Skip binary name and the `build` command.
let mut args = std::env::args().skip(2);

while let Some(arg) = args.next() {
Expand Down Expand Up @@ -211,6 +212,7 @@ fn build_codegen(args: &mut BuildArg) -> Result<(), String> {
Ok(())
}

/// Executes the build process.
pub fn run() -> Result<(), String> {
let mut args = match BuildArg::new()? {
Some(args) => args,
Expand Down
25 changes: 15 additions & 10 deletions build_system/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,17 +26,22 @@ macro_rules! arg_error {
fn usage() {
println!(
"\
Available commands for build_system:
rustc_codegen_gcc build system

cargo : Run cargo command
rustc : Run rustc command
clean : Run clean command
prepare : Run prepare command
build : Run build command
test : Run test command
info : Run info command
clone-gcc : Run clone-gcc command
--help : Show this message"
Usage: build_system [command] [options]

Options:
--help : Displays this help message.

Commands:
cargo : Executes a cargo command.
rustc : Compiles the program using the GCC compiler.
clean : Cleans the build directory, removing all compiled files and artifacts.
prepare : Prepares the environment for building, including fetching dependencies and setting up configurations.
build : Compiles the project.
test : Runs tests for the project.
info : Displays information about the build environment and project configuration.
clone-gcc : Clones the GCC compiler from a specified source."
);
}

Expand Down
Loading