GwWuYou 2f3bc2d526 feat(godot-source-generators): 重构Godot源代码生成器项目配置
- 将TargetFramework从net10.0更改为netstandard2.0以提高兼容性
- 添加必要的using语句(System和System.Linq)到GodotLoggerGenerator
- 配置项目属性以支持Roslyn分析器功能,包括GeneratePackageOnBuild、
  IsRoslynAnalyzer等设置
- 添加EnforceExtendedAnalyzerRules以启用扩展规则验证
- 配置项目引用GFramework.Godot.SourceGenerators.Attributes并设置
  PrivateAssets="all"避免运行时依赖
- 设置打包配置将生成器DLL打包为analyzers/dotnet/cs路径
- 修正GodotLogAttribute命名空间为GFramework.Godot.SourceGenerators.Attributes.logging
- 更新PackageId为GeWuYou.GFramework.SourceGenerators.Attributes
- 移除不必要的PackageReadmeFile配置
2025-12-25 21:22:20 +08:00

39 lines
1.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#nullable enable
using System;
namespace GFramework.Godot.SourceGenerators.Attributes.logging;
/// <summary>
/// Godot日志特性用于在类上标记以自动生成日志字段
/// </summary>
[AttributeUsage(AttributeTargets.Class, Inherited = false)]
public sealed class GodotLogAttribute : Attribute
{
/// <summary>
/// 初始化 GodotLogAttribute 类的新实例
/// </summary>
public GodotLogAttribute()
{
}
/// <summary>
/// 初始化 GodotLogAttribute 类的新实例
/// </summary>
/// <param name="name">日志分类名</param>
public GodotLogAttribute(string? name)
{
Name = name;
}
/// <summary>日志分类名(默认使用类名)</summary>
public string? Name { get; set; }
/// <summary>生成字段名</summary>
public string FieldName { get; set; } = "_log";
/// <summary>是否生成 static 字段</summary>
public bool IsStatic { get; set; } = true;
/// <summary>访问修饰符</summary>
public string AccessModifier { get; set; } = "private";
}