Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a helper function to reduce code duplication #125

Closed
johlju opened this issue Feb 7, 2020 · 1 comment · Fixed by #156
Closed

Create a helper function to reduce code duplication #125

johlju opened this issue Feb 7, 2020 · 1 comment · Fixed by #156
Labels
enhancement The issue is an enhancement request.

Comments

@johlju
Copy link
Collaborator

johlju commented Feb 7, 2020

(Get-ChildItem $BuildRoot\*\*.psd1 -Exclude 'build.psd1', 'analyzersettings.psd1' | Where-Object {
($_.Directory.Name -match 'source|src' -or $_.Directory.Name -eq $_.BaseName) -and
$(try
{
Test-ModuleManifest $_.FullName -ErrorAction Stop
}
catch
{
Write-Warning $_
$false
}) }
).BaseName

@johlju johlju added enhancement The issue is an enhancement request. help wanted The issue is up for grabs for anyone in the community. labels Feb 7, 2020
@johlju johlju changed the title Create a helper function to reduce code coverage Create a helper function to reduce code duplication Feb 8, 2020
@gaelcolas
Copy link
Owner

That'd be great.
Whoever tackle this, please make sure there's no precedence issue (Sampler must be loaded before the tasks using that function are imported), and make sure build.ps1 does not depend on Sampler.
Reason is that build.ps1 can be used to bootstrap something else than a module, and may be use with something else than Sampler (low coupling, high cohesion).

It is, however, tightly coupled with Invoke-Build, powershell-yaml, and Resolve-Dependency.ps1 currently (but not an issue as long as we know about it).

@johlju johlju added in progress The issue is being actively worked on by someone. and removed help wanted The issue is up for grabs for anyone in the community. labels Apr 24, 2020
johlju added a commit to johlju/Sampler that referenced this issue Apr 24, 2020
johlju added a commit to johlju/Sampler that referenced this issue Apr 24, 2020
johlju added a commit to johlju/Sampler that referenced this issue Apr 24, 2020
johlju added a commit that referenced this issue Apr 24, 2020
### Fixed

- When there are multiple module manifest found in the repository the build
  now fails with a a better error error message (issue #155).

### Changed

- Update tasks to reduce code duplication (issue #125).
- Task 'Merge_CodeCoverage_Files' did not use the parameter `ProjectName`
  to that parameter was removed.
@johlju johlju removed the in progress The issue is being actively worked on by someone. label Apr 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement The issue is an enhancement request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants