Skip to content

Commit

Permalink
Fix docs generation for net
Browse files Browse the repository at this point in the history
  • Loading branch information
PrzemyslawKlys committed Sep 30, 2024
1 parent d9b77ea commit d5f3941
Showing 1 changed file with 29 additions and 32 deletions.
61 changes: 29 additions & 32 deletions Private/Start-LibraryBuilding.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@
Write-Text "[-] Can't list files in $PublishDirFolder folder. Error: $($_.Exception.Message)" -Color Red
return $false
}
$Count++
$Errors = $false

Write-Text -Text "[i] Preparing copying module files for $ModuleName from $InitialFolder" -Color DarkGray
Expand All @@ -146,42 +145,40 @@
}
}

if ($Count -eq 1) {
if (-not $LibraryConfiguration.BinaryModuleCmdletScanDisabled) {
# Skip assembly verification if it doesn't match the current PowerShell edition
# We only have to do it once anyways as we expect support for both editions
$SkipAssembly = $false
if ($PSVersionTable.PSEdition -eq 'Core') {
if ($TranslateFrameworks[$Framework] -eq 'Default') {
$SkipAssembly = $true
}
} else {
if ($TranslateFrameworks[$Framework] -eq 'Core') {
$SkipAssembly = $true
}
if (-not $LibraryConfiguration.BinaryModuleCmdletScanDisabled) {
# Skip assembly verification if it doesn't match the current PowerShell edition
# We only have to do it once anyways as we expect support for both editions
$SkipAssembly = $false
if ($PSVersionTable.PSEdition -eq 'Core') {
if ($TranslateFrameworks[$Framework] -eq 'Default') {
$SkipAssembly = $true
}
} else {
if ($TranslateFrameworks[$Framework] -eq 'Core') {
$SkipAssembly = $true
}
}

if (-not $SkipAssembly) {
# we only scan the assembly in main folder, and skip nested folders
if ($InitialFolder -eq $File.Directory) {
$CmdletsFound = Get-PowerShellAssemblyMetadata -Path $File.FullName
if ($CmdletsFound -eq $false) {
$Errors = $true
} else {
if ($CmdletsFound.CmdletsToExport.Count -gt 0 -or $CmdletsFound.AliasesToExport.Count -gt 0) {
Write-Text -Text "Found $($CmdletsFound.CmdletsToExport.Count) cmdlets and $($CmdletsFound.AliasesToExport.Count) aliases in $File" -Color Yellow -PreAppend Information -SpacesBefore " "
if ($CmdletsFound.CmdletsToExport.Count -gt 0) {
Write-Text -Text "Cmdlets: $($CmdletsFound.CmdletsToExport -join ', ')" -Color Yellow -PreAppend Plus -SpacesBefore " "
}
if ($CmdletsFound.AliasesToExport.Count -gt 0) {
Write-Text -Text "Aliases: $($CmdletsFound.AliasesToExport -join ', ')" -Color Yellow -PreAppend Plus -SpacesBefore " "
}
$CmdletsAliases[$File.FullName] = $CmdletsFound
if (-not $SkipAssembly) {
# we only scan the assembly in main folder, and skip nested folders
if ($InitialFolder -eq $File.DirectoryName) {
$CmdletsFound = Get-PowerShellAssemblyMetadata -Path $File.FullName
if ($CmdletsFound -eq $false) {
$Errors = $true
} else {
if ($CmdletsFound.CmdletsToExport.Count -gt 0 -or $CmdletsFound.AliasesToExport.Count -gt 0) {
Write-Text -Text "Found $($CmdletsFound.CmdletsToExport.Count) cmdlets and $($CmdletsFound.AliasesToExport.Count) aliases in $File" -Color Yellow -PreAppend Information -SpacesBefore " "
if ($CmdletsFound.CmdletsToExport.Count -gt 0) {
Write-Text -Text "Cmdlets: $($CmdletsFound.CmdletsToExport -join ', ')" -Color Yellow -PreAppend Plus -SpacesBefore " "
}
if ($CmdletsFound.AliasesToExport.Count -gt 0) {
Write-Text -Text "Aliases: $($CmdletsFound.AliasesToExport -join ', ')" -Color Yellow -PreAppend Plus -SpacesBefore " "
}
$CmdletsAliases[$File.FullName] = $CmdletsFound
}
} else {
Write-Text -Text " [-] Skipping $($File.FullName) as it's not in the same folder as the assembly" -Color Yellow
}
} else {
Write-Text -Text " [-] Skipping $($File.FullName) as it's not in the same folder as the assembly" -Color Yellow
}
}
}
Expand Down

0 comments on commit d5f3941

Please sign in to comment.