diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:35:13 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-01-23 03:35:13 +0800 |
| commit | dd800eb6394a0ba5b3216bbf4dfc4a90a717599e (patch) | |
| tree | a3505a7b447f0dfb15c7a500e397c39c25eb51a9 /tools/build_helper/src/bin/exporter.rs | |
| parent | 5b5e3b2b9375fea3e47c28c2a4d47ef4fe349cd5 (diff) | |
Increase codegen-units and add dev deployment scripts
Diffstat (limited to 'tools/build_helper/src/bin/exporter.rs')
| -rw-r--r-- | tools/build_helper/src/bin/exporter.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tools/build_helper/src/bin/exporter.rs b/tools/build_helper/src/bin/exporter.rs index c8f7ba2..c20694b 100644 --- a/tools/build_helper/src/bin/exporter.rs +++ b/tools/build_helper/src/bin/exporter.rs @@ -7,13 +7,22 @@ fn main() -> Result<(), Box<dyn std::error::Error>> { let start_time = std::time::Instant::now(); + let preferred_target = std::env::args() + .nth(1) + .unwrap_or_else(|| "debug".to_string()); let target_dir = current_target_dir().expect("Failed to get target directory"); let publish_dir = current_publish_dir().expect("Failed to get publish directory"); let publish_binaries = publish_binaries().expect("Failed to get publish binaries"); let copy_configs = copy_configs().expect("Failed to get copy configurations"); // Final, export binaries to publish directory - let copied_files = export(target_dir, publish_dir, publish_binaries, copy_configs)?; + let copied_files = export( + target_dir, + publish_dir, + publish_binaries, + copy_configs, + preferred_target, + )?; let duration = start_time.elapsed(); println!( @@ -33,6 +42,7 @@ fn export( publish_dir: std::path::PathBuf, publish_binaries: Vec<String>, copy_configs: Vec<CopyConfig>, + preferred_target: String, ) -> Result<usize, Box<dyn std::error::Error>> { let mut copied_files = 0; @@ -70,6 +80,12 @@ fn export( if let Some(file_name) = path.file_name().and_then(|n| n.to_str()) && publish_binaries.contains(&file_name.to_string()) { + // Check if the path contains the preferred_target string + let path_str = path.to_string_lossy(); + if !path_str.contains(&preferred_target) { + continue; + } + let dest_path = bin_dir.join(file_name); if let Some(parent) = dest_path.parent() { |
