Skip to content
代码片段 群组 项目
提交 2b60776f 编辑于 作者: Doug Bunting's avatar Doug Bunting
浏览文件

[release/6.0] Check in mark-shipped.* scripts

- what I used to merge PublicAPI files
- slight variation of <https://github.com/dotnet/roslyn/tree/main/scripts/PublicApi>
上级 2306e1e2
No related branches found
No related tags found
无相关合并请求
@echo off
powershell -noprofile -executionPolicy Bypass -file "%~dp0\mark-shipped.ps1"
[CmdletBinding(PositionalBinding=$false)]
param ()
Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"
function MarkShipped([string]$dir) {
$shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"
$shipped = Get-Content $shippedFilePath
if ($null -eq $shipped) {
$shipped = @()
}
$unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
$unshipped = Get-Content $unshippedFilePath
$removed = @()
$removedPrefix = "*REMOVED*";
Write-Host "Processing $dir"
foreach ($item in $unshipped) {
if ($item.Length -gt 0) {
if ($item.StartsWith($removedPrefix)) {
$item = $item.Substring($removedPrefix.Length)
$removed += $item
}
else {
$shipped += $item
}
}
}
$shipped | Sort-Object -Unique |Where-Object { -not $removed.Contains($_) } | Out-File $shippedFilePath -Encoding Ascii
Copy-Item eng/PublicAPI.empty.txt $unshippedFilePath
}
try {
foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") {
$dir = Split-Path -parent $file
MarkShipped $dir
}
}
catch {
Write-Host $_
Write-Host $_.Exception
exit 1
}
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册