Skip to content

Project structure refactor#228

Merged
devblackops merged 39 commits intomasterfrom
project-layout
Nov 21, 2017
Merged

Project structure refactor#228
devblackops merged 39 commits intomasterfrom
project-layout

Conversation

@devblackops
Copy link
Copy Markdown
Member

Big project refactor here but should not see any externally facing behavior.

Summary of changes

  • Refactored module to use one file per function.
  • Moved to comment-based help instead of MAML and generated MD files using PlatyPS. This should make it easier to keep the help up to date and to include MD files in the RTD site.
  • Updated nuget.exe to 4.3.0.4406.
  • Added chocolateyUninstall.ps1 script to Chocolatey package.
  • Update Linux/macOS tests to use PowerShell 6.0.0-rc and new pwsh executable name. #4214
  • Added VSCode tasks.
  • Updated build.ps1 to include common build tasks (PSScriptAnalyzer, Pester, BuildNuget) for the project and a basic implementation of task dependencies. Borrowed from @Jaykul's gist. Not ready for psake tasks to manage psake just yet 😏

Related Issue

#226
#225
#197

How Has This Been Tested?

Manually ran test suite on Windows 10 and macOS with no issues. AppVeyor tests pass but oddly the Travis ones do not. This will have to be tracked down.

@PowerSchill, you added the Travis tests initially, maybe you can take a peek and see if I messed something up?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

This is only to prevent an exception from being thrown when using the "Framework" function and specifying "1.1.0" or "2.0.0" and won't be found in [$env:windir\Microsoft.NET\]
…s dependencies and will be executed automatically
@devblackops
Copy link
Copy Markdown
Member Author

devblackops commented Nov 21, 2017

The term 'LoadConfiguration' is not recognized as the name of a cmdlet, function, script file, or
operable program.

Interesting. That is the same error that Travis spits out. https://travis-ci.org/psake/psake/jobs/305103591#L531

On my personal mac the tests run clean. In the travis macOS build, Pester runs but fails on a few. Something is afoot.

@devblackops
Copy link
Copy Markdown
Member Author

Yeah, I guess if build.ps1 were a psake file you'd need a older version to bootstrap the build of psake. :-)

I wasn't ready to go that meta yet. 😄

@rkeithhill
Copy link
Copy Markdown
Contributor

Ah, case-sensitivity on Linux is biting us. These two lines in psm1 should be:

$public = @(Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -ChildPath 'public/*.ps1') -Recurse -ErrorAction Stop)
$private = @(Get-ChildItem -Path (Join-Path -Path $PSScriptRoot -ChildPath 'private/*.ps1') -Recurse -ErrorAction Stop)

I would recommend using EA stop because the SilentlyContinue was hiding the real error.

Also because we no longer support PS2, can we change the ModuleToProcess in the manifest to RootModule?

@rkeithhill
Copy link
Copy Markdown
Contributor

With the above fix, only two Pester tests fail on Linux:

    [-] dotNetCore1.1.0_should_pass 324ms
      Expected: {True}
      But was:  {False}
      52:             $psake.build_success | should -be $expectedResult
      at Invoke-Assertion, /home/hillr/.local/share/powershell/Modules/Pester/4.1.0/Functions/Assertions/Should.ps1: line 209
      at <ScriptBlock>, /mnt/c/Users/Keith/GitHub/psake/psake/tests/integration/spec.tests.ps1: line 52
    [-] dotNetCore2.0_should_pass 378ms
      Expected: {True}
      But was:  {False}
      52:             $psake.build_success | should -be $expectedResult
      at Invoke-Assertion, /home/hillr/.local/share/powershell/Modules/Pester/4.1.0/Functions/Assertions/Should.ps1: line 209
      at <ScriptBlock>, /mnt/c/Users/Keith/GitHub/psake/psake/tests/integration/spec.tests.ps1: line 52

This is probably something simple to figure out.

@rkeithhill
Copy link
Copy Markdown
Contributor

This line in tasks.json isn't needed:

    "type": "process",

Each of the tasks is declaring its type as shell.

@rkeithhill
Copy link
Copy Markdown
Contributor

OK latest changes are looking good on Linux. Just those two test failures - and those are failing because I don't have dotnet installed in WSL.

@rkeithhill
Copy link
Copy Markdown
Contributor

Installed dotnet, now all Pester tests pass on Linux.

@devblackops
Copy link
Copy Markdown
Member Author

devblackops commented Nov 21, 2017

Awesome! I'm going to make your suggested changes re: src and create the Build task.

I agree we should have an about_psake.help.txt file but that shouldn't hold up a 4.7.0 release.

@rkeithhill
Copy link
Copy Markdown
Contributor

This is looking good! Can you add this to the settings.json file:

  "files.exclude": {
    "**/.git": true,
    "?.?.?/": true
  },

This will prevent workspace searches from find matches in the output folders.

@devblackops
Copy link
Copy Markdown
Member Author

@rkeithhill Done.

@rkeithhill
Copy link
Copy Markdown
Contributor

Do you want to bump the PSD1 version number in this PR to 4.7.0 or are you waiting to do that in a separate prep-release PR? Other than that, this PR is looking good!

@devblackops
Copy link
Copy Markdown
Member Author

I'll do another PR with the version bump and the final changes to the changelog.

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.

2 participants