11$editorFiles = @ (" MLAPIProfiler.cs" , " NetworkedAnimatorEditor.cs" , " NetworkedBehaviourEditor.cs" , " NetworkedObjectEditor.cs" , " NetworkingManagerEditor.cs" , " TrackedObjectEditor.cs" , " PostProcessScene.cs" )
2+ $libraryFiles = @ (" MLAPI.dll" , " MLAPI.xml" , " MLAPI.pdb" )
23$installerFiles = @ (" MLAPIEditor.cs" )
34
45$myPath = (Get-Item - Path " .\" ).FullName;
56$myPath = $myPath.Replace (" \" , " /" )
6- $basePath = -join ($myPath , " /MLAPI-Editor/" )
7+
8+ $libraryBasePath = -join ($myPath , " /MLAPI/bin/" )
9+ $editorBasePath = -join ($myPath , " /MLAPI-Editor/" )
710$builderPath = -join ($myPath , " /Libraries/Internal/UnityPackager/UnityPackager.exe" )
811
9- $editorOutPath = -join ($myPath , " /MLAPI-Editor .unitypackage" )
12+ $packageOutPath = -join ($myPath , " /MLAPI.unitypackage" )
1013$installerOutPath = -join ($myPath , " /MLAPI-Installer.unitypackage" )
1114
12- $windows = " true"
13-
14- $editorBuildArgs = " "
15- if ($windows -ne @ (" true" )) {
16- $editorBuildArgs += -join ($builderPath , " " )
17- }
18-
15+ # Args for library generation
16+ $libraryBuildArgs = -join (" null" , " " , $packageOutPath , " " )
1917
20- $editorBuildArgs += -join ($basePath , " " , $editorOutPath , " " )
18+ # Args for installer generation
19+ $installerBuildArgs = -join (" null" , " " , $installerOutPath , " " )
2120
21+ # Add editor files to library package
2222For ($i = 0 ; $i -lt $editorFiles.Count ; $i ++ )
2323{
24- $editorBuildArgs += -join ($basePath , $editorFiles.Get ($i ), " " )
25- $editorBuildArgs += -join (" Assets/Editor/MLAPI/" , $editorFiles.Get ($i ), " " )
24+ $libraryBuildArgs += -join ($editorBasePath , $editorFiles.Get ($i ), " " , " Assets/Editor/MLAPI/" , $editorFiles.Get ($i ), " " )
2625}
2726
28- $installerBuildArgs = " "
29- if ($windows -ne " true" ) {
30- $installerBuildArgs += -join ($builderPath , " " )
27+ # Add library files to library package
28+ For ($i = 0 ; $i -lt $libraryFiles.Count ; $i ++ )
29+ {
30+ $libraryBuildArgs += -join ($libraryBasePath , $libraryFiles.Get ($i ), " " , " Assets/MLAPI/Lib/" , $libraryFiles.Get ($i ), " " )
3131}
32- $installerBuildArgs += -join ($basePath , " " , $installerOutPath , " " )
3332
33+ # Add installer files to installer package
3434For ($i = 0 ; $i -lt $installerFiles.Count ; $i ++ )
3535{
36- $installerBuildArgs += -join ($basePath , $installerFiles.Get ($i ), " " )
37- $installerBuildArgs += -join (" Assets/Editor/MLAPI/" , $installerFiles.Get ($i ), " " )
38- }
39-
40- $myBuilderPath = " " ;
41- if ($windows -ne " true" ) {
42- $myBuilderPath = " mono"
43- } else {
44- $myBuilderPath = $builderPath
36+ $installerBuildArgs += -join ($editorBasePath , $installerFiles.Get ($i ), " " , " Assets/Editor/MLAPI/" , $installerFiles.Get ($i ), " " )
4537}
4638
47- Write-Host $myBuilderPath
39+ Write-Host $builderPath
40+ Write-Host $libraryBuildArgs
4841
49- Start-Process - FilePath $myBuilderPath - ArgumentList $editorBuildArgs
50- Start-Process - FilePath $myBuilderPath - ArgumentList $installerBuildArgs
42+ Start-Process - FilePath $builderPath - ArgumentList $libraryBuildArgs
43+ Start-Process - FilePath $builderPath - ArgumentList $installerBuildArgs
0 commit comments