Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[api-merge] Add removed-since info. #8897

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions build-tools/api-merge/ApiDescription.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,13 @@ public void Merge (XDocument n, string apiLocation)
}
}
#endif
foreach (var smember in stype.Elements ()) {
var nmember = GetMember (ntype, smember);

if (nmember is null)
SetRemovedSince (smember, platform);
}

foreach (var nmember in ntype.Elements ()) {
var smember = GetMember (stype, nmember);
if (smember == null) {
Expand Down Expand Up @@ -308,6 +315,16 @@ void SetDeprecatedSince (XElement element, string platform)
deprecatedSince.SetValue (platform);
}

void SetRemovedSince (XElement element, string platform)
{
if (element is null)
return;

// Don't replace an earlier removal, as we want to keep the earliest one.
if (!element.Attributes ("removed-since").Any ())
element.Add (new XAttribute ("removed-since", platform));
}

XElement AddWithLocation (XElement old, XElement child, string location)
{
child.Add (new XAttribute ("merge.SourceFile", location));
Expand Down
Loading