-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.ps1
More file actions
25 lines (22 loc) · 991 Bytes
/
build.ps1
File metadata and controls
25 lines (22 loc) · 991 Bytes
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
[CmdletBinding()]
param(
[Parameter(Position = 0)]
[string[]]$Target,
[string]$Configuration,
[string]$PackageVersion,
[string]$NuGetSource,
[string]$NuGetApiKey,
[switch]$Help,
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$NukeArgs
)
$parameters = @()
if ($Target) { $parameters += "--target"; $parameters += $Target }
if ($Configuration) { $parameters += "--configuration"; $parameters += $Configuration }
if ($PackageVersion) { $parameters += "--package-version"; $parameters += $PackageVersion }
if ($NuGetSource) { $parameters += "--nuget-source"; $parameters += $NuGetSource }
$effectiveApiKey = if ($NuGetApiKey) { $NuGetApiKey } else { $env:NUGET_API_KEY }
if ($effectiveApiKey) { $parameters += "--nuget-api-key"; $parameters += $effectiveApiKey }
if ($Help) { $parameters += "--help" }
if ($NukeArgs) { $parameters += $NukeArgs }
dotnet run --project "build/Build.csproj" -- @parameters