build.ps1 852 B

1234567891011121314151617181920212223242526272829303132
  1. param ([String[]] $only)
  2. # Create folders
  3. $buildPath = '.\@501st Community Auxiliary Mod\addons'
  4. New-Item $buildPath -ItemType Directory -Force
  5. $buildPath = Resolve-Path $buildPath
  6. $includePath = Resolve-Path '.\include.txt'
  7. $addonBuilder = Join-Path (Get-ItemProperty "HKCU:\Software\Bohemia Interactive\Arma 3 Tools").path "AddonBuilder\AddonBuilder.exe"
  8. function Build-Addon
  9. {
  10. param ([string] $addonFolder)
  11. $addonPath = Resolve-Path ".\addons - Copy\$addonFolder"
  12. & "$addonBuilder" $addonPath $buildPath -prefix="rd501" -clear -include="$includePath"
  13. }
  14. if ($PSBoundParameters.ContainsKey('only'))
  15. {
  16. foreach($addonFolder in $only)
  17. {
  18. Build-Addon -addonFolder $addonFolder
  19. }
  20. }
  21. else
  22. {
  23. foreach($addonFolder in Get-ChildItem -Directory '.\addons - Copy')
  24. {
  25. Build-Addon -addonFolder $addonFolder
  26. }
  27. }