File tree Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Expand file tree Collapse file tree 3 files changed +52
-0
lines changed Original file line number Diff line number Diff line change 19
19
"commands" : [
20
20
" meziantou.validate-nuget-package"
21
21
]
22
+ },
23
+ "powershell" : {
24
+ "version" : " 7.4.0" ,
25
+ "commands" : [
26
+ " pwsh"
27
+ ]
22
28
}
23
29
}
24
30
}
Original file line number Diff line number Diff line change
1
+ @ echo off
2
+ dotnet pwsh -NoProfile -ExecutionPolicy RemoteSigned -File " %~dpn0 .ps1"
Original file line number Diff line number Diff line change
1
+ [CmdletBinding (PositionalBinding = $false )]
2
+ param ()
3
+
4
+ Set-StrictMode - Version 2.0
5
+ $ErrorActionPreference = ' Stop'
6
+
7
+ function MarkShipped ([string ]$dir )
8
+ {
9
+ $shippedFilePath = Join-Path $dir ' PublicAPI.Shipped.txt'
10
+ [array ]$shipped = Get-Content $shippedFilePath
11
+
12
+ $unshippedFilePath = Join-Path $dir ' PublicAPI.Unshipped.txt'
13
+ [array ]$unshipped = Get-Content $unshippedFilePath | ? { $_ -and $_ -notmatch ' ^#' }
14
+
15
+ $removed = @ ()
16
+ $removedPrefix = ' *REMOVED*' ;
17
+ Write-Verbose " Processing $dir "
18
+
19
+ foreach ($item in $unshipped )
20
+ {
21
+ if ($item.StartsWith ($removedPrefix ))
22
+ {
23
+ $item = $item.Substring ($removedPrefix.Length )
24
+ $removed += $item
25
+ }
26
+ else
27
+ {
28
+ $shipped += $item
29
+ }
30
+ }
31
+
32
+ $shipped |
33
+ Sort-Object |
34
+ ? { -not $removed.Contains ($_ ) } |
35
+ Out-File $shippedFilePath - Encoding Ascii
36
+
37
+ ' #nullable enable' | Out-File $unshippedFilePath - Encoding Ascii
38
+ }
39
+
40
+ foreach ($file in Get-ChildItem - re -in ' PublicApi.Shipped.txt' )
41
+ {
42
+ $dir = Split-Path - parent $file
43
+ MarkShipped $dir
44
+ }
You can’t perform that action at this time.
0 commit comments