mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 移除 GeneratePackageOnBuild 和 IsRoslynComponent 配置项 - 统一设置 IncludeBuildOutput 为 false 以避免运行时库输出 - 更新 Microsoft.CodeAnalysis.Analyzers 版本至 4.14.0 - 为所有项目引用添加 PrivateAssets="all" 属性 - 简化打包配置,只将生成器 DLL 打包到 analyzers 目录 - 添加中文注释说明各配置项的作用和用途
42 lines
1.6 KiB
XML
42 lines
1.6 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
||
|
||
<PropertyGroup>
|
||
<PackageId>GeWuYou.GFramework.SourceGenerators</PackageId>
|
||
<TargetFramework>netstandard2.0</TargetFramework>
|
||
|
||
<!-- 这是 Analyzer,不是运行时库 -->
|
||
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||
|
||
<LangVersion>latest</LangVersion>
|
||
<Nullable>enable</Nullable>
|
||
|
||
<!-- 可选:调试生成代码 -->
|
||
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
||
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
||
</PropertyGroup>
|
||
|
||
<!-- Roslyn 依赖,只用于 Generator 自身 -->
|
||
<ItemGroup>
|
||
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.14.0" PrivateAssets="all"/>
|
||
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="4.14.0" PrivateAssets="all"/>
|
||
</ItemGroup>
|
||
|
||
<!-- Generator 编译期引用 Attributes / Common,但不打包 -->
|
||
<ItemGroup>
|
||
<ProjectReference Include="..\GFramework.SourceGenerators.Attributes\GFramework.SourceGenerators.Attributes.csproj"
|
||
PrivateAssets="all"/>
|
||
<ProjectReference Include="..\GFramework.SourceGenerators.Common\GFramework.SourceGenerators.Common.csproj"
|
||
PrivateAssets="all"/>
|
||
</ItemGroup>
|
||
|
||
<!-- ★关键:只把 Generator DLL 放进 analyzers -->
|
||
<ItemGroup>
|
||
<None Include="$(OutputPath)\$(AssemblyName).dll"
|
||
Pack="true"
|
||
PackagePath="analyzers/dotnet/cs"
|
||
Visible="false"/>
|
||
</ItemGroup>
|
||
|
||
</Project>
|