Browse Source

Merge branch 'build-script' of 501st-Aux-Team/501st-Aux-Mod into master

Hobnob 3 years ago
parent
commit
24a1c0e5cc
2 changed files with 33 additions and 0 deletions
  1. 32 0
      build.ps1
  2. 1 0
      include.txt

+ 32 - 0
build.ps1

@@ -0,0 +1,32 @@
+param ([String[]] $only)
+
+# Create folders
+$buildPath = '.\@501st Community Auxiliary Mod\addons'
+New-Item $buildPath -ItemType Directory -Force
+
+$buildPath = Resolve-Path $buildPath
+$includePath = Resolve-Path '.\include.txt'
+
+$addonBuilder = Join-Path (Get-ItemProperty "HKCU:\Software\Bohemia Interactive\Arma 3 Tools").path "AddonBuilder\AddonBuilder.exe"
+
+function Build-Addon
+{
+    param ([string] $addonFolder)
+    $addonPath = Resolve-Path ".\addons - Copy\$addonFolder"
+    & "$addonBuilder" $addonPath $buildPath -prefix="rd501" -clear -include="$includePath"
+}
+
+if ($PSBoundParameters.ContainsKey('only'))
+{
+    foreach($addonFolder in $only)
+    {
+        Build-Addon -addonFolder $addonFolder
+    }
+}
+else
+{
+    foreach($addonFolder in Get-ChildItem -Directory '.\addons - Copy')
+    {
+        Build-Addon -addonFolder $addonFolder
+    }
+}

+ 1 - 0
include.txt

@@ -0,0 +1 @@
+*.p3d;*.paa;*.ogg;*.rvmat;*.sqf;*.xml;*.jpg;*.wss