Skip to content

Commit 7202036

Browse files
committed
build: Changed packaging to only use UnityPackages
1 parent 9c1435d commit 7202036

File tree

3 files changed

+35
-32
lines changed

3 files changed

+35
-32
lines changed

BuildUnityPackages.ps1

Lines changed: 21 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,50 +1,43 @@
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
2222
For ($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
3434
For ($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

appveyor.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ for:
3838
- configuration: Debug
3939
artifacts:
4040
- path: 'MLAPI\bin\Debug\*\*MLAPI*'
41+
after_build:
42+
- cp .\MLAPI\bin\Debug\*\*MLAPI* .\MLAPI\bin\
4143
test:
4244
assemblies:
4345
- 'MLAPI-Tests\bin\Debug\*\MLAPI-Tests.dll'
@@ -47,6 +49,8 @@ for:
4749
- configuration: Debug_Lite
4850
artifacts:
4951
- path: 'MLAPI\bin\Lite\Debug\*\*MLAPI*'
52+
after_build:
53+
- cp .\MLAPI\bin\Lite\Debug\*\*MLAPI* .\MLAPI\bin\
5054
test:
5155
assemblies:
5256
- 'MLAPI-Tests\bin\Lite\Debug\*\MLAPI-Tests.dll'
@@ -56,6 +60,8 @@ for:
5660
- configuration: Release
5761
artifacts:
5862
- path: 'MLAPI\bin\Release\*\*MLAPI*'
63+
after_build:
64+
- cp .\MLAPI\bin\Release\*\*MLAPI* .\MLAPI\bin\
5965
test:
6066
assemblies:
6167
- 'MLAPI-Tests\bin\Release\*\MLAPI-Tests.dll'
@@ -71,6 +77,8 @@ for:
7177
- configuration: Release_Lite
7278
artifacts:
7379
- path: 'MLAPI\bin\Lite\Release\*\*MLAPI*'
80+
after_build:
81+
- cp .\MLAPI\bin\Lite\Release\*\*MLAPI* .\MLAPI\bin\
7482
test:
7583
assemblies:
7684
- 'MLAPI-Tests\bin\Lite\Release\*\MLAPI-Tests.dll'

common.props

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<PropertyGroup>
33
<Configurations>Debug;Release;Debug_Lite;Release_Lite</Configurations>
44
<LangVersion>7</LangVersion>
5-
<DebugSymbols>false</DebugSymbols>
6-
<DebugType>None</DebugType>
5+
<DebugSymbols>true</DebugSymbols>
6+
<DebugType>Full</DebugType>
77
</PropertyGroup>
88

99

@@ -26,8 +26,10 @@
2626

2727
<PropertyGroup Condition="$(Configuration.Contains('Debug'))">
2828
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
29-
<DebugSymbols>true</DebugSymbols>
30-
<DebugType>Full</DebugType>
3129
<Optimize>false</Optimize>
3230
</PropertyGroup>
31+
32+
<PropertyGroup Condition="$(Configuration.Contains('Release'))">
33+
<Optimize>true</Optimize>
34+
</PropertyGroup>
3335
</Project>

0 commit comments

Comments
 (0)