Skip to content

Commit 017811e

Browse files
authored
Merge pull request #22 from justin-p/0.3.0-release
0.3.0 release
2 parents 9b5dd8e + 466a3b7 commit 017811e

File tree

603 files changed

+17424
-40380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

603 files changed

+17424
-40380
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@ You may delete the guideline and text above to just leave the following details:
1212

1313
- OS: **INSERT OPERATING SYSTEM HERE**
1414
- PowerShell Version: **INSERT POWERSHELL VERSION HERE**
15-
- List the steps to reproduce the problem below (if possible attach a screenshot and/or link to the code): **LIST REPRO STEPS BELOW**
15+
- List the steps to reproduce the problem below (if possible attach a screenshot and/or link to the code): **LIST REPRO STEPS BELOW**

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ priorities of ModuleBuild's GitHub code might not match the
2323
priorities of the pull request. Don't fret, the open source community thrives on
2424
forks and GitHub makes it easy to keep your changes in a forked repo.
2525

26-
After reviewing the guidelines above you can delete this text from the pull request.
26+
After reviewing the guidelines above you can delete this text from the pull request.

.gitignore

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# ignore any temp directory (used in build steps)
22
temp/
33

4+
# Ignore PSDepend installed build modules dependencies.
5+
build/dependencies/PSDepend/*
6+
!build/dependencies/PSDepend/README.md
7+
!build/dependencies/PSDepend/build.depend.psd1
8+
49
# PSGallery publishing file can contain personal API key and paths and thus we want to ignore it if it exists
510
.psgallery
611

@@ -31,4 +36,4 @@ Desktop.ini
3136
$RECYCLE.BIN/
3237

3338
# Mac crap
34-
.DS_Store
39+
.DS_Store

.vscode/launch.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,4 @@
1818
}
1919
]
2020
}
21+

.vscode/settings.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,24 @@
66

77
"search.exclude": {
88
"release": true,
9-
"temp": true
9+
"": true
1010
},
1111

12+
//-------- Indentation --------
13+
14+
// The number of spaces a tab is equal to. This setting is overridden
15+
// based on the file contents when `editor.detectIndentation` is true.
16+
"editor.tabSize": 4,
17+
// Insert spaces when pressing Tab. This setting is overriden
18+
// based on the file contents when `editor.detectIndentation` is true.
19+
"editor.insertSpaces": true,
20+
// When opening a file, `editor.tabSize` and `editor.insertSpaces`
21+
// will be detected based on the file contents. Set to false to keep
22+
// the values you've explicitly set, above.
23+
"editor.detectIndentation": false,
1224
//-------- PowerShell Configuration --------
1325

1426
// Use a custom PowerShell Script Analyzer settings file for this workspace.
1527
// Relative paths for this setting are always relative to the workspace root dir.
1628
"powershell.scriptAnalysis.settingsPath": "PSScriptAnalyzerSettings.psd1"
17-
}
29+
}

.vscode/tasks.json

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
{
1010
// See https://go.microsoft.com/fwlink/?LinkId=733558
1111
// for the documentation about the tasks.json format
12-
"version": "2.0.0",
12+
"version": "2.0.0",
1313
"tasks": [
1414
{
1515
"label": "Build Module",
@@ -18,10 +18,10 @@
1818
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -BuildModule"
1919
},
2020
"linux": {
21-
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1"
21+
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule"
2222
},
2323
"osx": {
24-
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1"
24+
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule"
2525
},
2626
"group": {
2727
"kind": "build",
@@ -33,16 +33,16 @@
3333
}
3434
},
3535
{
36-
"label": "Build, Install, and Load Module",
36+
"label": "Run Tests",
3737
"type": "shell",
3838
"windows": {
39-
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule"
39+
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -Test"
4040
},
4141
"linux": {
42-
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule"
42+
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -Test"
4343
},
4444
"osx": {
45-
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule"
45+
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -Test"
4646
},
4747
"group": {
4848
"kind": "build",
@@ -51,20 +51,19 @@
5151
"presentation": {
5252
"reveal": "always",
5353
"panel": "new"
54-
},
55-
"problemMatcher": []
54+
}
5655
},
5756
{
58-
"label": "Build, Install, Load, and Publish Module",
57+
"label": "Test, Build, Install and Load Module",
5958
"type": "shell",
6059
"windows": {
61-
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule -UploadPSGallery"
60+
"command": "powershell.exe -NoLogo -NoProfile -ExecutionPolicy Bypass -File ${workspaceRoot}\\Build.ps1 -TestBuildAndInstallModule"
6261
},
6362
"linux": {
64-
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule -UploadPSGallery"
63+
"command": "/usr/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -TestBuildAndInstallModule"
6564
},
6665
"osx": {
67-
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -BuildModule -InstallAndTestModule -UploadPSGallery"
66+
"command": "/usr/local/bin/powershell -NoProfile -File ${workspaceRoot}\\Build.ps1 -TestBuildAndInstallModule"
6867
},
6968
"group": {
7069
"kind": "build",
@@ -73,8 +72,7 @@
7372
"presentation": {
7473
"reveal": "always",
7574
"panel": "new"
76-
},
77-
"problemMatcher": []
75+
}
7876
},
7977
{
8078
"label": "Insert Missing Comment Based Help",

Build.ps1

Lines changed: 88 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,46 @@
33
param (
44
[parameter(Position = 0, ParameterSetName = 'Build')]
55
[switch]$BuildModule,
6-
[parameter(Position = 2, ParameterSetName = 'Build')]
7-
[switch]$UploadPSGallery,
8-
[parameter(Position = 3, ParameterSetName = 'Build')]
9-
[switch]$InstallAndTestModule,
10-
[parameter(Position = 4, ParameterSetName = 'Build')]
6+
[parameter(Position = 1,ParameterSetName = 'Build')]
7+
[switch]$TestBuildAndInstallModule,
8+
[parameter(Position = 2, ParameterSetName = 'UpdateRelease')]
9+
[switch]$UpdateRelease,
10+
[parameter(Position = 3, ParameterSetName = 'UpdateRelease')]
1111
[version]$NewVersion,
12-
[parameter(Position = 5, ParameterSetName = 'Build')]
12+
[parameter(Position = 4, ParameterSetName = 'UpdateRelease')]
1313
[string]$ReleaseNotes,
14+
[parameter(Position = 5, ParameterSetName = 'UpdateRelease')]
15+
[switch]$UploadPSGallery,
1416
[parameter(Position = 6, ParameterSetName = 'CBH')]
15-
[switch]$AddCBH
17+
[switch]$AddMissingCBH,
18+
[parameter(Position = 7, ParameterSetName = 'Tests')]
19+
[switch]$Test,
20+
[parameter(Position = 8,ParameterSetName = 'Tests')]
21+
[switch]$TestMetaOnly,
22+
[parameter(Position = 9,ParameterSetName = 'Tests')]
23+
[switch]$TestUnitOnly,
24+
[parameter(Position = 10,ParameterSetName = 'Tests')]
25+
[switch]$TestIntergrationOnly
1626
)
1727

1828
function PrerequisitesLoaded {
1929
# Install required modules if missing
2030
try {
21-
if ((get-module InvokeBuild -ListAvailable) -eq $null) {
22-
Write-Output "Attempting to install the InvokeBuild module..."
23-
$null = Install-Module InvokeBuild -Scope:CurrentUser
31+
if ((get-module PSDepend -ListAvailable) -eq $null) {
32+
Write-Host "Attempting to install the PSDepend module..." -NoNewLine
33+
$null = Install-Module PSDepend -MinimumVersion 0.3.2 -MaximumVersion 0.3.2 -Scope:CurrentUser
34+
Write-Host 'Installed!'
2435
}
25-
if (get-module InvokeBuild -ListAvailable) {
26-
Write-Output -NoNewLine "Importing InvokeBuild module"
27-
Import-Module InvokeBuild -Force
28-
Write-Output '...Loaded!'
36+
if (get-module PSDepend -ListAvailable) {
37+
Write-Host "Importing PSDepend module..." -NoNewLine
38+
Import-Module PSDepend -Force
39+
Write-Host 'Loaded!'
40+
41+
Write-Host 'Installing dependencies...' -NoNewLine
42+
Invoke-PSDepend -Path $(Join-Path $(Get-Location) 'Requirements.psd1') -Test
43+
Invoke-PSDepend -Path $(Join-Path $(Get-Location) 'Requirements.psd1') -Force
44+
Invoke-PSDepend -Path $(Join-Path $(Get-Location) 'Requirements.psd1') -Import -Force
45+
Write-Host 'Installed!'
2946
return $true
3047
}
3148
else {
@@ -39,8 +56,8 @@ function PrerequisitesLoaded {
3956

4057
function CleanUp {
4158
try {
42-
Write-Output ''
43-
Write-Output 'Attempting to clean up the session (loaded modules and such)...'
59+
Write-Host ''
60+
Write-Host 'Attempting to clean up the session (loaded modules and such)...'
4461
Invoke-Build -Task BuildSessionCleanup
4562
Remove-Module InvokeBuild
4663
}
@@ -52,50 +69,49 @@ if (-not (PrerequisitesLoaded)) {
5269
}
5370

5471
switch ($psCmdlet.ParameterSetName) {
55-
'CBH' {
56-
if ($AddCBH) {
72+
'Build' {
73+
# If no parameters were specified or the build action was manually specified then kick off a standard build
74+
if (($psboundparameters.count -eq 0) -or ($BuildModule)) {
5775
try {
58-
Invoke-Build -Task AddMissingCBH
76+
Invoke-Build
5977
}
6078
catch {
61-
throw
79+
Write-Host 'Build Failed with the following error:'
80+
throw $_
6281
}
6382
}
6483

65-
CleanUp
66-
}
67-
'Build' {
68-
if ($NewVersion -ne $null) {
84+
# Test, Build Installd and test load the module
85+
if ($TestBuildAndInstallModule) {
6986
try {
70-
Invoke-Build -Task UpdateVersion -NewVersion $NewVersion -ReleaseNotes $ReleaseNotes
87+
Invoke-Build -Task TestBuildAndInstallModule
7188
}
7289
catch {
90+
Write-Host 'Test, Build Installd and test load the module of the module failed:'
7391
throw $_
7492
}
7593
}
76-
# If no parameters were specified or the build action was manually specified then kick off a standard build
77-
if (($psboundparameters.count -eq 0) -or ($BuildModule)) {
94+
}
95+
'CBH' {
96+
if ($AddMissingCBH) {
7897
try {
79-
Invoke-Build
98+
Invoke-Build -Task AddMissingCBH
8099
}
81100
catch {
82-
Write-Output 'Build Failed with the following error:'
83-
Write-Output $_
101+
throw $_
84102
}
85103
}
86-
87-
# Install and test the module?
88-
if ($InstallAndTestModule) {
104+
}
105+
'UpdateRelease' {
106+
if ($UpdateRelease) {
89107
try {
90-
Invoke-Build -Task InstallAndTestModule
108+
Invoke-Build -Task UpdateRelease -NewVersion $NewVersion -ReleaseNotes $ReleaseNotes
91109
}
92110
catch {
93-
Write-Output 'Install and test of module failed:'
94-
Write-Output $_
111+
throw $_
95112
}
96113
}
97114

98-
# Upload to gallery?
99115
if ($UploadPSGallery) {
100116
try {
101117
Invoke-Build -Task PublishPSGallery
@@ -104,7 +120,39 @@ switch ($psCmdlet.ParameterSetName) {
104120
throw 'Unable to upload project to the PowerShell Gallery!'
105121
}
106122
}
107-
108-
CleanUp
109123
}
110-
}
124+
'Tests' {
125+
if ($test) {
126+
try {
127+
Invoke-Build -Task tests
128+
}
129+
catch {
130+
throw
131+
}
132+
}
133+
if ($TestMetaOnly) {
134+
try {
135+
Invoke-Build -Task RunMetaTests
136+
}
137+
catch {
138+
throw
139+
}
140+
}
141+
if ($TestUnitOnly) {
142+
try {
143+
Invoke-Build -Task RunUnitTests
144+
}
145+
catch {
146+
throw
147+
}
148+
}
149+
if ($TestIntergrationOnly) {
150+
try {
151+
Invoke-Build -Task RunIntergrationTests
152+
}
153+
catch {
154+
throw
155+
}
156+
}
157+
}
158+
}

Install.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Run this in an administrative PowerShell prompt to install the ModuleBuild PowerShell module:
22
#
3-
# iex (New-Object Net.WebClient).DownloadString("https://github.com/zloeber/ModuleBuild/raw/master/Install.ps1")
3+
# iex (New-Object Net.WebClient).DownloadString("https://github.com/zloeber/ModuleBuild/raw/master/Install.ps1")
44

55
# Some general variables
66
$ModuleName = 'ModuleBuild'

License.md renamed to LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
<h6><a id="user-content-you-are-free-to" class="anchor" href="#you-are-free-to" aria-hidden="true"><span class="octicon octicon-link"></span></a>You are free to:</h6>
44

5-
<p><strong>Share</strong> — copy and redistribute the material in any medium or format </p>
5+
<p><strong>Share</strong> — copy and redistribute the material in any medium or format</p>
66

77
<p><strong>Adapt</strong> — remix, transform, and build upon the material </p>
88

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy