41 lines
1.9 KiB
XML
41 lines
1.9 KiB
XML
<Project Sdk="Microsoft.NET.Sdk">
|
|
|
|
<PropertyGroup>
|
|
<TargetFramework>netstandard2.0</TargetFramework>
|
|
<LangVersion>latest</LangVersion>
|
|
<Nullable>enable</Nullable>
|
|
<ImplicitUsings>enable</ImplicitUsings>
|
|
<EnforceExtendedAnalyzerRules>true</EnforceExtendedAnalyzerRules>
|
|
<IsRoslynComponent>true</IsRoslynComponent>
|
|
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
|
|
|
<!-- 帮助 IDE 识别这是一个 Source Generator -->
|
|
<DevelopmentDependency>true</DevelopmentDependency>
|
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
|
</PropertyGroup>
|
|
|
|
<!-- 为 Unity 构建使用低版本 Roslyn (Unity 2020.2-2022.x 使用 Roslyn 4.0-4.3) -->
|
|
<PropertyGroup Condition="'$(Configuration)' == 'Unity' OR '$(Configuration)' == 'UnityDebug'">
|
|
<DefineConstants>$(DefineConstants);UNITY_COMPATIBLE</DefineConstants>
|
|
</PropertyGroup>
|
|
|
|
<!-- Unity 兼容版本 - 使用 Roslyn 4.0.1 (兼容 Unity 2020.2+) -->
|
|
<ItemGroup Condition="'$(Configuration)' == 'Unity' OR '$(Configuration)' == 'UnityDebug'">
|
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.0.1" PrivateAssets="all" />
|
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.3" PrivateAssets="all" />
|
|
</ItemGroup>
|
|
|
|
<!-- .NET 版本 - 使用最新 Roslyn (用于 .NET 8/9 项目) -->
|
|
<ItemGroup Condition="'$(Configuration)' != 'Unity' AND '$(Configuration)' != 'UnityDebug'">
|
|
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0" PrivateAssets="all" />
|
|
<PackageReference Include="Microsoft.CodeAnalysis.Analyzers" Version="3.3.4" PrivateAssets="all" />
|
|
</ItemGroup>
|
|
|
|
<ItemGroup>
|
|
<!-- 让生成的代码对用户可见 (调试用) -->
|
|
<CompilerVisibleProperty Include="RootNamespace" />
|
|
<CompilerVisibleProperty Include="ProjectDir" />
|
|
</ItemGroup>
|
|
|
|
</Project>
|