Skip to content
This repository was archived by the owner on Jan 12, 2024. It is now read-only.

Commit 9c1b05f

Browse files
committed
[MSBuild] Allow abstract members to be removed for intersection
<PropertyGroup> <IntersectionRemoveAbstractTypeMembers>Type1;Type2</IntersectionRemoveAbstractTypeMembers> </PropertyGroup>
1 parent 174f998 commit 9c1b05f

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

src/Build/NuGet.Build.Packaging.Tasks/ApiIntersect.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ public class ApiIntersect : ToolTask
1919

2020
public ITaskItem[] ExcludeType { get; set; }
2121

22+
public ITaskItem[] RemoveAbstractTypeMembers { get; set; }
23+
2224
public string KeepInternalConstructors { get; set; }
2325

2426
public string KeepMarshalling { get; set; }
@@ -78,6 +80,14 @@ protected override string GenerateCommandLineCommands()
7880
builder.AppendTextUnquoted("\"");
7981
}
8082

83+
foreach (var removeAbstractType in RemoveAbstractTypeMembers.NullAsEmpty())
84+
{
85+
builder.AppendSwitch("-a");
86+
builder.AppendTextUnquoted(" \"");
87+
builder.AppendTextUnquoted(removeAbstractType.ItemSpec);
88+
builder.AppendTextUnquoted("\"");
89+
}
90+
8191
AppendSwitchIfTrue(builder, "-k", KeepInternalConstructors);
8292

8393
AppendSwitchIfTrue(builder, "-m", KeepMarshalling);

src/Build/NuGet.Build.Packaging.Tasks/NuGet.Build.Packaging.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ Copyright (c) .NET Foundation. All rights reserved.
523523
IntersectionAssembly="@(IntersectionAssembly)"
524524
ReferencePath="$(IntersectionAssemblyReferencePath)"
525525
ExcludeType="$(IntersectionExcludeType)"
526+
RemoveAbstractTypeMembers="$(IntersectionRemoveAbstractTypeMembers)"
526527
KeepInternalConstructors="$(IntersectionKeepInternalConstructors)"
527528
KeepMarshalling="$(IntersectionKeepMarshalling)"
528529
ToolPath="$(ApiIntersectToolPath)"

0 commit comments

Comments
 (0)