Skip to content

Commit 41ec47e

Browse files
johljuPlagueHO
andauthored
ComputerManagementDsc: Class-based resources re-use module DscResource.Base (#405)
* ComputerManagementDsc: Class-based resources re-use module DscResource.Base * Fix CHANGELOG.md * Fix CHANGELOG.md * Merge branch 'main' into f/remove-resourcebase Co-Authored-By: Daniel Scott-Raynsford <PlagueHO@users.noreply.github.com>
1 parent 03395c4 commit 41ec47e

16 files changed

Lines changed: 16 additions & 852 deletions

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2828
in the module manifest in the source folder as the built module is
2929
automatically updated with this information by the pipeline - Fixes [Issue #396](https://github.com/dsccommunity/ComputerManagementDsc/issues/396).
3030
- Moved the build step of the pipeline to a Windows build worker when running in Azure DevOps.
31+
- The class-based resources are now re-using the module DscResource.Base - Fixes [Issue #404](https://github.com/dsccommunity/ComputerManagementDsc/issues/404).
32+
- Removed the file `source/build.psd1` as it is no longer required for the
33+
build pipeline.
3134

3235
## [8.5.0] - 2021-09-13
3336

RequiredModules.psd1

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
'DscResource.AnalyzerRules' = 'latest'
2121
'DscResource.DocGenerator' = 'latest'
2222
'DscResource.Common' = 'latest'
23+
'DscResource.Base' = 'latest'
2324
xDscResourceDesigner = 'latest'
2425
LoopbackAdapter = 'latest'
2526
}

build.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ NestedModule:
2121
AddToManifest: false
2222
Exclude: PSGetModuleInfo.xml
2323

24+
DscResource.Base:
25+
CopyOnly: true
26+
Path: ./output/RequiredModules/DscResource.Base
27+
AddToManifest: false
28+
Exclude: PSGetModuleInfo.xml
29+
2430
####################################################
2531
# Pipeline Configuration #
2632
####################################################
@@ -62,6 +68,7 @@ Pester:
6268
OutputFormat: NUnitXML
6369
ExcludeFromCodeCoverage:
6470
- Modules/DscResource.Common
71+
- Modules/DscResource.Base
6572
Script:
6673
- tests/Unit
6774
ExcludeTag:
@@ -78,6 +85,7 @@ DscTest:
7885
- output
7986
ExcludeModuleFile:
8087
- Modules/DscResource.Common
88+
- Modules/DscResource.Base
8189
MainGitBranch: main
8290

8391
Resolve-Dependency:

source/Build.psd1

Lines changed: 0 additions & 5 deletions
This file was deleted.

source/Classes/010.ResourceBase.ps1

Lines changed: 0 additions & 260 deletions
This file was deleted.

source/Classes/020.PSResourceRepository.ps1

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ class PSResourceRepository : ResourceBase
112112
[Nullable[System.Boolean]]
113113
$Default
114114

115-
PSResourceRepository () : base ()
115+
# Passing the module's base directory to the base constructor so it finds localization files.
116+
PSResourceRepository () : base ($PSScriptRoot)
116117
{
117118
# These properties will not be enforced.
118119
$this.ExcludeDscProperties = @(

source/Enum/1.Ensure.ps1

Lines changed: 0 additions & 9 deletions
This file was deleted.

source/Private/ConvertFrom-CompareResult.ps1

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)