Skip to content

(GH185) Use more descriptive default build file name of psakefile.ps1#196

Merged
devblackops merged 11 commits intopsake:masterfrom
glennsarti:ticket/gh185/use-psakefile
Nov 9, 2017
Merged

(GH185) Use more descriptive default build file name of psakefile.ps1#196
devblackops merged 11 commits intopsake:masterfrom
glennsarti:ticket/gh185/use-psakefile

Conversation

@glennsarti
Copy link
Copy Markdown
Contributor

@glennsarti glennsarti commented Nov 8, 2016

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

  • Adds tests for the behaviour

  • Updates documentation with the new behaviour

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.
@glennsarti glennsarti force-pushed the ticket/gh185/use-psakefile branch 2 times, most recently from b0adb49 to 1e93c1b Compare November 8, 2016 04:59
This commit updates existing documentation with the new build file name and adds
a page describing the changes and the rationale behind them.
@glennsarti
Copy link
Copy Markdown
Contributor Author

bump

@gep13
Copy link
Copy Markdown
Member

gep13 commented Nov 23, 2016

@glennsarti I haven't forgotten about this, just working my way through the todo list 😢

@glennsarti
Copy link
Copy Markdown
Contributor Author

sok...I'll just keep bumping it :-)

@devblackops devblackops requested review from gep13 and removed request for gep13 November 8, 2017 06:21
@devblackops devblackops added this to the v4.7.0 milestone Nov 8, 2017
@devblackops devblackops self-requested a review November 8, 2017 06:32
@devblackops devblackops self-assigned this Nov 8, 2017
@devblackops
Copy link
Copy Markdown
Member

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]
[![Build status](https://ci.appveyor.com/api/projects/status/e8b90u1q1ex5hx9m?svg=true)](https://ci.appveyor.com/project/psake/psake)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My fault. I'll add it back.

Copy link
Copy Markdown
Member

@devblackops devblackops left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed badges

@devblackops devblackops merged commit 6dc54d2 into psake:master Nov 9, 2017
@glennsarti
Copy link
Copy Markdown
Contributor Author

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?

Copy link
Copy Markdown
Contributor

@rkeithhill rkeithhill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think @devblackops was trying to fix merge conflicts for this PR.

@devblackops
Copy link
Copy Markdown
Member

Yep. Just fixing merge conflicts since there was a flurry of changes last night.

theaquamarine added a commit to theaquamarine/ZLocation that referenced this pull request Jan 21, 2018
vors pushed a commit to vors/ZLocation that referenced this pull request Jan 21, 2018
* 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants