Skip to content

Commit c471dc6

Browse files
author
Kapil Borle
committed
Remove parameter sets from build script
1 parent d739f53 commit c471dc6

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

build.ps1

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
[CmdletBinding()]
22
param(
3-
[Parameter(ParameterSetName='Build')]
43
[ValidateSet('PSV3 Debug','PSV3 Release','Debug','Release')]
54
[string] $Configuration = 'Debug',
65

7-
[Parameter(ParameterSetName='Build')]
6+
[switch] $BuildSolution = $false,
7+
88
[switch] $CleanSolution = $false,
99

10-
[Parameter(ParameterSetName='Documentation')]
11-
[switch] $Documentation = $false,
10+
[switch] $BuildDocs = $false,
1211

13-
[Parameter(ParameterSetName='Clean')]
14-
[switch] $Clean = $false,
12+
[switch] $CleanOutput = $false,
1513

16-
[Parameter(ParameterSetName='Install')]
1714
[switch] $Install = $false
1815
)
1916

@@ -49,23 +46,22 @@ if (-not (Test-Path $buildCmd))
4946
throw "cannot find build.cmd"
5047
}
5148

49+
if ($CleanOutput)
50+
{
51+
Remove-Item -Recurse $outPath\* -Force -Verbose:$verbosity
52+
}
5253

53-
if ($PSCmdlet.ParameterSetName -eq 'Clean')
54+
if ($CleanSolution)
5455
{
55-
Remove-Item -Recurse $outPath\* -Force
56+
& $buildCmd $solutionPath $Configuration 'clean'
5657
}
5758

58-
if ($PSCmdlet.ParameterSetName -eq 'Build')
59+
if ($BuildSolution)
5960
{
60-
if ($CleanSolution)
61-
{
62-
& $buildCmd $solutionPath $Configuration 'clean'
63-
return
64-
}
6561
& $buildCmd $solutionPath $Configuration
6662
}
6763

68-
if ($PSCmdlet.ParameterSetName -eq 'Documentation')
64+
if ($BuildDocs)
6965
{
7066
$docsPath = Join-Path $projectRoot 'docs'
7167
$markdownDocsPath = Join-Path $docsPath 'markdown'
@@ -91,7 +87,7 @@ if ($PSCmdlet.ParameterSetName -eq 'Documentation')
9187
New-ExternalHelp -Path $markdownDocsPath -OutputPath $outputDocsPath -Force -Verbose:$verbosity
9288
}
9389

94-
if ($PSCmdlet.ParameterSetName -eq 'Install')
90+
if ($Install)
9591
{
9692
$modulePath = Join-Path (Split-Path $profile) 'Modules'
9793
if (-not (Test-Path $modulePath))

0 commit comments

Comments
 (0)