mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-24 20:34:29 +08:00
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配置
This commit is contained in:
parent
763b460575
commit
2f3bc2d526
@ -1,9 +1,10 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<PackageId>GeWuYou.GFramework.SourceGenerators.Attributes</PackageId>
|
||||||
<Nullable>enable</Nullable>
|
<Version>1.0.0</Version>
|
||||||
|
<LangVersion>10</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
#nullable enable
|
#nullable enable
|
||||||
namespace GFramework.SourceGenerators.Attributes.logging;
|
using System;
|
||||||
|
|
||||||
|
namespace GFramework.Godot.SourceGenerators.Attributes.logging;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Godot日志特性,用于在类上标记以自动生成日志字段
|
/// Godot日志特性,用于在类上标记以自动生成日志字段
|
||||||
|
|||||||
@ -1,9 +1,21 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net10.0</TargetFramework>
|
<PackageId>GeWuYou.GFramework.Godot.SourceGenerators</PackageId>
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<Nullable>enable</Nullable>
|
<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>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@ -16,4 +28,17 @@
|
|||||||
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md"/>
|
<AdditionalFiles Include="AnalyzerReleases.Unshipped.md"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<!-- Generator 需要引用 Attributes 项目,但不作为运行时依赖 -->
|
||||||
|
<ProjectReference Include="..\GFramework.Godot.SourceGenerators.Attributes\GFramework.SourceGenerators.Attributes.csproj"
|
||||||
|
PrivateAssets="all"/>
|
||||||
|
</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.Godot.SourceGenerators.Attributes.dll" Pack="true"
|
||||||
|
PackagePath="analyzers/dotnet/cs" Visible="false"/>
|
||||||
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
|
|||||||
@ -1,4 +1,6 @@
|
|||||||
using System.Text;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
using Microsoft.CodeAnalysis;
|
using Microsoft.CodeAnalysis;
|
||||||
using Microsoft.CodeAnalysis.CSharp;
|
using Microsoft.CodeAnalysis.CSharp;
|
||||||
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.0</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<PackageId>GeWuYou.GFramework.Generator.Attributes</PackageId>
|
<PackageId>GeWuYou.GFramework.SourceGenerators.Attributes</PackageId>
|
||||||
<Version>1.0.0</Version>
|
<Version>1.0.0</Version>
|
||||||
<LangVersion>10</LangVersion>
|
<LangVersion>10</LangVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|||||||
@ -12,7 +12,6 @@
|
|||||||
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
||||||
<!-- 不把输出当作运行时库 -->
|
<!-- 不把输出当作运行时库 -->
|
||||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
||||||
<!-- 有助于调试生成的代码(可选) -->
|
<!-- 有助于调试生成的代码(可选) -->
|
||||||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||||||
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user