mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
- 添加 IsRoslynAnalyzer 和 GeneratePackageOnBuild 属性 - 更新项目引用配置以支持分析器使用 - 添加 System.Collections.Immutable 包引用 - 配置生成文件输出路径和可见性 - 添加 README.md 文件并配置打包路径 - 设置包读取文档文件引用
46 lines
2.1 KiB
XML
46 lines
2.1 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<PackageId>GeWuYou.GFramework.Generator</PackageId>
|
|
<TargetFramework>netstandard2.0</TargetFramework>
|
|
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
|
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
|
|
<LangVersion>latest</LangVersion>
|
|
<IsRoslynComponent>true</IsRoslynComponent>
|
|
|
|
<!-- 对 generator 项目要启用扩展规则 -->
|
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
|
<!-- 不把输出当作运行时库 -->
|
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
|
<!-- 有助于调试生成的代码(可选) -->
|
|
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
|
|
<CompilerGeneratedFilesOutputPath>Generated</CompilerGeneratedFilesOutputPath>
|
|
</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.Generator.Attributes\GFramework.Generator.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.Generator.Attributes.dll" Pack="true"
|
|
PackagePath="analyzers/dotnet/cs" Visible="false"/>
|
|
<None Update="README.md">
|
|
<Pack>true</Pack>
|
|
<PackagePath></PackagePath>
|
|
</None>
|
|
</ItemGroup>
|
|
|
|
</Project>
|