forked from Unity-Technologies/com.unity.netcode.gameobjects
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildUnityPackages.ps1
50 lines (38 loc) · 1.63 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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
$editorFiles = @("MLAPIProfiler.cs", "NetworkedAnimatorEditor.cs", "NetworkedBehaviourEditor.cs", "NetworkedObjectEditor.cs", "NetworkingManagerEditor.cs", "TrackedObjectEditor.cs", "PostProcessScene.cs")
$installerFiles = @("MLAPIEditor.cs")
$myPath = (Get-Item -Path ".\").FullName;
$myPath = $myPath.Replace("\", "/")
$basePath = -join ($myPath, "/MLAPI-Editor/")
$builderPath = -join ($myPath, "/Libraries/Internal/UnityPackager/UnityPackager.exe")
$editorOutPath = -join ($myPath, "/MLAPI-Editor.unitypackage")
$installerOutPath = -join ($myPath, "/MLAPI-Installer.unitypackage")
$windows = "true"
$editorBuildArgs = ""
if ($windows -ne @("true")) {
$editorBuildArgs += -join ($builderPath, " ")
}
$editorBuildArgs += -join ($basePath, " ", $editorOutPath, " ")
For ($i=0; $i -lt $editorFiles.Count; $i++)
{
$editorBuildArgs += -join ($basePath, $editorFiles.Get($i), " ")
$editorBuildArgs += -join ("Assets/Editor/MLAPI/", $editorFiles.Get($i), " ")
}
$installerBuildArgs = ""
if ($windows -ne "true") {
$installerBuildArgs += -join ($builderPath, " ")
}
$installerBuildArgs += -join ($basePath, " ", $installerOutPath, " ")
For ($i=0; $i -lt $installerFiles.Count; $i++)
{
$installerBuildArgs += -join ($basePath, $installerFiles.Get($i), " ")
$installerBuildArgs += -join ("Assets/Editor/MLAPI/", $installerFiles.Get($i), " ")
}
$myBuilderPath = "";
if ($windows -ne "true") {
$myBuilderPath = "mono"
} else {
$myBuilderPath = $builderPath
}
Write-Host $myBuilderPath
Start-Process -FilePath $myBuilderPath -ArgumentList $editorBuildArgs
Start-Process -FilePath $myBuilderPath -ArgumentList $installerBuildArgs