forked from RainbowMage/OverlayPlugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
distribute.ps1
42 lines (33 loc) · 1.32 KB
/
distribute.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
Import-Module $PSScriptRoot\PS-Zip.psm1
# ビルド
./build.bat
# バージョン取得
$version = [System.Diagnostics.FileVersionInfo]::GetVersionInfo("Build\OverlayPlugin.dll").FileVersion
# フォルダ名
$buildFolder = ".\Build"
$fullFolder = ".\Distribute\OverlayPlugin-" + $version + "-full"
$updateFolder = ".\Distribute\OverlayPlugin-" + $version + "-update"
# フォルダが既に存在するなら消去
if ( Test-Path $fullFolder -PathType Container ) {
Remove-Item -Recurse -Force $fullFolder
}
if ( Test-Path $updateFolder -PathType Container ) {
Remove-Item -Recurse -Force $updateFolder
}
# フォルダ作成
New-Item -ItemType directory -Path $fullFolder
New-Item -ItemType directory -Path $updateFolder
# コピー
# full
xcopy /Y /R /S /EXCLUDE:full.exclude "$buildFolder\*" "$fullFolder"
# update
xcopy /Y /R "$buildFolder\HtmlRenderer.dll" "$updateFolder"
xcopy /Y /R "$buildFolder\OverlayPlugin.dll" "$updateFolder"
xcopy /Y /R "$buildFolder\README.md" "$updateFolder"
xcopy /Y /R "$buildFolder\LICENSE.txt" "$updateFolder"
xcopy /Y /R /S "$buildFolder\resources\*" "$updateFolder\resources\"
xcopy /Y /R /S "$buildFolder\ja-JP\*" "$updateFolder\ja-JP\"
# アーカイブ
New-ZipCompress -source $fullFolder -destination "$fullFolder.zip"
New-ZipCompress -source $updateFolder -destination "$updateFolder.zip"
pause