mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 将 ClassMustBePartial 诊断描述符移至 CommonDiagnostics 类 - 更新 GodotLoggerGenerator 和 LoggerGenerator 引用通用诊断 - 添加 ContextAwareGenerator 实现上下文感知功能 - 创建 ContextAwareAttribute 标记需要自动实现 IContextAware 的类 - 在项目中添加对 GFramework.SourceGenerators.Common 的引用 - 更新诊断规则 ID 命名规范 - 修复 AnalyzerReleases 文件格式 - 添加 nullable enable 配置 - 在解决方案文件中添加新项目引用
44 lines
2.2 KiB
XML
44 lines
2.2 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<PackageId>GeWuYou.GFramework.SourceGenerators</PackageId>
|
|
<TargetFramework>netstandard2.0</TargetFramework>
|
|
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
<LangVersion>latest</LangVersion>
|
|
<IsRoslynComponent>true</IsRoslynComponent>
|
|
|
|
<!-- 对 generator 项目要启用扩展规则 -->
|
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
|
<!-- 不把输出当作运行时库 -->
|
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
|
<!-- 有助于调试生成的代码(可选) -->
|
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
|
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
|
<Nullable>enable</Nullable>
|
|
</PropertyGroup>
|
|
<ItemGroup>
|
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all"/>
|
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.11.0" PrivateAssets="all"/>
|
|
<PackageReference Include="System.Collections.Immutable" Version="9.0.0"/>
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- Generator 需要引用 Attributes 项目,但不作为运行时依赖 -->
|
|
<ProjectReference Include="..\GFramework.SourceGenerators.Attributes\GFramework.SourceGenerators.Attributes.csproj"
|
|
PrivateAssets="all"/>
|
|
<ProjectReference Include="..\GFramework.SourceGenerators.Common\GFramework.SourceGenerators.Common.csproj"/>
|
|
</ItemGroup>
|
|
|
|
<!-- 将 Generator 和 Attributes DLL 打包为 Analyzer -->
|
|
<ItemGroup>
|
|
<None Include="$(OutputPath)\$(AssemblyName).dll" Pack="true"
|
|
PackagePath="analyzers/dotnet/cs" Visible="false"/>
|
|
<None Include="$(OutputPath)$(AssemblyName).dll" Pack="true" PackagePath="lib/netstandard2.0"/>
|
|
<None Include="$(OutputPath)\GFramework.SourceGenerators.Attributes.dll" Pack="true"
|
|
PackagePath="analyzers/dotnet/cs" Visible="false"/>
|
|
</ItemGroup>
|
|
|
|
</Project>
|