Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
name: Build on push

on: [push]

jobs:
build:
runs-on: windows-latest
Expand All @@ -19,10 +17,6 @@ jobs:
with:
version: ${{ steps.gitversion.outputs.LegacySemVerPadded }}
destination: ${{github.workspace}}/output
- name: Combine Configuration
run: |
$OutputModule, $NestedModule = (ConvertFrom-Json -Input '${{ steps.build.outputs.moduleinfo }}').Where({$_.Name -eq "Configuration"}, "Split")
& "${{github.workspace}}/.github/workflows/Merge-Module.ps1" -OutputModulePath $OutputModule.Path -NestedModulePath $NestedModule.Path
- name: Upload Build Output
uses: actions/upload-artifact@v2
with:
Expand All @@ -46,8 +40,9 @@ jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest, windows-2016] #, ubuntu-16.04, ubuntu-18.04, macos-latest]
os: [windows-latest, windows-2016, ubuntu-latest, macos-latest]
needs: build
steps:
- name: Download Build Output
Expand Down
46 changes: 5 additions & 41 deletions Build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -10,50 +10,14 @@ param(
)
Push-Location $PSScriptRoot -StackName BuildTestStack

if (!$SemVer -and (Get-Command gitversion -ErrorAction Ignore)) {
$PSBoundParameters['SemVer'] = gitversion -showvariable nugetversion
}
if (!$PSBoundParameters.ContainsKey("OutputDirectory")) {
$PSBoundParameters["OutputDirectory"] = $PSScriptRoot
if (-not $Semver -and (Get-Command gitversion -ErrorAction Ignore)) {
if ($semver = gitversion -showvariable SemVer) {
$null = $PSBoundParameters.Add("SemVer", $SemVer)
}
}

try {
## Build the actual module
$MetadataInfo = Build-Module -SourcePath .\Source\Metadata `
-Target CleanBuild -Passthru `
@PSBoundParameters

$ConfigurationInfo = Build-Module -SourcePath .\Source\Configuration `
-Target Build -Passthru `
@PSBoundParameters

# Copy and then remove the extra output
Copy-Item -Path (Join-Path $MetadataInfo.ModuleBase Metadata.psm1) -Destination $ConfigurationInfo.ModuleBase
Remove-Item $MetadataInfo.ModuleBase -Recurse

# Because this is a double-module, combine the exports of both modules
# Put the ExportedFunctions of both in the manifest
Update-Metadata -Path $ConfigurationInfo.Path -PropertyName FunctionsToExport `
-Value @(
@(
$MetadataInfo.ExportedFunctions.Keys
$ConfigurationInfo.ExportedFunctions.Keys
) | Select-Object -Unique
# @('*')
)

# Put the ExportedAliases of both in the manifest
Update-Metadata -Path $ConfigurationInfo.Path -PropertyName AliasesToExport `
-Value @(
@(
$MetadataInfo.ExportedAliases.Keys
$ConfigurationInfo.ExportedAliases.Keys
) | Select-Object -Unique
# @('*')
)

$ConfigurationInfo

Build-Module @PSBoundParameters -Target CleanBuild
} finally {
Pop-Location -StackName BuildTestStack
}
5 changes: 3 additions & 2 deletions RequiredModules.psd1
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@{
Configuration = "[1.3.1,2.0)"
Pester = "[4.10.1,5.0)"
ModuleBuilder = "[2.0.0,3.0)"
Metadata = "1.5.*"
Pester = "4.10.*"
ModuleBuilder = "2.0.*"
PSScriptAnalyzer = "1.19.1"
}
162 changes: 79 additions & 83 deletions Source/Configuration/Configuration.psd1 → Source/Configuration.psd1
Original file line number Diff line number Diff line change
@@ -1,83 +1,79 @@
@{

# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Configuration.psm1'

# Version number of this module.
ModuleVersion = '1.7.2'

# ID used to uniquely identify this module
GUID = 'e56e5bec-4d97-4dfd-b138-abbaa14464a6'

# Author of this module
Author = @('Joel Bennett')

# Company or vendor of this module
CompanyName = 'HuddledMasses.org'

# Copyright statement for this module
Copyright = 'Copyright (c) 2014-2019 by Joel Bennett, all rights reserved.'

# Description of the functionality provided by this module
Description = 'A module for storing and reading configuration values, with full PS Data serialization, automatic configuration for modules and scripts, etc.'

# Exports - populated by the build
FunctionsToExport = @('*')
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @('Get-StoragePath', 'Get-ManifestValue', 'Update-Manifest')

# List of all files packaged with this module
FileList = @('.\Configuration.psd1','.\Configuration.psm1','.\Metadata.psm1','.\en-US\about_Configuration.help.txt')

PrivateData = @{
# Allows overriding the default paths where Configuration stores it's configuration
# Within those folders, the module assumes a "powershell" folder and creates per-module configuration folders
PathOverride = @{
# Where the user's personal configuration settings go.
# Highest presedence, overrides all other settings.
# Defaults to $Env:LocalAppData on Windows
# Defaults to $Env:XDG_CONFIG_HOME elsewhere ($HOME/.config/)
UserData = ""
# On some systems there are "roaming" user configuration stored in the user's profile. Overrides machine configuration
# Defaults to $Env:AppData on Windows
# Defaults to $Env:XDG_CONFIG_DIRS elsewhere (or $HOME/.local/share/)
EnterpriseData = ""
# Machine specific configuration. Overrides defaults, but is overriden by both user roaming and user local settings
# Defaults to $Env:ProgramData on Windows
# Defaults to /etc/xdg elsewhere
MachineData = ""
}
# PSData is module packaging and gallery metadata embedded in PrivateData
# It's for the PoshCode and PowerShellGet modules
# We had to do this because it's the only place we're allowed to extend the manifest
# https://connect.microsoft.com/PowerShell/feedback/details/421837
PSData = @{
# The semver pre-release version information
PreRelease = ''

# Keyword tags to help users find this module via navigations and search.
Tags = @('Development','Configuration','Settings','Storage')

# The web address of this module's project or support homepage.
ProjectUri = "https://github.com/PoshCode/Configuration"

# The web address of this module's license. Points to a page that's embeddable and linkable.
LicenseUri = "http://opensource.org/licenses/MIT"

# Release notes for this particular version of the module
ReleaseNotes = '
- Fix bug in Get-Metadata with complex values (#19)
- Fix postfix/suffix
- Fix serialization of scriptblocks with single quotes
- Convert the modules to ModuleBuilder format
- Switch build to azure pipelines
- Clean up extra output lines in psd1 files
- Clean up exports
'
}
}

}


@{

# Script module or binary module file associated with this manifest.
ModuleToProcess = 'Configuration.psm1'

# Version number of this module.
ModuleVersion = '1.5.0'

# ID used to uniquely identify this module
GUID = 'e56e5bec-4d97-4dfd-b138-abbaa14464a6'

# Author of this module
Author = @('Joel Bennett')

# Company or vendor of this module
CompanyName = 'HuddledMasses.org'

# Copyright statement for this module
Copyright = 'Copyright (c) 2014-2021 by Joel Bennett, all rights reserved.'

# Description of the functionality provided by this module
Description = 'A module for storing and reading configuration values, with full PS Data serialization, automatic configuration for modules and scripts, etc.'

# Exports - populated by the build
FunctionsToExport = @('*')
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @('Get-StoragePath', 'Get-ManifestValue', 'Update-Manifest')
RequiredModules = @('Metadata')

# List of all files packaged with this module
FileList = @('.\Configuration.psd1','.\Configuration.psm1','.\en-US\about_Configuration.help.txt')

PrivateData = @{
# Allows overriding the default paths where Configuration stores it's configuration
# Within those folders, the module assumes a "powershell" folder and creates per-module configuration folders
PathOverride = @{
# Where the user's personal configuration settings go.
# Highest presedence, overrides all other settings.
# Defaults to $Env:LocalAppData on Windows
# Defaults to $Env:XDG_CONFIG_HOME elsewhere ($HOME/.config/)
UserData = ""
# On some systems there are "roaming" user configuration stored in the user's profile. Overrides machine configuration
# Defaults to $Env:AppData on Windows
# Defaults to $Env:XDG_CONFIG_DIRS elsewhere (or $HOME/.local/share/)
EnterpriseData = ""
# Machine specific configuration. Overrides defaults, but is overriden by both user roaming and user local settings
# Defaults to $Env:ProgramData on Windows
# Defaults to /etc/xdg elsewhere
MachineData = ""
}
# PSData is module packaging and gallery metadata embedded in PrivateData
# It's for the PoshCode and PowerShellGet modules
# We had to do this because it's the only place we're allowed to extend the manifest
# https://connect.microsoft.com/PowerShell/feedback/details/421837
PSData = @{
# The semver pre-release version information
PreRelease = ''

# Keyword tags to help users find this module via navigations and search.
Tags = @('Development','Configuration','Settings','Storage')

# The web address of this module's project or support homepage.
ProjectUri = "https://github.com/PoshCode/Configuration"

# The web address of this module's license. Points to a page that's embeddable and linkable.
LicenseUri = "http://opensource.org/licenses/MIT"

# Release notes for this particular version of the module
ReleaseNotes = '
- Extract the Metadata module
- Add support for arbitrary AllowedVariables
'
}
}

}


14 changes: 0 additions & 14 deletions Source/Configuration/Header/param.ps1

This file was deleted.

9 changes: 9 additions & 0 deletions Source/Header/param.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Allows you to override the Scope storage paths (e.g. for testing)
param(
$Converters = @{},
$EnterpriseData,
$UserData,
$MachineData
)

Import-Module Metadata -Force -Args @($Converters) -Verbose:$false -Global
70 changes: 0 additions & 70 deletions Source/Metadata/Footer/InitialMetadataConverters.ps1

This file was deleted.

5 changes: 0 additions & 5 deletions Source/Metadata/Header/00. param.ps1

This file was deleted.

6 changes: 0 additions & 6 deletions Source/Metadata/Header/01. IMetadataSerializable.ps1

This file was deleted.

Loading