-
Notifications
You must be signed in to change notification settings - Fork 0
/
BuildUnityPackages.ps1
33 lines (24 loc) · 1.18 KB
/
BuildUnityPackages.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
$libraryFiles = @("Maria.Core.dll", "Maria.Platform.dll")
$editorFiles = Get-ChildItem -Path "./Maria.Editor/*.cs" -Recurse -Exclude "*AssemblyInfo.cs"
$editorFiles = $editorFiles.FullName.Replace("\", "/")
$myPath = (Get-Item -Path ".\").FullName;
$myPath = $myPath.Replace("\", "/")
$libraryBasePath = -join ($myPath, "/lib/")
$editorBasePath = -join ($myPath, "/Maria.Editor/")
$builderPath = -join ($myPath, "/Libraries/UnityPackager/UnityPackager.exe")
$packageOutPath = -join ($myPath, "/Maria.unitypackage")
# Args for library generation
$libraryBuildArgs = -join ("null", " ", $packageOutPath, " ")
# Add library files to library package
For ($i=0; $i -lt $libraryFiles.Count; $i++)
{
$libraryBuildArgs += -join ($libraryBasePath, $libraryFiles.Get($i), " ", "Assets/Plugins/Maria/", $libraryFiles.Get($i), " ")
}
# Add editor files to library package under a different path
For ($i=0; $i -lt $editorFiles.Count; $i++)
{
$libraryBuildArgs += -join ($editorFiles.Get($i), " ", "Assets/Editor/Maria/", $editorFiles.Get($i).Replace($editorBasePath, ""), " ")
}
Write-Host $builderPath
Write-Host $libraryBuildArgs
Start-Process -FilePath $builderPath -ArgumentList $libraryBuildArgs