Skip to content

Commit

Permalink
Pipeline updated according to latest Sampler version (#7)
Browse files Browse the repository at this point in the history
* Updated pipeline to latest sampler scripts

* Switched to Windows PowerShell

* Cleanup

* Updated changelog

* Added task `FixEncoding` being able to run the build on Windows PowerShell.
  • Loading branch information
raandree authored Jan 15, 2023
1 parent 4192e2e commit 8488831
Show file tree
Hide file tree
Showing 7 changed files with 142 additions and 272 deletions.
258 changes: 0 additions & 258 deletions .build/CustomSamplerTasks.ps1

This file was deleted.

28 changes: 28 additions & 0 deletions .build/FixEncoding.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<#
.SYNOPSIS
Sets the encoding of all *.psd1 files to UTF8.
.DESCRIPTION
Sets the encoding of all *.psd1 files to UTF8. This is a build task that is
This task is only needed when the build runs on Windows PowerShell 5.1.
.NOTES
This is a build task that is primarily meant to be run by Invoke-Build but
wrapped by the Sampler project's build.ps1 (https://github.com/gaelcolas/Sampler).
#>

param ()

task FixEncoding {

Write-Build Yellow "Setting encoding to UTF8 for *.PSD1 files in path '$BuildModuleOutput'."
$utf8NoBomEncoding = New-Object System.Text.UTF8Encoding($false)

Get-ChildItem -Path $BuildModuleOutput -Filter *.psd1 -Recurse -File | ForEach-Object {

Write-Build DarkGray "`t'$($_.FullName)'."
$c = [System.IO.File]::ReadAllLines($_.FullName)
[System.IO.File]::WriteAllLines($_.FullName, $c, $utf8NoBomEncoding)
}
}
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ Begin
# The parameter has been explicitly used for calling the .build.ps1
if ($MyInvocation.BoundParameters.ContainsKey($cmdParameter))
{
$paramValue = $MyInvocation.BoundParameters.ContainsKey($cmdParameter)
$paramValue = $MyInvocation.BoundParameters.Item($cmdParameter)

Write-Debug " adding $cmdParameter :: $paramValue [from user-provided parameters to Build.ps1]"

Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updated badges.
- Merging with [CommonTasks](https://github.com/dsccommunity/CommonTasks).
- Updated pipeline to latest version of Sampler.

## [0.8.0] - 2022-04-21

Expand Down
Loading

0 comments on commit 8488831

Please sign in to comment.