forked from RamblingCookieMonster/PSSQLite
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpsakeFile.ps1
More file actions
44 lines (37 loc) · 2.15 KB
/
Copy pathpsakeFile.ps1
File metadata and controls
44 lines (37 loc) · 2.15 KB
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
# PowerShellBuild's Analyze task resolves this project-local wrapper at runtime.
# Keep it in its own correspondingly named file with the rest of the build tools.
. (Join-Path -Path $PSScriptRoot -ChildPath 'tools/Test-PSBuildScriptAnalysis.ps1')
properties {
# PowerShellBuild's bundled BuildHelpers does not discover manifests at
# src/<ModuleName>/<ModuleName>.psd1, so restore the exact module settings
# seeded by build.ps1 after PowerShellBuild initializes its defaults.
$moduleManifestPath = $env:BHPSModuleManifest
$moduleSourcePath = Split-Path -Path $moduleManifestPath -Parent
$moduleName = [System.IO.Path]::GetFileNameWithoutExtension($moduleManifestPath)
$PSBPreference.General.SrcRootDir = $moduleSourcePath
$PSBPreference.General.ModuleManifestPath = $moduleManifestPath
$PSBPreference.General.ModuleName = $moduleName
$PSBPreference.Test.RootDir = Join-Path -Path $env:BHProjectPath -ChildPath 'Tests'
$env:BHPSModulePath = $moduleSourcePath
$env:BHModulePath = $moduleSourcePath
$env:BHProjectName = $moduleName
# Set this to $true to create a module with a monolithic PSM1
$PSBPreference.Build.CompileModule = $false
$PSBPreference.Help.DefaultLocale = 'en-US'
$PSBPreference.Test.OutputFile = 'out/testResults.xml'
}
# Run static analysis before Pester initializes its test runspaces. This avoids
# a PSScriptAnalyzer null-reference failure observed after Pester on PowerShell 7.6.4.
$PSBTestDependency = @('Analyze', 'Pester')
$PSBStageFilesDependency = @('RestoreNestedModuleBuildEnvironment')
task RestoreNestedModuleBuildEnvironment -depends Clean {
# Initialize-PSBuild calls BuildHelpers once more. Restore the nested src
# values before any task stages, tests, or publishes the module.
$env:BHProjectName = $PSBPreference.General.ModuleName
$env:BHModulePath = $PSBPreference.General.SrcRootDir
$env:BHPSModulePath = $PSBPreference.General.SrcRootDir
$env:BHPSModuleManifest = $PSBPreference.General.ModuleManifestPath
}
task Default -depends Test
task Test -FromModule PowerShellBuild -minimumVersion '0.8.2'
task Publish -FromModule PowerShellBuild -minimumVersion '0.8.2'