Skip to content

Commit 99b35fe

Browse files
committed
0.0.3 Updates
1 parent a3d76cc commit 99b35fe

160 files changed

Lines changed: 17307 additions & 1097 deletions

File tree

Some content is hidden

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

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"files.trimTrailingWhitespace": true,
66

77
"search.exclude": {
8-
"Release": true
8+
"release": true,
9+
"temp": true
910
},
1011

1112
//-------- PowerShell Configuration --------

Build.ps1

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,12 @@ param (
88
[parameter(Position = 2, ParameterSetName = 'Build')]
99
[switch]$UploadPSGallery,
1010
[parameter(Position = 3, ParameterSetName = 'Build')]
11-
[switch]$GitCheckin,
12-
[parameter(Position = 4, ParameterSetName = 'Build')]
13-
[switch]$GitPush,
14-
[parameter(Position = 5, ParameterSetName = 'Build')]
1511
[switch]$InstallAndTestModule,
16-
[parameter(Position = 6, ParameterSetName = 'Build')]
12+
[parameter(Position = 4, ParameterSetName = 'Build')]
1713
[version]$NewVersion,
18-
[parameter(Position = 7, ParameterSetName = 'Build')]
14+
[parameter(Position = 5, ParameterSetName = 'Build')]
1915
[string]$ReleaseNotes,
20-
[parameter(Position = 8, ParameterSetName = 'CBH')]
16+
[parameter(Position = 6, ParameterSetName = 'CBH')]
2117
[switch]$InsertCBH
2218
)
2319

@@ -121,16 +117,6 @@ switch ($psCmdlet.ParameterSetName) {
121117
}
122118
}
123119

124-
# Not implemented yet
125-
if ($GitCheckin) {
126-
# Finish me
127-
}
128-
129-
# Not implemented yet
130-
if ($GitPush) {
131-
# Finish me
132-
}
133-
134120
CleanUp
135121
}
136122
}

ModuleBuild.build.ps1

Lines changed: 347 additions & 252 deletions
Large diffs are not rendered by default.

ModuleBuild.psd1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#
44
# Generated by: Zachary Loeber
55
#
6-
# Generated on: 6/8/2017
6+
# Generated on: 6/11/2017
77
#
88

99
@{
@@ -12,7 +12,7 @@
1212
RootModule = 'ModuleBuild.psm1'
1313

1414
# Version number of this module.
15-
ModuleVersion = '0.0.2'
15+
ModuleVersion = '0.0.3'
1616

1717
# Supported PSEditions
1818
# CompatiblePSEditions = @()

build/ModuleBuild.buildenvironment.ps1

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -111,21 +111,15 @@ if ((Get-Variable 'BuildEnv' -ErrorAction:SilentlyContinue) -eq $null) {
111111
$Script:BuildEnv | ConvertTo-Json | Out-File -FilePath $PersistentBuildFile -Encoding $Script:BuildEnv.Encoding -Force
112112
}
113113

114-
# If you will be attempting to autogenerate comment based help this is the base template that will be used
115-
# You need to leave the %%<string>%% tags to automatically be populated.
116-
$CBHTemplate = @'
117-
<#
118-
.SYNOPSIS
119-
TBD
120-
.DESCRIPTION
121-
TBD
122-
%%PARAMETER%%
123-
.EXAMPLE
124-
TBD
125-
.NOTES
126-
Author: %%AUTHOR%%
127-
.LINK
128-
%%LINK%%
129-
#>
130-
'@ -replace '%%LINK%%', $BuildEnv.ModuleWebsite -replace '%%AUTHOR%%', $BuildEnv.ModuleAuthor
114+
$RequiredModules = @('PlatyPS', 'Pester')
115+
116+
# Some optional modules
117+
if ($Script:BuildEnv.OptionAnalyzeCode) {
118+
$RequiredModules += 'PSScriptAnalyzer'
119+
}
120+
121+
if ($Script:BuildEnv.OptionGenerateReadTheDocs) {
122+
$RequiredModules += 'Powershell-YAML'
123+
}
124+
131125
}

build/docs/Additional/ChangeLog.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,17 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
44

55
## Version 0.0.1
66
- Initial release
7+
8+
## Version 0.0.2
9+
- Structural changes
10+
11+
## Version 0.0.3
12+
- Eliminated all '-Before' and '-After' in task definitions
13+
- Added 'Write-Description' helper function and converted all write-build lines to use it instead (for a quick indented output that is easier on the eyes)
14+
- Eliminated a large number of global variables in favor of simply redefining them in local tasks when required
15+
- Setup readthedocs.net yml file generation to fail with warning if the file already exists.
16+
- Fixed the version check to automatically fail if the build you are running already exists in the powershell gallery.
17+
- Applied the -force flag to several tasks where it made sense to do so (need to manually build with Invoke-Build and the -force parameter to use)
18+
- Fixed up Visual Studio Code tasks.json settings
19+
- Added a prebuild folder for processing dependant/separate scripts prior to starting your build
20+
- Updated much of the documentation.

build/docs/Additional/index.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,19 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
77
A scaffolding framework which can be used to kickstart a generic PowerShell module project.
88

99
## Why use the ModuleBuild Module?
10-
The answer is simple, it takes all the hard work out of authoring and maintaining your PowerShell module.
10+
The answer is simple, it takes all the hard work out of authoring and maintaining your PowerShell module. To see why this is simply take a look at some of the features.
1111

1212
### Features
1313
This build framework for PowerShell modules comes with several appealing baked in features which include;
1414
- Fully portable project directory structure and build process. So portable that you can copy it to another PowerShell 5.0 capable system and it should run the same.
15-
- Includes ability to scan for sensitive terms (like your company domain name or other items that you may not want published)
1615
- Automatically combine your public and private functions into one clean psm1 file at build time.
1716
- Automatically update your psd1 file with public functions at build time.
1817
- Automatically scan your module release with PSScriptAnalyzer
1918
- Automatically upload your script to the PowerShell Gallery (with appropriate API key)
2019
- Automatically create project documentation folder structure and yml definition file for ReadTheDocs.org integration
2120
- Visual Studio Code integration (tasks)
22-
- Easy to manage build configuration with forward compatible design
23-
21+
- Easy to manage build configuration with forward compatible design and easy to use commands
22+
- Includes ability to scan for sensitive terms (like your company domain name or other items that you may not want published)
2423

2524
## Installation
2625
ModuleBuild is available on the [PowerShell Gallery](https://www.powershellgallery.com/packages/ModuleBuild/).

build/docs/ReadTheDocs/Introduction/Introduction.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,17 @@ There are a few premises which should be known about this project.
77

88
- I use serveral PowerShell 5 features but this doesn't mean that the underlying modules being created need to require PowerShell 5 (the default manifest file that gets created sets the required version to 3).
99

10-
- Most documentation for the module gets automatically created as part of the build process. This documentation is created from the comment based help associated with every function. I personally find this to be the easiest way to keep my documentation up to date. All the code and tasks are open to be changed though. The beauty of a task based engine like invoke-build is that you can very easily use the existing tasks and create your own customizations.
11-
12-
- Parts of this scaffolding were written specifically around the premise that the project is hosted in github.
10+
- Most documentation for the module gets automatically created as part of the build process. This documentation is created from the comment based help associated with every function.
1311

1412
- The general idea of the base module is that you will develop and test it out without having to worry about keeping your manifest file up to date with your public functions. When you finally build the module, then the functions are explicitly injected into the manifest file and the source files are all (optionally) combined into one psm1 for distribution.
1513

16-
- I've included a handful of other tasks that can be run directly with invoke-build. This includes testing out the documentation generation and code formatting. They are not included in the wrapper script at this time as it felt a bit like recreating a wheel (becase invoke-build is so easy to use as it is).
17-
1814
## Folder Structure
1915
A default ModuleBuild project scaffold will look like the following for a project named 'ModuleName' with build version 0.0.1 sucessfully built.
2016
```
2117
ProjectRootFolder
2218
- .vscode
2319
settings.json
2420
tasks.json
25-
- EN-us
26-
about_ModuleName.help.txt
2721
- src
2822
- other
2923
preload.ps1
@@ -50,13 +44,21 @@ ProjectRootFolder
5044
ModuleName-0.0.1.zip
5145
ModuleName-current.zip
5246
- build
53-
- cleanup
47+
- startup
48+
- shutdown
5449
- dotsource
5550
- docs
5651
- Additional
52+
Acknowledgements.md
53+
ChangeLog.md
54+
Contributing.md
55+
Index.md
56+
ReleaseNotes.md
5757
- ReadTheDocs
5858
- Home
5959
index.md
60+
- EN-us
61+
about_ModuleName.help.txt
6062
ModuleName.buildenvironment.json
6163
ModuleName.buildenvironment.ps1
6264
- tests

build/docs/ReadTheDocs/Usage/1 - Initialization.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
# Step 1 - Initialization
2-
Simply download this project and run the Initialize.ps1 script. You will be prompted for a destination folder and the rest of the project settings. The destination folder will be the home of your future project but is completely portable. This is simply a wrapper for a custom version of Plaster that calls a template file I created for the project. It is fairly simple to deconstruct and use plaster directly via invoke-plaster and pass all the parameters via command line if desired.
2+
Simply download this project and run the Initialize-ModuleBuild exported function. You will be prompted for a destination folder and the rest of the project settings. The destination folder will be the home of your future project but is completely portable. This is simply a wrapper for a custom version of Plaster that calls a template file I created for the project. It is fairly simple to deconstruct and use plaster directly via invoke-plaster and pass all the parameters via command line if desired.
3+
4+
`Import-Module ModuleBuild`
5+
6+
`Initialize-ModuleBuild`
7+
8+
or
9+
10+
`Initialize-ModuleBuild -Path 'c:\temp\mymodule'`
311

4-
`.\Initialize.ps1`
512

613
Once this has been kicked off and all answers have been entered the initialization of your new project directory will start. Several template files are copied out to appropriate locations. Additionally, the default module manifest file gets created.
714

build/startup/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Note
2+
3+
Any ps1 files in this directory are run at the start of your build.

0 commit comments

Comments
 (0)