Skip to content

Commit 85ed2d4

Browse files
committed
0.0.7 release
1 parent 5827e7c commit 85ed2d4

60 files changed

Lines changed: 2342 additions & 101 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.

ModuleBuild.build.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,7 @@ task PushVersionRelease {
543543
$null = Remove-Item $ThisReleasePath -Force -Recurse -ErrorAction 0
544544
$null = New-Item $ThisReleasePath -ItemType:Directory -Force
545545
Copy-Item -Path "$($StageReleasePath)\*" -Destination $ThisReleasePath -Recurse
546-
Out-Zip $StageReleasePath (Join-Path $ReleasePath "$($Script:BuildEnv.ModuleToBuild)-$Version.zip") -overwrite
546+
#Out-Zip $StageReleasePath (Join-Path $ReleasePath "$($Script:BuildEnv.ModuleToBuild)-$($Script:BuildEnv.ModuleVersion).zip") -overwrite
547547
}
548548

549549
# Synopsis: Create the current release directory and copy this build to it.
@@ -639,9 +639,9 @@ task CreateReadTheDocsYML -if {$Script:BuildEnv.OptionGenerateReadTheDocs} Confi
639639
$Pages = [ordered]@{}
640640

641641
$RTDFolders = Get-ChildItem -Path $ProjectDocsPath -Directory | Sort-Object -Property Name
642+
$RTDPages = Get-ChildItem -Path $ProjectDocsPath -File -Filter '*.md' | Sort-Object -Property Name
642643

643644
ForEach ($RTDFolder in $RTDFolders) {
644-
645645
$RTDocs = @(Get-ChildItem -Path $RTDFolder.FullName -Filter '*.md' | Sort-Object Name)
646646
if ($RTDocs.Count -gt 1) {
647647
$NewSection = @()
@@ -655,6 +655,10 @@ task CreateReadTheDocsYML -if {$Script:BuildEnv.OptionGenerateReadTheDocs} Confi
655655
}
656656
}
657657

658+
ForEach ($RTDPage in $RTDPages) {
659+
$Pages[$RTDPage.BaseName] = $RTDPage.Name
660+
}
661+
658662
$RTD = @{
659663
site_name = "$($Script:BuildEnv.ModuleToBuild) Docs"
660664
repo_url = $Script:BuildEnv.ModuleWebsite

Readme.md

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,30 +35,12 @@ This build framework for PowerShell modules comes with several appealing baked i
3535
- Visual Studio Code integration (tasks)
3636
- Easy to manage build configuration with forward compatible design and easy to use commands
3737
- Includes ability to scan for sensitive terms (like your company domain name or other items that you may not want published)
38+
- Functions for importing public and private functions from other projects into a ModuleBuild project
3839

3940
## Documentation
4041

4142
Visit the [ReadTheDocs.org documentation](http://modulebuild.readthedocs.io/en/latest/) that this module created a manifest for automatically.
4243

43-
## Versions
44-
45-
### Version 0.0.1
46-
- Initial release
47-
48-
### Version 0.0.2
49-
- Structural changes
50-
51-
### Version 0.0.3
52-
- Eliminated all '-Before' and '-After' in task definitions
53-
- 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)
54-
- Eliminated a large number of global variables in favor of simply redefining them in local tasks when required
55-
- Setup readthedocs.net yml file generation to fail with warning if the file already exists.
56-
- Fixed the version check to automatically fail if the build you are running already exists in the powershell gallery.
57-
- 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)
58-
- Fixed up Visual Studio Code tasks.json settings
59-
- Added a prebuild folder for processing dependant/separate scripts prior to starting your build
60-
- Updated much of the documentation.
61-
6244
## Contribute
6345

6446
Please feel free to contribute by opening new issues or providing pull requests.
@@ -72,6 +54,6 @@ More contributing information can be found [here](https://github.com/zloeber/Mod
7254

7355
## Other Information
7456

75-
**Author:** Zachary Loeber
57+
**Author:** [Zachary Loeber](https://www.the-little-things.net)
7658

7759
**Website:** https://github.com/zloeber/ModuleBuild

build/docs/Additional/Contributing.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloebe
55
There are some important things to be aware of if you plan on contributing to this project.
66

77
## Documentation
8-
All base project documentation changes should be made against the .\build\docs\Additional markdown files. These will populate and overwrite existing document files within the .\docs folder at build time. Additionally, if ReadTheDocs integration is enabled you should update the .\build\docs\ReadTheDocs markdown files. Note that each folder becomes its own section within ReadTheDocs and its own folder within the .\docs directory.
8+
All base project documentation changes should be made against the .\build\docs\Additional markdown files. These will populate and overwrite existing document files within the .\docs folder at build time. Additionally, you should update the .\build\docs\ReadTheDocs markdown files. Note that each folder becomes its own section within ReadTheDocs and its own folder within the .\docs directory.
99

1010
Finally, the Function documentation gets generated automatically based on the comment based help on each public/exported function. The function documentation markdown automatically gets populated within the .\docs\Functions folder as well as with the module release under its own docs folder. Private function CBH is not required but is encouraged.
1111

1212
## Development Environment
13-
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. The following tasks have been defined to make things a bit easier. First access the 'Pallette' (Shift+Ctrl+P or Shift+Cmd+P) and start typing in any of the following tasks to find and run them:
13+
While any text editor will work well there are included task and setting json files explicitly for Visual Studio Code included with this project. I used VS Code Insiders edition but standard edition should be fine as ewll. The following tasks have been defined to make things a bit easier. First access the 'Pallette' (Shift+Ctrl+P or Shift+Cmd+P) and start typing in any of the following tasks to find and run them:
1414

1515
- Build -> Runs the Build task (also can use Shift+Ctrl+B or Shift+Cmd+B)
1616
- Analyze -> Runs PSScriptAnalyzer against the src/public files.
1717
- CreateProjectHelp - Creates the project level help.
18-
- Test - Runs Pester tests.
1918
- InsertMissingCBH - Analyzes the existing public functions and inserts a template CBH if no CBH already exists and saves it into your scratch folder.
19+
20+
The plaster manifest file gets automatically recreated at build time so all you need to do is update the plasterparams.ps1 and/or plastercontent.ps1 in the plaster directory to include any required changes you need to make.
21+
22+
The plaster scaffolding files are largely standard files. But there are some template exceptions that you should be careful not to overwrite (any of the files that dynamically replace content from plaster input at creation time).

build/docs/Additional/ToDo.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,15 @@
22

33
Project Site: [https://github.com/zloeber/ModuleBuild](https://github.com/zloeber/ModuleBuild)
44

5-
There are many items which are possible and should probably be added to this project. Here are a few thoughts on ones I'll probably get addressed sooner or later;
5+
There are many items which are possible and should probably be added to this project. Here are a few thoughts on ones I'll probably get addressed sooner or later. I'm open to suggestions or pull requests.
66

77
- Update the sensitive parameter scans to be a pester test instead
88
- Add pre-gallary deployment pester tests for any files that will cause issues or cause the psscript analyzer at the gallery to fail (so files beginning with a period will not transfer, ps1 files in extra directories will cause analyzer failures, et cetera)
9-
- Create functions to pull exported functions from another loaded module (function only) and recreate them in the current module project directory would be cool.
9+
- ~~Create functions to pull functions from another module (function only) and recreate them in the current module project directory would be cool.~~
1010
- Better git tasks?
1111
- Include more useful base pester tests for standard modules
1212
- Automatic module version update options if uploading to the gallery
1313
- Automatic clean up of additional loaded modules when uploading to the gallery
1414
- Powershell Core compatibility
1515
- Automatic updates of the ReleaseNotes.md file
16+
- Appveyor integration

build/docs/Additional/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@ This build framework for PowerShell modules comes with several appealing baked i
1717
- Automatically scan your module release with PSScriptAnalyzer
1818
- Automatically upload your script to the PowerShell Gallery (with appropriate API key)
1919
- Automatically create project documentation folder structure and yml definition file for ReadTheDocs.org integration
20+
- Automatically generate module documentation with PlatyPS
2021
- Visual Studio Code integration (tasks)
2122
- Easy to manage build configuration with forward compatible design and easy to use commands
2223
- Includes ability to scan for sensitive terms (like your company domain name or other items that you may not want published)
24+
- Helper functions to import existing project private and public functions into your ModuleBuild based project
2325

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

build/docs/ReadTheDocs/Home/index.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

build/docs/ReadTheDocs/Introduction/Introduction.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@ There are a few premises which should be known about this project.
1111

1212
- 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.
1313

14+
## How it Works
15+
16+
Firstly, this module uses everything it creates in its own build process. Since this module is only mildly more complex than a simple script module that works out perfectly.
17+
18+
Aside from the handful of helper functions there is an included 'plaster' folder that includes a customized version of the module of the same name and a manifest folder named ModuleBuild. This ModuleBuild folder contains a scaffold directory structure used to create your projects. The questions asked as well as the actions taken when copying over the scaffold folder items are both contained in the root of the plaster directory in 'plastercontent.ps1' and 'plasterparameters.ps1' and are made into the plaster manifest file at build time.
19+
20+
The scaffolding itself is mostly a big invoke-build script.
21+
1422
## Folder Structure
1523
A default ModuleBuild project scaffold will look like the following for a project named 'ModuleName' with build version 0.0.1 sucessfully built.
1624
```

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ or
1212

1313
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.
1414

15+
**Note:** *Much of the ModuleBuild initial settings are not set in stone. If you do make changes to something like the included directories, or other settings which you would like to ensure others have access to when building your project you will have to update them in build\YourModuleName.buildenvironment.ps1*
16+
1517
## Quick Start
1618
With your new module folder all created there are several steps still left to take in order to make your new project more world class. There are several sections of the following documentation that go over fleshing out the module with public functions, building a release, testing things, out and starting another release. Here are some quick next step tips if you aren't feeling like reading all of that.
1719

@@ -22,5 +24,5 @@ With your new module folder all created there are several steps still left to ta
2224
5. But remember that the markdown files in .\build\docs\Additional need some love too. These get dropped into your project .\docs directory at build time (overwriting anything there in the process!)
2325
6. Update any bits within your *.psd1 that are appropriate to your module but don't mess with the exported function names as those get handled automatically when you do the build.
2426
7. If you enabled sensitive terminology scanning then review and update your terms defined in your buildenvironment.json file (using get-buildenvironment & set-buildenvironment).
25-
8. Build your project with .\Build.ps1
26-
9. If you have ReadTheDocs integration enabled make sure to re-organize mkdocs.yml to be ordered how you like then disable ReadTheDocs integration so the yml file doesn't get overwritten at next build time.
27+
8. Build your project with .\Build.ps1 (or in VS Code Ctrl+Shift+B)
28+
9. If you have ReadTheDocs integration enabled make sure to re-organize the generated mkdocs.yml to be ordered how you like before pushing your code to github.

build/docs/ReadTheDocs/Usage/5 - Publish A Release.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
# Step 5 - Upload A PowerShell Gallery Release (Optional)
22
If you have plans to upload your module to the PowerShell Gallery then this build script can help automate the process a bit. You will still need to create an account and attain an API key from the PowerShell Gallery [website](https://www.powershellgallery.com/).
33

4-
Once you have attained your API key you will need to update your build configuration file with it.
4+
Once you have attained your API key you will need to update your build configuration file with it. From witin your project root directory do the following:
55

6-
`notepad (Join-Path (Split-Path $profile) 'psgalleryapi.txt')`
6+
`Set-BuildEnvironment -NugetAPIKey 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx'`
77

88
Now when you are ready to upload to the psgallery simply run the following:
9+
910
`.\Build.ps1 -UploadPSGallery
1011

11-
Assuming you have a valid NugetAPI key in the psgalleryapi.txt file in your profile and your PowerShell manifest file has everything the gallary requires then this build step will automatically update the the upload the release directory module to the PowerShell Gallery for you.
12+
Assuming you have a valid NugetAPI key defined and your PowerShell manifest file has everything the gallary requires then this build step will automatically update the the upload the recent release directory module to the PowerShell Gallery for you.
1213

1314
**Note:** *I've not figured out yet how to reset versions when uploading to the gallery. You always have to upload a newer version than what is already there so be extra certain you are ready to publish the module before doing this step.*
1415

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Step 6 - Start Your Next Release
22

3-
To start working on your next release (or roll back to a prior release) you will need to update the version.txt file within your project directory. But if you go to build the current module again it will poop out as the version release in this file does not match the version found in your module manifest file. **This is by design**. In order to confirm you are ready to start working on this release you need to run the following.
3+
To start working on your next release (or roll back to a prior release) you will need to update the version of your module. This is easily done:
44

5-
`.\Build.ps1 -UpdateRelease`
6-
7-
**Note:** *This will spit out an error as we are running the Version task in safe mode and looking for an error. This lets us re-use the task that we use for loading the version number. If the final build shows as succeeded you have nothing to worry about though.*
5+
`.\Build.ps1 -NewVersion '0.0.5'`
86

97
Once this has been done you can proceed to build your module again:
108

119
`.\Build.ps1`
1210

1311
Oh, and if you have been paying attention up to this point you will have seen this coming. You can chain all this crap together into one command:
1412

15-
`.\Build.ps1 -UpdateRelease -NewVersion '0.0.4' -BuildModule -InstallAndTestModule -UploadPSGallery`
13+
`.\Build.ps1 -NewVersion '0.0.5' -BuildModule -InstallAndTestModule -UploadPSGallery -ReleaseNotes '0.0.5 release'`
14+
15+
It should be noted that performing the InstallAndTestModule build step is a bit superfluous as that gets done prior to uploading to the PSGallery as well. Also, you usually will be working on a release/build a bit before going straight to releasing to the gallery so I generally don't recommend doing everything in one fell swoop like this.

0 commit comments

Comments
 (0)