build.ps1 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. param(
  2. [switch]$FullBuild = $False,
  3. [switch]$Pause = $False
  4. )
  5. $pboProject = (Get-ItemProperty "HKCU:\Software\Mikero\pboProject\").exe
  6. $output = $(Join-Path $(Get-Location) "@501st Community Auxiliary Mod")
  7. $mods = @("501st_Helmets","RD501_Compositions","RD501_Droids","RD501_Droid_Dispenser","RD501_EMP","RD501_Helmets","RD501_Jumppack","RD501_Main","RD501_Markers","RD501_Particle_Effects","RD501_RDS","RD501_Units","RD501_Vehicles","RD501_Vehicle_Weapons","RD501_Weapons","RD501_Zeus","VenMK2")
  8. ForEach ($mod in $mods)
  9. {
  10. $target = "$output\addons\$mod.pbo"
  11. $LastModified = (Get-ChildItem "addons\$mod" -File -Recurse | Sort-Object LastWriteTime | Select-Object -Last 1).LastWriteTime
  12. $exists = Test-Path $target
  13. if($exists){ $LastBuilt = (Get-ChildItem $target).LastWriteTime }
  14. if($exists -And -Not $FullBuild -And $LastBuilt -gt $LastModified)
  15. {
  16. Write-Verbose "$mod Up to Date, skipping."
  17. }
  18. else
  19. {
  20. Write-Output "==Building $mod=="
  21. $args = @()
  22. if(-Not $Pause){ $args += "-P" }
  23. $args += "-M=$output"
  24. $args += "P:\$mod"
  25. & "$pboProject" @args
  26. Wait-Process pboProject
  27. if(Test-Path $target)
  28. {
  29. Write-Output " Successfully Built $mod."
  30. }
  31. else
  32. {
  33. Write-Output " $mod Build Failed."
  34. Write-Output $(Get-Content "P:\temp\$mod.packing.log")
  35. }
  36. }
  37. }