-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild_and_run_windows.ps1
More file actions
47 lines (38 loc) · 1.36 KB
/
build_and_run_windows.ps1
File metadata and controls
47 lines (38 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<#
build_and_run_windows.ps1
Chama o build_windows.ps1 e, se o build for bem-sucedido, executa o binário gerado.
Uso:
powershell -ExecutionPolicy Bypass -File .\build_and_run_windows.ps1
Parâmetros opcionais:
-ProjectDir
-CargoTargetDir
#>
param(
[string]$ProjectDir = "Y:\projetos\ZivyarQuantFx_Workspace\rust_core",
[string]$CargoTargetDir = "$env:USERPROFILE\cargo-targets\zivyar",
[switch]$WaitForExit
)
Write-Host "Invocando build_windows.ps1..."
$buildScript = Join-Path -Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -ChildPath 'build_windows.ps1'
if (-not (Test-Path $buildScript)) {
Write-Error "build_windows.ps1 não encontrado em: $buildScript"
exit 1
}
& powershell -ExecutionPolicy Bypass -File $buildScript -ProjectDir $ProjectDir -CargoTargetDir $CargoTargetDir
if ($LASTEXITCODE -ne 0) {
Write-Error "Build falhou (exit code $LASTEXITCODE). Abortando execução do binário."
exit $LASTEXITCODE
}
$exe = Join-Path -Path $CargoTargetDir -ChildPath 'release\zivyar_quant_fx.exe'
if (-not (Test-Path $exe)) {
Write-Error "Executável não encontrado: $exe"
exit 1
}
Write-Host "Executando: $exe"
if ($WaitForExit) {
& $exe; exit $LASTEXITCODE
} else {
Start-Process -FilePath $exe -WorkingDirectory (Split-Path $exe) | Out-Null
Write-Host "Processo iniciado em background. Use Task Manager ou logs para monitorar."
}
exit 0