forked from cake-contrib/Cake.Curl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.ps1
49 lines (42 loc) · 1.45 KB
/
build.ps1
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
39
40
41
42
43
44
45
46
47
48
49
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will install the Cake .NET local tool
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER PackageOutputDirectory
The path of the directory where to put the packages produced by the build script.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.LINK
https://cakebuild.net
#>
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target = "Default",
[string]$Configuration = "Debug",
[string]$PackageOutputDirectory = "dist",
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity = "Verbose"
)
$CakeVersion = "1.0.0"
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
$ToolsDirectory = Join-Path $PSScriptRoot "tools"
$CakeTool = Join-Path $ToolsDirectory "dotnet-cake.exe"
Write-Host "Installing the Cake .NET local tool..."
dotnet tool install Cake.Tool --version $CakeVersion --tool-path $ToolsDirectory
Write-Host "Running the build script..."
& "$CakeTool" $Script @(
"--target=$Target",
"--configuration=$Configuration",
"--packageOutputDirectory=$PackageOutputDirectory",
"--verbosity=$Verbosity"
)
exit $LASTEXITCODE