Unreal build configurations (Development / Shipping / …)

Build Solution now opens a configuration picker (Development Editor,
Development, DebugGame, Shipping) and passes /p:Configuration=<cfg>
/p:Platform=Win64 to MSBuild, which drives UnrealBuildTool for the chosen
config. Streams into the same minimizable build overlay.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-07-07 16:40:01 +03:00
parent de6d55ad84
commit 168b6afab3
4 changed files with 72 additions and 11 deletions

View File

@ -774,7 +774,7 @@ async fn find_sln(state: State<'_, AppState>, scope: String) -> Result<String, S
/// its output line-by-line as `build-log` events. Uses the solution's default
/// configuration — for an Unreal project that compiles the game module.
#[tauri::command]
async fn build_sln(path: String) -> Result<String, String> {
async fn build_sln(path: String, config: String) -> Result<String, String> {
if !std::path::Path::new(&path).exists() {
return Err(format!("Solution not found: {path}"));
}
@ -805,7 +805,11 @@ async fn build_sln(path: String) -> Result<String, String> {
};
let msbuild = if msbuild.is_empty() { "MSBuild.exe".to_string() } else { msbuild };
emit(format!("MSBuild: {msbuild}"), false, false);
emit(format!("Building {path}"), false, false);
emit(
format!("Building {path}{}", if config.is_empty() { String::new() } else { format!(" [{config} | Win64]") }),
false,
false,
);
let mut cmd = Command::new(&msbuild);
#[cfg(windows)]
@ -813,9 +817,19 @@ async fn build_sln(path: String) -> Result<String, String> {
use std::os::windows::process::CommandExt;
cmd.creation_flags(0x0800_0000);
}
cmd.args([&path, "/m", "/nologo", "/v:minimal", "/clp:NoSummary"])
.stdout(Stdio::piped())
.stderr(Stdio::piped());
// build args; a specific UE configuration ("Development Editor", "Shipping", …) → Win64
let mut args: Vec<String> = vec![
path.clone(),
"/m".into(),
"/nologo".into(),
"/v:minimal".into(),
"/clp:NoSummary".into(),
];
if !config.is_empty() {
args.push(format!("/p:Configuration={config}"));
args.push("/p:Platform=Win64".into());
}
cmd.args(&args).stdout(Stdio::piped()).stderr(Stdio::piped());
let mut child = match cmd.spawn() {
Ok(c) => c,
Err(e) => {