42 lines
1.0 KiB
PowerShell
42 lines
1.0 KiB
PowerShell
Remove-Job *
|
|
|
|
$tasks = 0
|
|
$start = Get-Date
|
|
|
|
$tasks++
|
|
Write-Output "building proxy for windows amd64..."
|
|
Start-Job -ScriptBlock {
|
|
$env:GOOS = "windows"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_win_amd64.exe main.go
|
|
} | Out-Null
|
|
|
|
$tasks++
|
|
Write-Output "building proxy for linux amd64..."
|
|
Start-Job -ScriptBlock {
|
|
$env:GOOS = "linux"; $env:GOARCH = "amd64"; go build -ldflags '-w -s' -o bin/proxy_linux_amd64 main.go
|
|
} | Out-Null
|
|
|
|
$tasks++
|
|
Write-Output "building proxy for linux arm64..."
|
|
Start-Job -ScriptBlock {
|
|
$env:GOOS = "linux"; $env:GOARCH = "arm64"; go build -ldflags '-w -s' -o bin/proxy_linux_arm64 main.go
|
|
} | Out-Null
|
|
|
|
# Wait for all jobs to complete
|
|
while ($tasks -gt 0)
|
|
{
|
|
foreach ($job in Get-Job)
|
|
{
|
|
if ($job.State -eq "Completed")
|
|
{
|
|
$tasks--
|
|
$job | Receive-Job
|
|
$job | Remove-Job
|
|
}
|
|
}
|
|
}
|
|
|
|
$end = Get-Date
|
|
|
|
Write-Output "build completed"
|
|
Write-Output "time taken: $( ($end - $start).TotalSeconds ) seconds"
|
|
Write-Output "output files are in ./bin/" |