This repository was archived by the owner on Jan 12, 2024. It is now read-only.
File tree Expand file tree Collapse file tree
src/Build/NuGet.Build.Packaging.Tasks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -19,6 +19,10 @@ public class ApiIntersect : ToolTask
1919
2020 public ITaskItem [ ] ExcludeType { get ; set ; }
2121
22+ public string KeepInternalConstructors { get ; set ; }
23+
24+ public string KeepMarshalling { get ; set ; }
25+
2226 [ Required ]
2327 public ITaskItem RootOutputDirectory { get ; set ; }
2428
@@ -74,6 +78,10 @@ protected override string GenerateCommandLineCommands()
7478 builder . AppendTextUnquoted ( "\" " ) ;
7579 }
7680
81+ AppendSwitchIfTrue ( builder , "-k" , KeepInternalConstructors ) ;
82+
83+ AppendSwitchIfTrue ( builder , "-m" , KeepMarshalling ) ;
84+
7785 return builder . ToString ( ) ;
7886 }
7987
@@ -120,5 +128,15 @@ static string GetPortableRootDirectory()
120128 Environment . GetFolderPath ( Environment . SpecialFolder . ProgramFilesX86 , Environment . SpecialFolderOption . DoNotVerify ) ,
121129 @"Reference Assemblies\Microsoft\Framework\.NETPortable" ) ;
122130 }
131+
132+ static void AppendSwitchIfTrue ( CommandLineBuilder builder , string switchName , string value )
133+ {
134+ if ( string . IsNullOrEmpty ( value ) )
135+ return ;
136+
137+ bool result ;
138+ if ( bool . TryParse ( value , out result ) )
139+ builder . AppendSwitch ( switchName ) ;
140+ }
123141 }
124142}
Original file line number Diff line number Diff line change @@ -523,6 +523,8 @@ Copyright (c) .NET Foundation. All rights reserved.
523523 IntersectionAssembly=" @(IntersectionAssembly)"
524524 ReferencePath=" $(IntersectionAssemblyReferencePath)"
525525 ExcludeType=" $(IntersectionExcludeType)"
526+ KeepInternalConstructors=" $(IntersectionKeepInternalConstructors)"
527+ KeepMarshalling=" $(IntersectionKeepMarshalling)"
526528 ToolPath=" $(ApiIntersectToolPath)"
527529 ToolExe=" $(ApiIntersectToolExe)" >
528530 <Output TaskParameter =" OutputDirectory" ItemName =" _ReferenceAssemblyBuildInfo" />
You can’t perform that action at this time.
0 commit comments