23 lines
1.1 KiB
PowerShell
23 lines
1.1 KiB
PowerShell
param(
|
|
[string]$HooksDevPath = (Join-Path $env:APPDATA 'XIVLauncher\addon\Hooks\dev')
|
|
)
|
|
$ErrorActionPreference = 'Stop'
|
|
Push-Location $PSScriptRoot
|
|
try {
|
|
dotnet restore BardFrontline.csproj --configfile NuGet.Config --nologo
|
|
if ($LASTEXITCODE -ne 0) { throw 'Plugin restore failed.' }
|
|
dotnet build BardFrontline.csproj -c Release "-p:HooksDevPath=$HooksDevPath" --no-restore --nologo
|
|
if ($LASTEXITCODE -ne 0) { throw 'Plugin build failed.' }
|
|
dotnet restore Tests/BardFrontline.Tests.csproj --configfile NuGet.Config --nologo
|
|
if ($LASTEXITCODE -ne 0) { throw 'Test restore failed.' }
|
|
dotnet run --project Tests/BardFrontline.Tests.csproj -c Release --no-restore
|
|
if ($LASTEXITCODE -ne 0) { throw 'Tests failed.' }
|
|
$bardDist = Join-Path $PSScriptRoot 'dist'
|
|
New-Item -ItemType Directory -Path $bardDist -Force | Out-Null
|
|
$bardPackage = @('bin/Release/BardFrontline.dll', 'bin/Release/BardFrontline.json')
|
|
$bardZip = Join-Path $bardDist 'BardFrontline-0.2.1.zip'
|
|
Compress-Archive -LiteralPath $bardPackage -DestinationPath $bardZip -Force
|
|
Get-Item -LiteralPath $bardZip
|
|
}
|
|
finally { Pop-Location }
|