Skip to content

Commit 41e18b6

Browse files
committed
Improve build script.
1 parent 71261db commit 41e18b6

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

Pack.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,24 @@ if( ( $winFile.LastWriteTime - $xamarinFile.LastWriteTime ).Days -ne 0 )
3131
.\.nuget\nuget.exe pack $nuspec
3232

3333
# Unity
34-
Remove-Item .\MsgPack-CLI -Recurse
35-
Copy-Item .\bin\ .\MsgPack-CLI\ -Recurse
34+
if ( ![IO.Directory]::Exists( ".\MsgPack-CLI" ) )
35+
{
36+
New-Item .\MsgPack-CLI -Type Directory | Out-Null
37+
}
38+
39+
if ( ![IO.Directory]::Exists( ".\MsgPack-CLI\mpu" ) )
40+
{
41+
New-Item .\MsgPack-CLI\mpu -Type Directory | Out-Null
42+
}
43+
44+
Copy-Item .\bin\* .\MsgPack-CLI\ -Recurse
45+
Copy-Item .\tools\mpu\bin\* .\MsgPack-CLI\mpu\ -Recurse -Exclude @("*.vshost.*", "*.pdb")
3646
[Reflection.Assembly]::LoadWithPartialName( "System.IO.Compression.FileSystem" ) | Out-Null
3747
# 'latest' should be rewritten with semver manually.
38-
Remove-Item .\MsgPack.Cli.latest.zip
48+
if ( [IO.File]::Exists( ".\MsgPack.Cli.latest.zip" ) )
49+
{
50+
Remove-Item .\MsgPack.Cli.latest.zip
51+
}
3952
[IO.Compression.ZipFile]::CreateFromDirectory( ".\MsgPack-CLI", ".\MsgPack.Cli.latest.zip" )
4053
Remove-Item .\MsgPack-CLI -Recurse
4154

0 commit comments

Comments
 (0)