Skip to content

Commit 17d0618

Browse files
committed
Add script and module to generate help, add exceptions file, and add script to build.proj
1 parent acb0a49 commit 17d0618

File tree

4 files changed

+729
-2
lines changed

4 files changed

+729
-2
lines changed

build.proj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,14 +182,16 @@
182182
Targets="Build"
183183
Properties="Configuration=$(Configuration);Platform=Any CPU"
184184
BuildInParallel="$(BuildInParallel)"
185-
ContinueOnError="false" />
185+
ContinueOnError="false" />
186186

187187
<CallTarget Targets="BuildSetupTest"/>
188188
<CallTarget Targets="CodeSignBinaries" Condition=" '$(CodeSign)' == 'true' " />
189189
<CallTarget Targets="BuildSetup"/>
190190
<CallTarget Targets="CodeSignInstaller"
191191
Condition=" '$(CodeSign)' == 'true' and '$(Scope)' == 'all'" />
192-
192+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -ValidateMarkdownHelp &quot;"/>
193+
<Exec Command="$(PowerShellCommand) -NonInteractive -NoLogo -NoProfile -Command &quot;. $(LibraryToolsFolder)\GenerateHelp.ps1 -GenerateMarkdownHelp &quot;"
194+
Condition=" '$(CodeSign)' == 'true' " />
193195
<Message Importance="high" Text="Running Static Analyser" />
194196
<CallTarget targets="DependencyAnalysis" />
195197
</Target>

tools/GenerateHelp.ps1

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#Requires -Modules platyPS
2+
3+
[CmdletBinding()]
4+
Param(
5+
[Parameter()]
6+
[Switch]$ValidateMarkdownHelp,
7+
8+
[Parameter()]
9+
[Switch]$GenerateMamlHelp
10+
)
11+
12+
Import-Module "$PSScriptRoot\HelpGeneration\HelpGeneration.psm1"
13+
14+
$HelpFolders = Get-ChildItem "help" -Recurse -Directory | where { $_.FullName -like "*Debug*" }
15+
16+
# ---------------------------------------------------------------------------------------------
17+
18+
if ($ValidateMarkdownHelp)
19+
{
20+
New-Item -Path "$PSScriptRoot\HelpGeneration\Exceptions" -Name NewValidateHelpExceptions.csv -ItemType File -Force | Out-Null
21+
22+
Add-Content "$PSscriptRoot\HelpGeneration\Exceptions\NewValidateHelpExceptions.csv" "Module,Target,Description"
23+
24+
$HelpFolders | foreach { Validate-MarkdownHelp $_ }
25+
26+
$Exceptions = Import-Csv "$PSScriptRoot\HelpGeneration\Exceptions\NewValidateHelpExceptions.csv"
27+
28+
$Exceptions | ft
29+
30+
Remove-Item -Path "$PSScriptRoot\HelpGeneration\Exceptions\NewValidateHelpExceptions.csv" -Force
31+
}
32+
33+
if ($GenerateMamlHelp)
34+
{
35+
$HelpFolders | foreach { Generate-MamlHelp $_ }
36+
}

0 commit comments

Comments
 (0)