-
Notifications
You must be signed in to change notification settings - Fork 0
/
compile.ps1
32 lines (26 loc) · 1.08 KB
/
compile.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
try {
# cd 到
$rootPath = $PWD;
# 編譯 net core web
$project = "$rootPath\Swagger2Doc.csproj"
$output = "$rootPath\publish"
if (-not (Test-Path -Path $output)) {
New-Item -ItemType Directory -Path $output
Write-Host "Folder created successfully."
} else {
Write-Host "Folder already exists."
}
# clear previous releases
Remove-Item "$output\*" -Recurse -Force
# dotnet publish $project -c Release -r win-x64 --no-self-contained -p:PublishSingleFile=true -o $output
dotnet publish $project -p:PublishSingleFile=true -c Release -r win-x64 --no-self-contained -o $output
# dotnet publish $project -c Release -o $output
# dotnet publish $project -c Release -r win-x64 --no-self-contained -p:PublishSingleFile=true -o $output
# dotnet publish $project -c Release -r win-x64 --no-self-contained -p:PublishSingleFile=true -o $output
# dotnet build $project -c Release -r linux-x64 -o $output
Read-Host -Prompt "Publish Success!"
}
catch {
Write-Output $Error[0]
}
Read-Host -Prompt "Press Enter to exit"