Skip to content

Commit 5c1e47f

Browse files
authored
Merge pull request #26 from jdarcyryan/bug/pipeline-fails-on-required-modules
[BUG] Pipeline fails on manifest RequiredModules
2 parents 01f4f02 + d571065 commit 5c1e47f

66 files changed

Lines changed: 7212 additions & 12 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# You can use the following:
2+
# Absolute paths
3+
# Relative paths
4+
# UNC paths
5+
# $ModuleRoot as "the path to the PSDepend module folder"
6+
NuGetPath=$ModuleRoot\nuget.exe
7+
GitPath=$ModuleRoot\git\git.exe
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<Configuration>
3+
<ViewDefinitions>
4+
<View>
5+
<Name>Default</Name>
6+
<ViewSelectedBy>
7+
<TypeName>PSDepend.Dependency</TypeName>
8+
</ViewSelectedBy>
9+
<ListControl>
10+
<ListEntries>
11+
<ListEntry>
12+
<ListItems>
13+
<ListItem>
14+
<PropertyName>DependencyName</PropertyName>
15+
</ListItem>
16+
<ListItem>
17+
<PropertyName>DependencyType</PropertyName>
18+
</ListItem>
19+
<ListItem>
20+
<PropertyName>Version</PropertyName>
21+
</ListItem>
22+
<ListItem>
23+
<Label>Tags</Label>
24+
<ScriptBlock>Try { ($_.Tags | Out-String ).trimend("`n")} Catch {$_.Tags} </ScriptBlock>
25+
</ListItem>
26+
</ListItems>
27+
</ListEntry>
28+
</ListEntries>
29+
</ListControl>
30+
</View>
31+
</ViewDefinitions>
32+
</Configuration>
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
@{
2+
3+
# Script module or binary module file associated with this manifest.
4+
RootModule = 'PSDepend.psm1'
5+
6+
# Version number of this module.
7+
ModuleVersion = '0.3.8'
8+
9+
# ID used to uniquely identify this module
10+
GUID = '63ea9e2a-320d-43ff-a11a-4930ca03cce6'
11+
12+
# Author of this module
13+
Author = 'Warren Frame'
14+
15+
# Company or vendor of this module
16+
#CompanyName = 'Unknown'
17+
18+
# Copyright statement for this module
19+
Copyright = '(c) 2016 Warren F. All rights reserved.'
20+
21+
# Description of the functionality provided by this module
22+
Description = 'PowerShell Dependency Handler'
23+
24+
# Minimum version of the Windows PowerShell engine required by this module
25+
PowerShellVersion = '3.0'
26+
27+
# Name of the Windows PowerShell host required by this module
28+
# PowerShellHostName = ''
29+
30+
# Minimum version of the Windows PowerShell host required by this module
31+
# PowerShellHostVersion = ''
32+
33+
# Minimum version of Microsoft .NET Framework required by this module
34+
# DotNetFrameworkVersion = ''
35+
36+
# Minimum version of the common language runtime (CLR) required by this module
37+
# CLRVersion = ''
38+
39+
# Processor architecture (None, X86, Amd64) required by this module
40+
# ProcessorArchitecture = ''
41+
42+
# Modules that must be imported into the global environment prior to importing this module
43+
# RequiredModules = @()
44+
45+
# Assemblies that must be loaded prior to importing this module
46+
# RequiredAssemblies = @()
47+
48+
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
49+
# ScriptsToProcess = @()
50+
51+
# Type files (.ps1xml) to be loaded when importing this module
52+
# TypesToProcess = @()
53+
54+
# Format files (.ps1xml) to be loaded when importing this module
55+
FormatsToProcess = 'PSDepend.Format.ps1xml'
56+
57+
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
58+
# NestedModules = @()
59+
60+
# Functions to export from this module
61+
FunctionsToExport = @('Get-Dependency','Get-PSDependScript','Get-PSDependType','Import-Dependency','Install-Dependency','Invoke-DependencyScript','Invoke-PSDepend','Test-Dependency')
62+
63+
# Cmdlets to export from this module
64+
CmdletsToExport = '*'
65+
66+
# Variables to export from this module
67+
# VariablesToExport = '*'
68+
69+
# Aliases to export from this module
70+
AliasesToExport = '*'
71+
72+
# DSC resources to export from this module
73+
# DscResourcesToExport = @()
74+
75+
# List of all modules packaged with this module
76+
# ModuleList = @()
77+
78+
# List of all files packaged with this module
79+
# FileList = @()
80+
81+
# Private data to pass to the module specified in RootModule/ModuleToProcess. This may also contain a PSData hashtable with additional module metadata used by PowerShell.
82+
PrivateData = @{
83+
84+
PSData = @{
85+
86+
# Tags applied to this module. These help with module discovery in online galleries.
87+
Tags = @('requirements', 'dependencies', 'dependency', 'manager', 'bundle', 'package')
88+
89+
# A URL to the license for this module.
90+
LicenseUri = 'https://github.com/RamblingCookieMonster/PSDepend/blob/master/LICENSE'
91+
92+
# A URL to the main website for this project.
93+
ProjectUri = 'https://github.com/RamblingCookieMonster/PSDepend/'
94+
95+
# A URL to an icon representing this module.
96+
# IconUri = ''
97+
98+
# ReleaseNotes of this module
99+
ReleaseNotes = 'Added various PowerShell Core fixes thanks to @lipkau!'
100+
101+
} # End of PSData hashtable
102+
103+
} # End of PrivateData hashtable
104+
105+
# HelpInfo URI of this module
106+
# HelpInfoURI = ''
107+
108+
# Default prefix for commands exported from this module. Override the default prefix using Import-Module -Prefix.
109+
# DefaultCommandPrefix = ''
110+
111+
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#Get public and private function definition files.
2+
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\*.ps1 -ErrorAction SilentlyContinue )
3+
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\*.ps1 -ErrorAction SilentlyContinue )
4+
$ModuleRoot = $PSScriptRoot
5+
6+
#Dot source the files
7+
Foreach($import in @($Public + $Private))
8+
{
9+
Try
10+
{
11+
. $import.fullname
12+
}
13+
Catch
14+
{
15+
Write-Error -Message "Failed to import function $($import.fullname): $_"
16+
}
17+
}
18+
19+
#Get nuget dependecy file if we don't have it
20+
Get-Content $ModuleRoot\PSDepend.Config |
21+
Where-Object {$_ -and $_ -notmatch "^\s*#"} |
22+
Foreach-Object {
23+
$Name = ( $_ -split '=')[0].trim()
24+
$Value = ( $_ -split '=')[1].trim()
25+
# Revisit later and only apply these for '*path', if we have other types of variables...
26+
$Value = $Value -replace '\$ModuleRoot', $ModuleRoot
27+
$Value = $ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($Value)
28+
Set-Variable -Name $Name -Value $Value
29+
}
30+
if(Test-PlatformSupport -Support 'windows') {
31+
BootStrap-Nuget -NugetPath $NuGetPath
32+
}
33+
34+
Export-ModuleMember -Function $Public.Basename
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
# This defines dependencies. Feel free to create your own
2+
# Top level node is the dependency name
3+
# Script is the script to run. These are stored in \PSDepend\PSDependScripts
4+
# Description is a quick description of the dependency script
5+
# Supports is a way to filter supported platforms: core, windows, macos, linux
6+
7+
# In some cases, it may be beneficial to include 'aliases'. Just add nodes for these.
8+
@{
9+
Chocolatey = @{
10+
Script = 'Chocolatey.ps1'
11+
Description = 'Install a Chocolatey package from a Chocolatey feed'
12+
Supports = 'windows'
13+
}
14+
15+
Command = @{
16+
Script = 'Command.ps1'
17+
Description = 'Invoke a command in PowerShell'
18+
Supports = 'windows', 'core', 'macos', 'linux'
19+
}
20+
21+
DotnetSdk = @{
22+
Script = 'DotnetSdk.ps1'
23+
Description = "Installs the .NET Core SDK"
24+
Supports = 'windows', 'core', 'macos', 'linux'
25+
}
26+
27+
FileDownload = @{
28+
Script = 'FileDownload.ps1'
29+
Description = 'Download a file'
30+
Supports = 'windows'
31+
}
32+
33+
FileSystem = @{
34+
Script = 'FileSystem.ps1'
35+
Description = 'Copy a file or folder'
36+
Supports = 'windows'
37+
}
38+
39+
Git = @{
40+
Script = 'Git.ps1'
41+
Description = 'Clone a git repository'
42+
Supports = 'windows', 'core', 'macos', 'linux'
43+
}
44+
45+
GitHub = @{
46+
Script = 'GitHub.ps1'
47+
Description = 'Download and extract a GitHub repo'
48+
Supports = 'windows', 'core', 'macos', 'linux'
49+
}
50+
51+
Npm = @{
52+
Script = 'Npm.ps1'
53+
Description = 'Install a node package'
54+
Supports = 'windows', 'core', 'macos', 'linux'
55+
}
56+
57+
Noop = @{
58+
Script = 'Noop.ps1'
59+
Description = 'Display parameters that a depends script would receive. Use for testing and validation'
60+
Supports = 'windows', 'core', 'macos', 'linux'
61+
}
62+
63+
Nuget = @{
64+
Script = 'Nuget.ps1'
65+
Description = 'Install a Nuget package from a Nuget feed'
66+
Supports = 'windows', 'core', 'macos', 'linux'
67+
}
68+
69+
Package = @{
70+
Script = 'Package.ps1'
71+
Description = 'EXPERIMENTAL: Install a package via PackageManagement Install-Package'
72+
Supports = 'windows', 'core', 'macos', 'linux'
73+
}
74+
75+
PSGalleryModule = @{
76+
Script= 'PSGalleryModule.ps1'
77+
Description = 'Install a PowerShell module from the PowerShell Gallery'
78+
Supports = 'windows', 'core', 'macos', 'linux'
79+
}
80+
81+
PSGalleryNuget = @{
82+
Script = 'PSGalleryNuget.ps1'
83+
Description = 'Install a PowerShell module from the PowerShell Gallery without the PowerShellGet dependency'
84+
Supports = 'windows', 'core', 'macos', 'linux'
85+
}
86+
87+
Task = @{
88+
Script = 'Task.ps1'
89+
Description = 'Support dependencies by handling simple tasks'
90+
Supports = 'windows', 'core', 'macos', 'linux'
91+
}
92+
}

0 commit comments

Comments
 (0)