(GH185) Use more descriptive default build file name of psakefile.ps1#196
Conversation
Previously the spec test for the Framework command expected that .Net 4.0 output a 4.0 version for MSBuild, however, Framework 4.0 will report the latest version of MSBuild e.g. 4.6.1. This commit changes the assertion to expect a regular expression which contains the major version of 4.
This commit adds test fixtures and spec tests for the default build file loading behaviour.
Previously if there was only one test file the build tester would fail as it was not an array type. This commit detects if the return type is not an array and if so, forces the return type by a simple array literal.
The default psake build file of default.ps1 is completely ambiguous without inspecting its contents. Rake has a Rakefile, bundle has a Gemfile etc. so instead, psake should use Psakefile.ps1 as the default build file name. This commit modifies the load behaviour for a default build file: - Refactored detecting the default build filename into it's own function - The `Get-DefaultBuildFile` will prefer to load the `buildFileName` file. If it does not exist it fall back to `legacyBuildFileName` and emit a deprecation warning if it exists. This allows all existing users to continue to use `default.ps1` and migrate to psakefile.ps1 when appropriate.
b0adb49 to
1e93c1b
Compare
This commit updates existing documentation with the new build file name and adds a page describing the changes and the rationale behind them.
|
bump |
|
@glennsarti I haven't forgotten about this, just working my way through the todo list 😢 |
|
sok...I'll just keep bumping it :-) |
|
I like it @glennsarti! |
README.md
Outdated
| [![Build status][appveyor-badge]][appveyor-build] | ||
| [![Build Status][travis-badge]][travis-build] | ||
| [![Join the chat at https://gitter.im/psake/psake][gitter-badge]][gitter] | ||
| [](https://ci.appveyor.com/project/psake/psake) |
There was a problem hiding this comment.
We lost the changes I made on this one. I think we could just copy/paste the top and bottom of the file I committed to this one and we'd have it.
There was a problem hiding this comment.
Or if it would be easier, you can go ahead and get this committed and I can resubmit another PR to put back my changes.
|
Is this the best place to be doing this in? i.e. Shouldn't these be in separate PRs? or at least on your own forks? |
There was a problem hiding this comment.
I think @devblackops was trying to fix merge conflicts for this PR.
|
Yep. Just fixing merge conflicts since there was a flurry of changes last night. |
default.ps1 is deprecated psake/psake#196
* Install psake from gallery rather than cloning * Install Pester from gallery rather than chocolatey * Change to use Assert-VerifiableMock Pester renamed Assert-VerifiableMocks to Assert-VerifiableMock, this causes a test to fail. * Rename default.ps1 to psakefile.ps1 default.ps1 is deprecated psake/psake#196
Resolves #185
The default psake build file of default.ps1 is completely ambiguous without
inspecting its contents. Rake has a Rakefile, bundle has a Gemfile etc. so
instead, psake should use Psakefile.ps1 as the default build file name.
This PR modifies the load behaviour for a default build file:
Refactored detecting the default build filename into it's own function
The
Get-DefaultBuildFilewill prefer to load thebuildFileNamefile. Ifit does not exist it fall back to
legacyBuildFileNameand emit a deprecationwarning if it exists. This allows all existing users to continue to use
default.ps1and migrate to psakefile.ps1 when appropriate.Adds tests for the behaviour
Updates documentation with the new behaviour