-
Notifications
You must be signed in to change notification settings - Fork 0
/
doc.ps1
24 lines (19 loc) · 872 Bytes
/
doc.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
mkdir -Force "doc/"
foreach ($project in Get-ChildItem -Path src/ -Recurse -File *.csproj) {
$dir = $project.DirectoryName
$lines = Get-Content $project
# assembly name
$name = [System.IO.Path]::GetFileNameWithoutExtension($project.Name)
$lines | Select-String -Pattern '<Product\>(.*)</Product\>' | ForEach-Object {
$name = $_.Matches.Groups[1].Value
}
# target framework
$target = 'net60'
$lines | Select-String -Pattern '<TargetFrameworks\>([^;]+).*</TargetFrameworks\>' | ForEach-Object {
$target = $_.Matches.Groups[1].Value # use the first target framework
}
$lines | Select-String -Pattern '<TargetFramework\>(.*)</TargetFramework\>' | ForEach-Object {
$target = "" # no sub directory created for single target framework
}
& xmldoc2md "$dir/bin/Debug/$target/$name.dll" "doc/$name"
}