summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-01-07 14:54:48 +0800
committer魏曹先生 <1992414357@qq.com>2026-01-07 14:54:48 +0800
commitbb6c64fe18dd3dc8fd683da127936917b17df0a6 (patch)
tree8719c670c51f84d84a7b64b6070684b171d2193d
parentedf60b58e4e33607b3929cfd6c678b88b49abaab (diff)
Rename export directory to deploy and move templates
-rw-r--r--.cargo/config.toml2
-rw-r--r--.gitignore8
-rw-r--r--build.rs9
-rw-r--r--deploy.ps19
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<dyn std::error::Error>> {
- 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
}
}