22(
33 # Directory used to base all relative paths
44 [Parameter (Mandatory = $false )]
5- [string ] $BaseDirectory = " .. \" ,
5+ [string ] $BaseDirectory = " .\" ,
66 #
77 [Parameter (Mandatory = $false )]
88 [string ] $OutputDirectory = " .\build\release\" ,
@@ -23,12 +23,18 @@ param
2323 [string ] $LicensePath = " .\LICENSE" ,
2424 #
2525 [Parameter (Mandatory = $false )]
26- [switch ] $SkipMergingNestedModuleScripts
26+ [switch ] $SkipMergingNestedModuleScripts ,
27+ # If true, builds the module for production, otherwise builds a preview module that is installed with -AllowPrerelease
28+ [Parameter ()]
29+ [switch ]$ProductionBuild
2730)
2831
2932# # Initialize
3033Import-Module " $PSScriptRoot \CommonFunctions.psm1" - Force - WarningAction SilentlyContinue - ErrorAction Stop
3134
35+ # # Increment the build number
36+ & $PSScriptRoot \Set-Version.ps1 - preview:(! $ProductionBuild )
37+
3238[System.IO.DirectoryInfo ] $BaseDirectoryInfo = Get-PathInfo $BaseDirectory - InputPathType Directory - ErrorAction Stop
3339[System.IO.DirectoryInfo ] $OutputDirectoryInfo = Get-PathInfo $OutputDirectory - InputPathType Directory - DefaultDirectory $BaseDirectoryInfo.FullName - ErrorAction SilentlyContinue
3440[System.IO.DirectoryInfo ] $SourceDirectoryInfo = Get-PathInfo $SourceDirectory - InputPathType Directory - DefaultDirectory $BaseDirectoryInfo.FullName - ErrorAction Stop
@@ -86,4 +92,4 @@ if (!$SkipMergingNestedModuleScripts) {
8692}
8793
8894# # Sign Module
89- & $PSScriptRoot \Sign- PSModule.ps1 - ModuleManifestPath $OutputModuleManifestFileInfo.FullName | Format-Table Path, Status, StatusMessage
95+ # &$PSScriptRoot\Sign-PSModule.ps1 -ModuleManifestPath $OutputModuleManifestFileInfo.FullName | Format-Table Path, Status, StatusMessage
0 commit comments