Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"recommendations": [
"ms-vscode.powershell",
"pspester.pester-test",
"tylerleonhardt.vscode-inline-values-powershell",
"psake.psake-vscode",
"DavidAnson.vscode-markdownlint"
]
}
24 changes: 21 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,28 @@
"version": "0.2.0",
"configurations": [
{
"name": "PowerShell: Debug Tests",
"type": "PowerShell",
"request": "launch",
"name": "PowerShell Interactive Session",
"cwd": ""
"script": "./build.ps1",
"args": ["-Task", "Test"],
"createTemporaryIntegratedConsole": false
},
{
"name": "PowerShell: Debug Tests (Temp Console)",
"type": "PowerShell",
"request": "launch",
"script": "./build.ps1",
"args": ["-Task", "Test"],
"createTemporaryIntegratedConsole": true
},
{
"name": "PowerShell: Load Source Module (Temp Console)",
"type": "PowerShell",
"request": "launch",
"script": "./build.ps1",
"args": ["-Task", "Init"],
"createTemporaryIntegratedConsole": true
}
]
}
}
13 changes: 12 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,16 @@
"powershell.codeFormatting.whitespaceAroundOperator": false,
"powershell.codeFormatting.whitespaceBeforeOpenParen": false,
"powershell.codeFormatting.preset": "OTBS",
"powershell.codeFormatting.trimWhitespaceAroundPipe": true
"powershell.codeFormatting.trimWhitespaceAroundPipe": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"editor.insertSpaces": true,
"editor.tabSize": 4,
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/*.code-search": true,
"**/.ruby-lsp": true,
"Output/**": true
}
}
83 changes: 83 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
// Start PowerShell (pwsh on *nix)
"windows": {
"options": {
"shell": {
"executable": "pwsh.exe",
"args": [
"-NoProfile",
"-ExecutionPolicy",
"Bypass",
"-Command"
]
}
}
},
"linux": {
"options": {
"shell": {
"executable": "/usr/bin/pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
}
},
"osx": {
"options": {
"shell": {
"executable": "/usr/local/bin/pwsh",
"args": [
"-NoProfile",
"-Command"
]
}
}
},
"tasks": [
{
"label": "Clean",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Clean -Verbose"
},
{
"label": "Test",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Test -Verbose",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": "$pester"
},
{
"label": "Analyze",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Analyze -Verbose"
},
{
"label": "Pester",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Pester -Verbose",
"problemMatcher": "$pester"
},
{
"label": "Build",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Build -Verbose",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "Publish",
"type": "shell",
"command": "${cwd}/build.ps1 -Task Publish -Verbose"
}
]
}
17 changes: 15 additions & 2 deletions PSDepend/PSDepend.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@
# NestedModules = @()

# Functions to export from this module
FunctionsToExport = @('Get-Dependency','Get-PSDependScript','Get-PSDependType','Import-Dependency','Install-Dependency','Invoke-DependencyScript','Invoke-PSDepend','Test-Dependency')
# Generated by the build process
FunctionsToExport = @(
'Get-Dependency',
'Get-PSDependScript',
'Get-PSDependType',
'Import-Dependency',
'Install-Dependency',
'Invoke-DependencyScript',
'Invoke-PSDepend',
'Test-Dependency'
)

# Cmdlets to export from this module
CmdletsToExport = '*'
Expand Down Expand Up @@ -96,7 +106,10 @@
# IconUri = ''

# ReleaseNotes of this module
ReleaseNotes = 'Added various PowerShell Core fixes thanks to @lipkau!'
ReleaseNotes = 'https://github.com/PowerShellOrg/PSDepend/blob/main/CHANGELOG.md'

# Prerelease string (e.g. 'beta1', 'rc2'). Empty string = stable release.
Prerelease = ''

} # End of PSData hashtable

Expand Down
21 changes: 21 additions & 0 deletions psakeFile.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,27 @@ Properties {
# and Build-PSBuildMarkdown has a Remove-Module scope bug specific to PSDepend.
$PSBBuildDependency = @('StageFiles')

# Override with: .\build.ps1 InstallLocal -Properties @{PreReleaseLabel='rc1'}
Task InstallLocal -Depends StageFiles {
$label = if ($PreReleaseLabel) { $PreReleaseLabel } else { "pre-$(git rev-parse --short HEAD)" }

Comment thread
HeyItsGilbert marked this conversation as resolved.
$moduleName = $PSBPreference.General.ModuleName
$stagedDir = $PSBPreference.Build.ModuleOutDir
$manifestPath = Join-Path $stagedDir "$moduleName.psd1"
$version = (Import-PowerShellDataFile $manifestPath).ModuleVersion

Update-Metadata -Path $manifestPath -PropertyName Prerelease -Value $label

$destRoot = Join-Path ([Environment]::GetFolderPath('MyDocuments')) 'PowerShell\Modules\PSDepend'
$destDir = Join-Path $destRoot "$version-$label"

if (Test-Path $destDir) {
Remove-Item $destDir -Recurse -Force
}
Copy-Item -Path $stagedDir -Destination $destDir -Recurse
Comment thread
HeyItsGilbert marked this conversation as resolved.
Write-Host "Installed PSDepend $version-$label -> $destDir"
}

Task Default -Depends Test

# PowerShellBuild adds the following tasks:
Expand Down
Loading