Skip to content

Commit

Permalink
[release/9.0.1xx-rc1] Regenerate PublicAPIs based on main (#24633)
Browse files Browse the repository at this point in the history
* Regenerate PublicAPIs

* Update script to generate PublicAPIs

* added

* sort

* this

* failed

* no idea why it needs 2
  • Loading branch information
mattleibow authored Sep 9, 2024
1 parent 74d7309 commit 5d22e79
Show file tree
Hide file tree
Showing 116 changed files with 17,530 additions and 18,501 deletions.
1 change: 0 additions & 1 deletion eng/PublicAPI.empty.txt

This file was deleted.

165 changes: 142 additions & 23 deletions eng/scripts/mark-shipped.ps1
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
# Copied from ASP.NET:
# https://github.com/dotnet/aspnetcore/blob/a24dd9e870bf713487e5cca46075ff3ee2c3ddc8/eng/scripts/mark-shipped.ps1
[CmdletBinding(PositionalBinding=$false)]
param ()
# USAGE:
# - To mark all APIs as shipped:
# .\eng\scripts\mark-shipped.ps1
# - To mark APIs as shipped/unshipped based on changes between two branches:
# .\eng\scripts\mark-shipped.ps1 -BaselineBranch <branch>

[CmdletBinding(PositionalBinding = $false)]
param (
[string]$BaselineBranch
)

Set-StrictMode -version 2.0
$ErrorActionPreference = "Stop"

function MarkShipped([string]$dir) {
Write-Host "Processing $dir"
$removedPrefix = "*REMOVED*";

$removedPrefix = "*REMOVED*";
function Read-ApiFiles([string]$dir) {
$shipped = @()
$removed = @()
$added = @()

$shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"
$shippedContents = Get-Content $shippedFilePath
foreach ($item in $shippedContents) {
$shipped += $item.Trim()
$item = $item.Trim()
if ($item.Length -gt 0) {
$shipped += $item
}
}

$unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
Expand All @@ -29,28 +38,138 @@ function MarkShipped([string]$dir) {
$removed += $item
}
else {
$shipped += $item
$added += $item
}
}
}

Remove-Item $shippedFilePath -Force
$shipped |
Sort-Object -Unique |
Where-Object { -not $removed.Contains($_) } |
Out-File $shippedFilePath -Encoding Ascii
$filtered = ($shipped + $added) | Where-Object { -not $removed.Contains($_) } | Sort-Object -Unique

Copy-Item eng/PublicAPI.empty.txt $unshippedFilePath
return @{
Shipped = $shipped
Added = $added
Removed = $removed
Filtered = $filtered
}
}

try {
foreach ($file in Get-ChildItem -re -in "PublicApi.Shipped.txt") {
$dir = Split-Path -parent $file
MarkShipped $dir
function Move-Shipped([string]$dir) {
Write-Host "- Processing $dir" -NoNewline

$results = Read-ApiFiles $dir
$s = $results.Shipped.Count
$a = $results.Added.Count
$r = $results.Removed.Count
$f = $results.Filtered.Count

Write-Host " => $s + $a - $r = $f"

$unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
$shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"

$results.Filtered | Out-File $shippedFilePath -Encoding Ascii -Force
"#nullable enable" | Out-File $unshippedFilePath -Encoding Ascii -Force
}

function Get-ShippedApiFiles() {
Write-Host "Looking for PublicAPI files..."
$files = Get-ChildItem "src" -Recurse -Filter "PublicApi.Shipped.txt" -Exclude "artifacts"
Write-Host "Found $($files.Count) files."
return $files
}

function Read-AllApiFiles() {
$files = Get-ShippedApiFiles
$results = @{}
$counter = 0
Write-Host "Processing [$counter/$($files.Count)]..." -NoNewline
foreach ($file in $files) {
$counter += 1
Write-Host "`rProcessing $file [$counter/$($files.Count)]... `r" -NoNewline
$results[$file.FullName] = Read-ApiFiles (Split-Path -Parent $file)
}
Write-Host "`rDone. `r"
return $results
}
catch {
Write-Host $_
Write-Host $_.Exception
exit 1

if ($BaselineBranch) {
$CurrentBranch = git rev-parse --abbrev-ref HEAD
Write-Host "Regenerating unshipped PublicAPI files for changes between $BaselineBranch and $CurrentBranch..."

# get the APIs for the current branch
Write-Host "Reading PubilicAPI files for $CurrentBranch..."
$currentChanges = Read-AllApiFiles

# get the APIs for the baseline branch
Write-Host "Reading PubilicAPI files for $BaselineBranch..."
git checkout $BaselineBranch
$baselineChanges = Read-AllApiFiles

# switch back to the current branch
Write-Host "Generating unshipped PublicAPI files..."
git checkout $CurrentBranch

# process the differences between the branches
foreach ($file in $currentChanges.Keys) {
$dir = (Split-Path -Parent $file)
Write-Host "- Processing $dir" -NoNewline

# get the changes for this file for each branch
$currentFile = $currentChanges[$file]
$baselineFile = $baselineChanges[$file]

# skip any files that don't exist in both branches
if (-not $currentFile) {
Write-Host " => does not exist in the current branch"
continue
}
if (-not $baselineFile) {
Write-Host " => does not exist in the baseline branch"
continue
}

# get the APIs for the current and baseline branches
$current = $currentFile.Filtered
$baseline = $baselineFile.Filtered

# calculate the changes between the branches
$added = $current | Where-Object { -not $baseline.Contains($_) }
$removed = $baseline | Where-Object { -not $current.Contains($_) }
$both = ($added + $removed) | Sort-Object -Unique

# generate the unshipped file contents
$unshipped = @()
$unshipped += "#nullable enable"
foreach ($item in $both) {
if ($added -contains $item) {
$unshipped += $item
}
else {
$unshipped += "$removedPrefix$item"
}
}

$unshippedFilePath = Join-Path $dir "PublicAPI.Unshipped.txt"
$shippedFilePath = Join-Path $dir "PublicAPI.Shipped.txt"

$baseline | Out-File $shippedFilePath -Encoding Ascii -Force
$unshipped | Out-File $unshippedFilePath -Encoding Ascii -Force

Write-Host " => Done"
}
}
else {
try {
$files = Get-ShippedApiFiles
Write-Host "Processing files..."
foreach ($file in $files) {
Move-Shipped (Split-Path -Parent $file)
}
Write-Host "Processing complete."
}
catch {
Write-Error $_
Write-Error $_.Exception
exit 1
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitiali
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.UrlLoading -> System.EventHandler<Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs!>?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler() -> void
Expand All @@ -22,6 +24,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.CreateFileProvider(s
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.UrlLoading(Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs! args) -> void
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Expand Down Expand Up @@ -52,4 +56,7 @@ static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHost
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
#nullable enable
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitiali
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.UrlLoading -> System.EventHandler<Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs!>?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler() -> void
Expand All @@ -24,6 +26,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.CreateFileProvider(s
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.UrlLoading(Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs! args) -> void
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Expand Down Expand Up @@ -54,4 +58,7 @@ static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHost
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
#nullable enable
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.BlazorWebViewInitiali
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.HostPage.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.UrlLoading -> System.EventHandler<Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs!>?
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.BlazorWebViewHandler() -> void
Expand All @@ -24,6 +26,8 @@ Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.CreateFileProvider(s
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.HostPage.get -> string?
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.JSComponents.get -> Microsoft.AspNetCore.Components.Web.JSComponentConfigurationStore!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.RootComponents.get -> Microsoft.AspNetCore.Components.WebView.Maui.RootComponentsCollection!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.UrlLoading(Microsoft.AspNetCore.Components.WebView.UrlLoadingEventArgs! args) -> void
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder
Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder.Services.get -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
Expand Down Expand Up @@ -54,4 +58,7 @@ static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapHost
static Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.MapRootComponents(Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler! handler, Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView! webView) -> void
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddBlazorWebViewDeveloperTools(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.Extensions.DependencyInjection.IServiceCollection!
static Microsoft.Extensions.DependencyInjection.BlazorWebViewServiceCollectionExtensions.AddMauiBlazorWebView(this Microsoft.Extensions.DependencyInjection.IServiceCollection! services) -> Microsoft.AspNetCore.Components.WebView.Maui.IMauiBlazorWebViewBuilder!
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.CreateFileProvider(string! contentRootDir) -> Microsoft.Extensions.FileProviders.IFileProvider!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Original file line number Diff line number Diff line change
@@ -1,8 +1 @@
#nullable enable
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPath.set -> void
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.get -> string!
Microsoft.AspNetCore.Components.WebView.Maui.IBlazorWebView.StartPath.set -> void
static readonly Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.StartPathProperty -> Microsoft.Maui.Controls.BindableProperty!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebView.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
virtual Microsoft.AspNetCore.Components.WebView.Maui.BlazorWebViewHandler.TryDispatchAsync(System.Action<System.IServiceProvider!>! workItem) -> System.Threading.Tasks.Task<bool>!
Loading

0 comments on commit 5d22e79

Please sign in to comment.