This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
param(
|
||||
[string]$Configuration = "Release",
|
||||
[string]$ModsDir = ""
|
||||
)
|
||||
|
||||
$ErrorActionPreference = "Stop"
|
||||
|
||||
$projectPath = Join-Path $PSScriptRoot "__PROJECT_NAME__.csproj"
|
||||
dotnet build $projectPath -c $Configuration /nr:false
|
||||
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
exit $LASTEXITCODE
|
||||
}
|
||||
|
||||
$artifactDir = Join-Path $PSScriptRoot ("artifacts\" + $Configuration)
|
||||
$dllPath = Join-Path $artifactDir "__PROJECT_NAME__.dll"
|
||||
|
||||
Write-Host "Build completed: $dllPath"
|
||||
|
||||
if ([string]::IsNullOrWhiteSpace($ModsDir)) {
|
||||
return
|
||||
}
|
||||
|
||||
New-Item -ItemType Directory -Force -Path $ModsDir | Out-Null
|
||||
Copy-Item -LiteralPath $dllPath -Destination (Join-Path $ModsDir "__PROJECT_NAME__.dll") -Force
|
||||
|
||||
$pdbPath = Join-Path $artifactDir "__PROJECT_NAME__.pdb"
|
||||
if (Test-Path -LiteralPath $pdbPath) {
|
||||
Copy-Item -LiteralPath $pdbPath -Destination (Join-Path $ModsDir "__PROJECT_NAME__.pdb") -Force
|
||||
}
|
||||
|
||||
Write-Host "Copied artifacts to: $ModsDir"
|
||||
Reference in New Issue
Block a user