Web-based Winamp controller for CarPC � Go backend, mobile-first UI
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

52 Zeilen
1.2KB

  1. #Requires -Version 5.1
  2. <#
  3. .SYNOPSIS
  4. Build roadamp.exe
  5. .PARAMETER OutDir
  6. Output directory. Defaults to the project root (where this script lives).
  7. .PARAMETER Version
  8. Version string embedded via -ldflags. Defaults to the current git tag/commit.
  9. .EXAMPLE
  10. .\build.ps1
  11. .\build.ps1 -OutDir C:\Deploy\roadamp
  12. #>
  13. param(
  14. [string]$OutDir = $PSScriptRoot,
  15. [string]$Version = ""
  16. )
  17. Set-StrictMode -Version Latest
  18. $ErrorActionPreference = 'Stop'
  19. Push-Location $PSScriptRoot
  20. try {
  21. # Resolve version from git if not supplied
  22. if (-not $Version) {
  23. $tag = git describe --tags --always --dirty 2>$null
  24. $Version = if ($tag) { $tag } else { "dev" }
  25. }
  26. $out = Join-Path $OutDir "roadamp.exe"
  27. Write-Host "Building roadamp $Version → $out" -ForegroundColor Cyan
  28. $env:GOOS = "windows"
  29. $env:GOARCH = "amd64"
  30. $env:CGO_ENABLED = "0"
  31. go build `
  32. -trimpath `
  33. -ldflags "-s -w -X main.Version=$Version" `
  34. -o $out `
  35. ./cmd/roadamp
  36. $size = [math]::Round((Get-Item $out).Length / 1MB, 2)
  37. Write-Host "Done $out (${size} MB)" -ForegroundColor Green
  38. }
  39. finally {
  40. Pop-Location
  41. }