浏览代码

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

Hobnob 3 年之前
父节点
当前提交
24a1c0e5cc
共有 2 个文件被更改,包括 33 次插入0 次删除
  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