mirror of
https://github.com/dexoron/dcr.git
synced 2026-10-21 19:39:31 +00:00
Compare commits
2 Commits
cb6ae3dcc7
...
552f6c8e4f
| Author | SHA1 | Date | |
|---|---|---|---|
| 552f6c8e4f | |||
|
|
da84916e10 |
@@ -17,12 +17,10 @@
|
|||||||
|
|
||||||
use crate::prelude::*;
|
use crate::prelude::*;
|
||||||
|
|
||||||
use crate::core::build_config::Config;
|
use crate::core::{build_config::Config, deps::register};
|
||||||
use crate::core::deps::register;
|
|
||||||
use crate::utils::fs::find_project_root;
|
use crate::utils::fs::find_project_root;
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
use toml::Value;
|
use toml::{Value, map::Map};
|
||||||
use toml::map::Map;
|
|
||||||
|
|
||||||
/// Parsed arguments for the `dcr add` command.
|
/// Parsed arguments for the `dcr add` command.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -23,8 +23,7 @@ use crate::utils::build::{default_profile_flags, default_target_triple, parse_ve
|
|||||||
use crate::utils::fs::{check_dir, find_project_root, with_dir};
|
use crate::utils::fs::{check_dir, find_project_root, with_dir};
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
use glob::glob;
|
use glob::glob;
|
||||||
use std::fs;
|
use std::{fs, path::Path};
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
/// Entry point for the `dcr clean` command.
|
/// Entry point for the `dcr clean` command.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ use crate::core::build_config::{Config, validate_package_name};
|
|||||||
use crate::core::vcs::VcsKind;
|
use crate::core::vcs::VcsKind;
|
||||||
use crate::utils::fs::check_dir;
|
use crate::utils::fs::check_dir;
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
use std::fs;
|
use std::{fs, io::Write};
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
/// Initializes the current working directory as a new DCR project.
|
/// Initializes the current working directory as a new DCR project.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -22,8 +22,7 @@ use crate::core::build_config::{Config, validate_package_name};
|
|||||||
use crate::core::vcs::VcsKind;
|
use crate::core::vcs::VcsKind;
|
||||||
use crate::utils::fs::check_dir;
|
use crate::utils::fs::check_dir;
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
use std::fs;
|
use std::{fs, io::Write};
|
||||||
use std::io::Write;
|
|
||||||
|
|
||||||
/// Executes the `dcr new` command to scaffold a new C/C++ project directory structure.
|
/// Executes the `dcr new` command to scaffold a new C/C++ project directory structure.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -22,11 +22,9 @@ use crate::cli::flags::parse_build_run_flags;
|
|||||||
use crate::core::build_config::Config;
|
use crate::core::build_config::Config;
|
||||||
use crate::core::runner::run_binary;
|
use crate::core::runner::run_binary;
|
||||||
use crate::utils::build::{normalize_target_os, parse_version_info, substitute_vars};
|
use crate::utils::build::{normalize_target_os, parse_version_info, substitute_vars};
|
||||||
use crate::utils::fs::find_project_root;
|
use crate::utils::fs::{find_project_root, with_dir};
|
||||||
use crate::utils::fs::with_dir;
|
|
||||||
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
use crate::utils::text::{BOLD_CYAN, BOLD_GREEN, colored, printc};
|
||||||
use std::path::Path;
|
use std::{path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Retrieves the run command from the config, preferring target-specific,
|
/// Retrieves the run command from the config, preferring target-specific,
|
||||||
/// then profile-specific, then the base `run.cmd`.
|
/// then profile-specific, then the base `run.cmd`.
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::platform;
|
use crate::platform;
|
||||||
use crate::utils::build::is_bare_metal_target;
|
use crate::utils::build::is_bare_metal_target;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|||||||
@@ -15,9 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::build::{builder::BuildContext, builder::artifact, common};
|
||||||
use crate::core::build::builder::artifact;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::utils::build::{is_bare_metal_target, is_compile_only, is_flat_bin};
|
use crate::utils::build::{is_bare_metal_target, is_compile_only, is_flat_bin};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|||||||
@@ -20,15 +20,10 @@
|
|||||||
/// This module provides the MSVC-specific build implementation for C and C++
|
/// This module provides the MSVC-specific build implementation for C and C++
|
||||||
/// projects, including object compilation and linking for executables, static
|
/// projects, including object compilation and linking for executables, static
|
||||||
/// libraries, shared libraries, and flat binaries.
|
/// libraries, shared libraries, and flat binaries.
|
||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::build::{builder::BuildContext, builder::artifact, common};
|
||||||
use crate::core::build::builder::artifact;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::platform;
|
use crate::platform;
|
||||||
use crate::utils::build::{is_compile_only, is_flat_bin};
|
use crate::utils::build::{is_compile_only, is_flat_bin};
|
||||||
use std::fs;
|
use std::{fs, path::Path, process::Command, time::Instant};
|
||||||
use std::path::Path;
|
|
||||||
use std::process::Command;
|
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
/// Builds the project target using the MSVC compiler.
|
/// Builds the project target using the MSVC compiler.
|
||||||
pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
pub fn build(ctx: &BuildContext) -> Result<f64, String> {
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use crate::core::build::common;
|
|
||||||
use sha2::{Digest, Sha256};
|
use sha2::{Digest, Sha256};
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::build::{builder::BuildContext, builder::artifact, common};
|
||||||
use crate::core::build::builder::artifact;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::utils::build::{is_compile_only, is_flat_bin};
|
use crate::utils::build::{is_compile_only, is_flat_bin};
|
||||||
use std::path::Path;
|
use std::{path::Path, time::Instant};
|
||||||
use std::time::Instant;
|
|
||||||
|
|
||||||
/// Keeps only assembler-relevant flags from a cflags list.
|
/// Keeps only assembler-relevant flags from a cflags list.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
use crate::core::build::builder::BuildContext;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::core::build::language::asm::common as asm;
|
use crate::core::build::language::asm::common as asm;
|
||||||
use std::fs;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use std::path::Path;
|
use std::{fs, path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Builds an assembly file using the FASM assembler.
|
/// Builds an assembly file using the FASM assembler.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -15,12 +15,9 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::builder::BuildContext;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::core::build::language::asm::common as asm;
|
use crate::core::build::language::asm::common as asm;
|
||||||
use std::fs;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use std::path::Path;
|
use std::{fs, path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Builds GAS (`.s`) sources via the GNU Assembler.
|
/// Builds GAS (`.s`) sources via the GNU Assembler.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,9 +1,6 @@
|
|||||||
use crate::core::build::builder::BuildContext;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::core::build::language::asm::common as asm;
|
use crate::core::build::language::asm::common as asm;
|
||||||
use std::fs;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use std::path::Path;
|
use std::{fs, path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Builds MASM (`.asm`) sources via `ml`.
|
/// Builds MASM (`.asm`) sources via `ml`.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -16,12 +16,9 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
/// Support for NASM assembly language in the DCR build system.
|
/// Support for NASM assembly language in the DCR build system.
|
||||||
use crate::core::build::builder::BuildContext;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::core::build::language::asm::common as asm;
|
use crate::core::build::language::asm::common as asm;
|
||||||
use std::fs;
|
use crate::core::build::{builder::BuildContext, common};
|
||||||
use std::path::Path;
|
use std::{fs, path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Builds assembly sources using the NASM assembler.
|
/// Builds assembly sources using the NASM assembler.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::builder::BuildContext;
|
use crate::core::{build::builder::BuildContext, build::common};
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::utils::build::run_pkg_config;
|
use crate::utils::build::run_pkg_config;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
|
|||||||
@@ -1,10 +1,6 @@
|
|||||||
use crate::core::build::builder::BuildContext;
|
|
||||||
use crate::core::build::common;
|
|
||||||
use crate::core::build::language::Language;
|
|
||||||
use crate::core::build::language::asm::common as asm;
|
use crate::core::build::language::asm::common as asm;
|
||||||
use std::fs;
|
use crate::core::build::{builder::BuildContext, common, language::Language};
|
||||||
use std::path::Path;
|
use std::{fs, path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Represents the LLVM IR language implementation for the build system.
|
/// Represents the LLVM IR language implementation for the build system.
|
||||||
pub struct LlvmIr;
|
pub struct LlvmIr;
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::core::build::engine::ToolchainExecs;
|
use crate::core::{build::engine::ToolchainExecs, build_config::Config};
|
||||||
use crate::core::build_config::Config;
|
|
||||||
use crate::utils::build::{VersionInfo, profile_table, substitute_vars};
|
use crate::utils::build::{VersionInfo, profile_table, substitute_vars};
|
||||||
use glob::glob;
|
use glob::glob;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
|
|||||||
@@ -21,8 +21,7 @@ use serde::Deserialize;
|
|||||||
use std::collections::BTreeMap;
|
use std::collections::BTreeMap;
|
||||||
use std::fs;
|
use std::fs;
|
||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use toml::Value;
|
use toml::{Value, map::Map};
|
||||||
use toml::map::Map;
|
|
||||||
use toml_edit::{DocumentMut, Item, Table};
|
use toml_edit::{DocumentMut, Item, Table};
|
||||||
|
|
||||||
const DEFAULT_VERSION: &str = "0.1.0";
|
const DEFAULT_VERSION: &str = "0.1.0";
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fs;
|
use std::{fs, path::Path};
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
/// Represents a locked dependency entry containing its name, version, source, and checksum.
|
/// Represents a locked dependency entry containing its name, version, source, and checksum.
|
||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
|
|||||||
@@ -17,9 +17,7 @@
|
|||||||
|
|
||||||
/// Registry configuration management for DCR.
|
/// Registry configuration management for DCR.
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use std::collections::HashMap;
|
use std::{collections::HashMap, fs, path::PathBuf};
|
||||||
use std::fs;
|
|
||||||
use std::path::PathBuf;
|
|
||||||
|
|
||||||
/// Represents a registry configuration entry with its URL and priority.
|
/// Represents a registry configuration entry with its URL and priority.
|
||||||
#[derive(Debug, Serialize, Deserialize)]
|
#[derive(Debug, Serialize, Deserialize)]
|
||||||
|
|||||||
@@ -16,8 +16,7 @@
|
|||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use crate::platform;
|
use crate::platform;
|
||||||
use std::path::Path;
|
use std::{path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Runs the built binary for a project, forwarding `bin_args`.
|
/// Runs the built binary for a project, forwarding `bin_args`.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -15,8 +15,7 @@
|
|||||||
// You should have received a copy of the GNU General Public License
|
// You should have received a copy of the GNU General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
use std::fs;
|
use std::{fs, path::Path};
|
||||||
use std::path::Path;
|
|
||||||
|
|
||||||
/// Initializes a Git repository in the target directory and configures its `.gitignore` file.
|
/// Initializes a Git repository in the target directory and configures its `.gitignore` file.
|
||||||
///
|
///
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
use std::path::Path;
|
use std::{path::Path, process::Command};
|
||||||
use std::process::Command;
|
|
||||||
|
|
||||||
/// Checks if the `git` executable is available in the system's PATH.
|
/// Checks if the `git` executable is available in the system's PATH.
|
||||||
///
|
///
|
||||||
|
|||||||
Reference in New Issue
Block a user