Files
openide/build/run_build_target.ps1
Leonid Shalupov 2769c0c238 IJI-3417 build scripts: Bazel: fixes in running tests after extensive Windows testing
GitOrigin-RevId: 5e407fdaa30eccc3d9ccb6cfb6830d2a606a0364
2026-01-05 15:51:37 +00:00

38 lines
788 B
PowerShell

param(
[Parameter(Mandatory = $true, Position = 0)]
[string]$root,
[Parameter(Mandatory = $true, Position = 1)]
[string]$build_target,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$rest
)
Set-StrictMode -Version Latest
$ErrorActionPreference = 'Stop'
$ProgressPreference = 'SilentlyContinue'
# See how Bazel java wrapper works
# Here we pass arguments to it in the following way:
# - "--debug" becomes "--debug"
# - everything else becomes "--jvm-arg=<value>"
$ARGS = @()
foreach ($arg in $rest) {
if ($arg -eq '--debug') {
$ARGS += '--debug'
} else {
$ARGS += "--jvm_flag=$arg"
}
}
Push-Location $root
try {
& (Join-Path $root 'bazel.cmd') run $build_target -- @ARGS
$exitCode = $LASTEXITCODE
} finally {
Pop-Location
}
exit $exitCode