From bb6c64fe18dd3dc8fd683da127936917b17df0a6 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 7 Jan 2026 14:54:48 +0800 Subject: Rename export directory to deploy and move templates --- .cargo/config.toml | 2 +- .gitignore | 8 +++----- build.rs | 9 ++++++--- deploy.ps1 | 9 ++++++++- 4 files changed, 18 insertions(+), 10 deletions(-) diff --git a/.cargo/config.toml b/.cargo/config.toml index a5fccaa..4e5ae27 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -2,7 +2,7 @@ target-dir = "./.temp/target/" [publish] -target-dir = "./export/" +target-dir = "./deploy/" binaries = [ "jv", "jv.exe", diff --git a/.gitignore b/.gitignore index e00561c..adb64ee 100644 --- a/.gitignore +++ b/.gitignore @@ -17,11 +17,9 @@ # Target directory /target/ -# Export directory -/export/ +# Deploy directory +/deploy/ -# Compile info +# Generated from templates /src/data/compile_info.rs - -# Setup script /setup/windows/setup_jv_cli.iss diff --git a/build.rs b/build.rs index 45f04af..c8b492c 100644 --- a/build.rs +++ b/build.rs @@ -3,7 +3,10 @@ use std::path::PathBuf; use std::process::Command; const COMPILE_INFO_RS: &str = "./src/data/compile_info.rs"; -const COMPILE_INFO_RS_TEMPLATE: &str = "./src/data/compile_info.rs.template"; +const COMPILE_INFO_RS_TEMPLATE: &str = "./templates/compile_info.rs"; + +const SETUP_JV_CLI_ISS: &str = "./setup/windows/setup_jv_cli.iss"; +const SETUP_JV_CLI_ISS_TEMPLATE: &str = "./templates/setup_jv_cli.iss"; fn main() { println!("cargo:rerun-if-env-changed=FORCE_BUILD"); @@ -26,8 +29,8 @@ fn main() { /// Generate Inno Setup installer script (Windows only) fn generate_installer_script(repo_root: &PathBuf) -> Result<(), Box> { - let template_path = repo_root.join("setup/windows/setup_jv_cli_template.iss"); - let output_path = repo_root.join("setup/windows/setup_jv_cli.iss"); + let template_path = repo_root.join(SETUP_JV_CLI_ISS_TEMPLATE); + let output_path = repo_root.join(SETUP_JV_CLI_ISS); let template = std::fs::read_to_string(&template_path)?; diff --git a/deploy.ps1 b/deploy.ps1 index 5b929f2..8140dcb 100644 --- a/deploy.ps1 +++ b/deploy.ps1 @@ -1,5 +1,12 @@ # Require : Cargo (Rust), ISCC (Inno Setup) +# Check for ISCC +$isccPath = Get-Command ISCC -ErrorAction SilentlyContinue +if (-not $isccPath) { + Write-Warning '"Inno Setup" not installed. (https://jrsoftware.org/isinfo.php)' + exit +} + # Build $env:CARGO_BUILD_RERUN_IF_ENV_CHANGED="FORCE_BUILD=$(Get-Date -Format 'mmss')" cargo build --workspace --release @@ -9,7 +16,7 @@ if ($LASTEXITCODE -ne 0) { # Build succeeded # Export if (cargo run --manifest-path crates/build_helper/Cargo.toml --bin exporter) { - Copy-Item -Path src\data\compile_info.rs.template -Destination src\data\compile_info.rs -Force + Copy-Item -Path templates\compile_info.rs -Destination src\data\compile_info.rs -Force ISCC /Q .\setup\windows\setup_jv_cli.iss } } -- cgit