mirror of
				https://github.com/nsnail/spectre.console.git
				synced 2025-11-04 10:35:27 +08:00 
			
		
		
		
	Explicitly marks Spectre.Console.Cli as not trimmable and not appropriate for AOT scenarios. Additionally adds a warning to CommandApp for users who may try it.
This commit is contained in:
		
				
					committed by
					
						
						Patrik Svensson
					
				
			
			
				
	
			
			
			
						parent
						
							e1d21e7e61
						
					
				
				
					commit
					2a8810affd
				
			@@ -5,6 +5,9 @@ namespace Spectre.Console.Cli;
 | 
			
		||||
/// <summary>
 | 
			
		||||
/// The entry point for a command line application.
 | 
			
		||||
/// </summary>
 | 
			
		||||
#if !NETSTANDARD2_0
 | 
			
		||||
[RequiresDynamicCode("Spectre.Console.Cli relies on reflection. Use during trimming and AOT compilation is not supported and may result in unexpected behaviors.")]
 | 
			
		||||
#endif
 | 
			
		||||
public sealed class CommandApp : ICommandApp
 | 
			
		||||
{
 | 
			
		||||
    private readonly Configurator _configurator;
 | 
			
		||||
 
 | 
			
		||||
@@ -6,6 +6,9 @@ namespace Spectre.Console.Cli;
 | 
			
		||||
/// The entry point for a command line application with a default command.
 | 
			
		||||
/// </summary>
 | 
			
		||||
/// <typeparam name="TDefaultCommand">The type of the default command.</typeparam>
 | 
			
		||||
#if !NETSTANDARD2_0
 | 
			
		||||
[RequiresDynamicCode("Spectre.Console.Cli relies on reflection. Use during trimming and AOT compilation is not supported and may result in unexpected behaviors.")]
 | 
			
		||||
#endif
 | 
			
		||||
public sealed class CommandApp<TDefaultCommand> : ICommandApp
 | 
			
		||||
    where TDefaultCommand : class, ICommand
 | 
			
		||||
{
 | 
			
		||||
 
 | 
			
		||||
@@ -4,7 +4,10 @@
 | 
			
		||||
    <TargetFrameworks>net9.0;net8.0;netstandard2.0</TargetFrameworks>
 | 
			
		||||
    <IsPackable>true</IsPackable>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
 | 
			
		||||
  <PropertyGroup>
 | 
			
		||||
    <IsAotCompatible Condition="'$(TargetFramework)' != 'netstandard2.0'" >false</IsAotCompatible>
 | 
			
		||||
    <IsTrimmable>false</IsTrimmable>
 | 
			
		||||
  </PropertyGroup>
 | 
			
		||||
  <ItemGroup Label="REMOVE THIS">
 | 
			
		||||
    <InternalsVisibleTo Include="Spectre.Console.Cli.Tests" />
 | 
			
		||||
  </ItemGroup>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user