-
-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathbuild.ps1
More file actions
38 lines (29 loc) · 1.18 KB
/
build.ps1
File metadata and controls
38 lines (29 loc) · 1.18 KB
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
$PROJECT_NAME = "ASFEnhance"
$PLUGIN_NAME = "ASFEnhance.dll"
$PROJECT_NAME2 = "ASFEnhance.IPC"
$PLUGIN_NAME2 = "ASFEnhance.IPC.dll"
dotnet publish $PROJECT_NAME -o ./publish/ -c Release
dotnet publish $PROJECT_NAME2 -o ./publish/IPC/ -c Release
if (-Not (Test-Path -Path ./dist)) {
New-Item -ItemType Directory -Path ./dist
}
else {
Remove-Item -Path ./dist/* -Recurse -Force
}
Copy-Item -Path .\publish\$PLUGIN_NAME -Destination .\dist\
Copy-Item -Path .\publish\IPC\$PLUGIN_NAME2 -Destination .\dist\
$dirs = Get-ChildItem -Path ./publish -Directory
foreach ($dir in $dirs) {
$subFiles = Get-ChildItem -Path $dir.FullName -File -Filter *.resources.dll
foreach ($file in $subFiles) {
$resourceName = [System.IO.Path]::GetFileNameWithoutExtension($file.Name)
$opDir = "./dist/$resourceName"
if (-Not (Test-Path -Path $opDir)) {
New-Item -ItemType Directory -Path $opDir
}
$destinationPath = ".\dist\$resourceName\$($dir.Name).dll"
Copy-Item -Path $file -Destination $destinationPath
Write-Output "Copy resource DLL $($file.FullName) -> $destinationPath"
}
}
Remove-Item -Path ./publish -Recurse -Force