psake / PowerShellBuild

Common build tasks for psake and Invoke-Build that build and test PowerShell modules
MIT License
134 stars 24 forks source link

Remove *.psm1 from file copy list #26

Closed PshMike closed 5 years ago

PshMike commented 5 years ago

Remove *.psm1 pattern from list of files to copy to output directory

Description

When using CompileModule flag the original psm1 need not be copied from the source directory because it is created by appending all *.ps1 files into a single file.

Including the original psm1 file in patterns to copy results in final psm1 file having original dot-sourcing code which isn't needed.

Change was to remove "*.psm1" pattern from list of those to be copied.

If not using CompileModule flag, the psm1 file is copied along with all other files in existing ELSE block

Related Issue

This PR is related to issue #25

Motivation and Context

Change results in correct PSM1 file being created for both modes of Module processing ( CompileModule = $true or $false )

How Has This Been Tested?

Minimally.

Testing involved using sample small module project included in boilerplate project created when using Stucco + Plaster.

Screenshots (if appropriate):

Types of changes

Checklist:

devblackops commented 5 years ago

When compiling all *.ps1 files into the PSM1, there isn't a requirement to have a source PSM1, it will be created during build. If there IS an existing PSM1, we'll copy it over and append to it. With PR #28 we now also have the capability to add both global headers/footers, and headers/footers per .ps1 file. With this, there should be little reason to have a source PSM1.