mirror of
https://github.com/nsnail/spectre.console.git
synced 2025-04-14 16:02:50 +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:
parent
e1d21e7e61
commit
2a8810affd
@ -5,6 +5,9 @@ namespace Spectre.Console.Cli;
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The entry point for a command line application.
|
/// The entry point for a command line application.
|
||||||
/// </summary>
|
/// </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
|
public sealed class CommandApp : ICommandApp
|
||||||
{
|
{
|
||||||
private readonly Configurator _configurator;
|
private readonly Configurator _configurator;
|
||||||
|
@ -6,6 +6,9 @@ namespace Spectre.Console.Cli;
|
|||||||
/// The entry point for a command line application with a default command.
|
/// The entry point for a command line application with a default command.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <typeparam name="TDefaultCommand">The type of the default command.</typeparam>
|
/// <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
|
public sealed class CommandApp<TDefaultCommand> : ICommandApp
|
||||||
where TDefaultCommand : class, ICommand
|
where TDefaultCommand : class, ICommand
|
||||||
{
|
{
|
||||||
|
@ -4,7 +4,10 @@
|
|||||||
<TargetFrameworks>net9.0;net8.0;netstandard2.0</TargetFrameworks>
|
<TargetFrameworks>net9.0;net8.0;netstandard2.0</TargetFrameworks>
|
||||||
<IsPackable>true</IsPackable>
|
<IsPackable>true</IsPackable>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup>
|
||||||
|
<IsAotCompatible Condition="'$(TargetFramework)' != 'netstandard2.0'" >false</IsAotCompatible>
|
||||||
|
<IsTrimmable>false</IsTrimmable>
|
||||||
|
</PropertyGroup>
|
||||||
<ItemGroup Label="REMOVE THIS">
|
<ItemGroup Label="REMOVE THIS">
|
||||||
<InternalsVisibleTo Include="Spectre.Console.Cli.Tests" />
|
<InternalsVisibleTo Include="Spectre.Console.Cli.Tests" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user