PoshCode / ModuleBuilder

A PowerShell Module to help scripters write, version, sign, package, and publish.
MIT License
445 stars 54 forks source link

BREAKING CHANGE: addresses #65 and changes output path calculation #98

Closed Jaykul closed 3 years ago

Jaykul commented 4 years ago

A bunch of minor changes:

Jaykul commented 4 years ago

Since this changes the rules about WHERE the module builds to, it's obviously a breaking change, but I think it's pretty minor since it doesn't actually change the output, just where it goes.

However (aside from sticking in the minor fixes) this ended up being a larger changeset than I expected because the changes to the output location affected a lot of tests -- and a lot of them were already not passing on Linux & Mac OS.

Jaykul commented 4 years ago

I've been thinking that if I'm going to have a breaking change to the output location, maybe I want to default to Output\ModuleName\Version instead of Output\ModuleName and get rid of the -VersionedOutputFolder and replace it with -NoVersionFolder ....

Thoughts? Anyone?

kilasuit commented 4 years ago

Is this primarily so that you can have build iterations locally and do better side by side debugging as you are making changes to a module?

If so I can see where this would be useful as long as you didn't just wipe out the output\modulename folder

Jaykul commented 4 years ago

This is primarily so you don't screw up. In the current released version, if you do something stupid, like:

Build-Module -OutputPath C:\ -Target Clean

It will ... delete everything on C:\

So far, this changeset makes it so that it calculates an OutputDirectory

The proposed change which I have not implemented yet is that -VersionedOutputFolder would default to $true, so you'd (by default) get ..\Output\ModuleName\Version. The main purpose of that is:

  1. Allow keeping your old versions around
  2. Support building into the "ModuleName" source root
  3. Output the way it will be installed
Jaykul commented 3 years ago

I didn't feel like I got a lot of feedback one way or the other, so I've released two pre-release builds:

The first one is version "2.0.0-ModuleName" which represents the original PR at 20610d8 from two weeks ago.

The second one is version "2.0.0-VersionedOutput" which represents the current state, and includes the change to deprecate VersionedOutputFolder and have it default to true. It also adds a new UnversionedOutputFolder option that supports building without the forced version number folder (the old default), in case anyone really hates this change but doesn't speak up now...