Fix build success detection + minimizable build window + de-dupe event logs

- build_sln now trusts UnrealBuildTool's "Result: Succeeded" (and absence of
  real compile errors) over MSBuild's exit code, which is non-zero for a side
  project even when the UE game module built fine.
- Fixed double event-listener registration (async unlisten under StrictMode)
  that duplicated every p4-log / p4-transfer / build-log line.
- Build overlay can be minimized to a small floating chip (spinner while
  building, ✓/✗ when done), click to expand, × to dismiss.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Bonchellon
2026-07-07 16:16:03 +03:00
parent b00b4f94b0
commit afc4824b26
4 changed files with 69 additions and 14 deletions

View File

@ -762,9 +762,25 @@ async fn build_sln(path: String) -> Result<String, String> {
}
};
// For Unreal, the .sln drives UnrealBuildTool; MSBuild can return non-zero for a
// side project even when UBT reports the game module built fine. So trust UBT's
// "Result: Succeeded" (and the absence of real compile errors) over the exit code.
let mut ubt_result = false;
let mut ubt_success = false;
let mut compile_error = false;
let mut scan = |line: &str| {
let l = line.to_ascii_lowercase();
if l.contains("result: succeeded") { ubt_result = true; ubt_success = true; }
if l.contains("result: failed") { ubt_result = true; }
if l.contains(": error ") || l.contains(") error ") || l.contains("error msb") {
compile_error = true;
}
};
if let Some(out) = child.stdout.take() {
for line in BufReader::new(out).lines().map_while(Result::ok) {
if !line.trim().is_empty() {
scan(&line);
emit(line, false, false);
}
}
@ -775,11 +791,17 @@ async fn build_sln(path: String) -> Result<String, String> {
let _ = std::io::Read::read_to_string(&mut se, &mut buf);
for line in buf.lines() {
if !line.trim().is_empty() {
scan(line);
emit(line.to_string(), false, false);
}
}
}
let ok = status.success();
// UBT verdict wins when present; otherwise fall back to MSBuild's exit code
let ok = if ubt_result {
ubt_success && !compile_error
} else {
status.success()
};
emit(if ok { "✓ Build succeeded.".into() } else { "✗ Build FAILED.".into() }, true, ok);
if ok {
Ok("ok".into())