Skip to content

Commit

Permalink
Updates build script
Browse files Browse the repository at this point in the history
  • Loading branch information
MihaMarkic committed Jan 19, 2024
1 parent 8064349 commit 4377b0d
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion src/build.ps1
@@ -1,3 +1,19 @@
<#
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
#>

[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[ValidateSet("Default", "UnitTest", "NuGetPack")]
[string]$Target
)

$ErrorActionPreference = 'Stop'

Set-Location -LiteralPath $PSScriptRoot
Expand All @@ -9,5 +25,11 @@ $env:DOTNET_NOLOGO = '1'
dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

dotnet cake @args
# Build Cake arguments
$cakeArguments = @("$Script");
if ($Target) { $cakeArguments += "--target=$Target" }

# Start Cake
Write-Host "Running build script..."
dotnet cake $cakeArguments
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }

0 comments on commit 4377b0d

Please sign in to comment.