-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
38 lines (35 loc) · 1.32 KB
/
build.ps1
File metadata and controls
38 lines (35 loc) · 1.32 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
<#
Build script for LocalNetAppChat
Usage: ./build.ps1 [command]
Commands: build, test, publish, clean
#>
param(
[string]$Command = "build"
)
$SolutionPath = "Source/LocalNetAppChat"
switch ($Command) {
"build" {
Write-Host "Building solution..." -ForegroundColor Cyan
dotnet build $SolutionPath --configuration Release
}
"test" {
Write-Host "Running tests..." -ForegroundColor Cyan
dotnet test $SolutionPath --verbosity normal
}
"publish" {
Write-Host "Publishing applications..." -ForegroundColor Cyan
dotnet publish "$SolutionPath/LocalNetAppChat.Server/LocalNetAppChat.Server.csproj" -c Release -o publish/server
dotnet publish "$SolutionPath/LocalNetAppChat.ConsoleClient/LocalNetAppChat.ConsoleClient.csproj" -c Release -o publish/client
dotnet publish "$SolutionPath/LocalNetAppChat.Bot/LocalNetAppChat.Bot.csproj" -c Release -o publish/bot
Write-Host "Published to ./publish/" -ForegroundColor Green
}
"clean" {
Write-Host "Cleaning..." -ForegroundColor Cyan
dotnet clean $SolutionPath
if (Test-Path "publish") { Remove-Item -Recurse -Force "publish" }
}
default {
Write-Host "Unknown command: $Command" -ForegroundColor Red
Write-Host "Available: build, test, publish, clean"
}
}