-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.ps1
More file actions
20 lines (17 loc) · 1.05 KB
/
build.ps1
File metadata and controls
20 lines (17 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
$ModuleName = 'PsModelUI'
$ModuleFolder = Join-Path -Path $PSScriptRoot -ChildPath $ModuleName
$RootModule = Join-Path -Path $ModuleFolder -ChildPath "$($ModuleName).psm1"
'Add-Type -AssemblyName PresentationFramework, PresentationCore, WindowsBase -ErrorAction Stop' | Out-File -FilePath $RootModule -Encoding 'utf8NoBOM'
$BasePath = Join-Path -Path $PSScriptRoot -ChildPath 'src'
$ClassesPath = Join-Path -Path $BasePath -ChildPath 'Classes'
$PrivatePath = Join-Path -Path $BasePath -ChildPath 'Private'
$PublicPath = Join-Path -Path $BasePath -ChildPath 'Public'
$ClassOrder = 'ViewModelBase', 'ActionCommand'
$Files = @(
Get-ChildItem -Path $ClassesPath -File -Filter '*.ps1' | Sort-Object -Property @{e = { if ($ClassOrder.IndexOf($_.BaseName) -eq -1) { $_.BaseName } else { $ClassOrder.IndexOf($_.BaseName) } } }
Get-ChildItem -Path $PrivatePath -File -Filter '*.ps1'
Get-ChildItem -Path $PublicPath -File -Filter '*.ps1'
)
$Files | ForEach-Object {
Get-Content -Path $_.FullName -Raw | Out-File -Path $RootModule -Append -Encoding 'utf8NoBOM'
}