mirror of
https://github.com/GeWuYou/GFramework.git
synced 2026-03-22 10:34:30 +08:00
Merge pull request #126 from GeWuYou/refactor/generators-downgrade-to-netstandard20
refactor(generators): 将源代码生成器项目目标框架降级至 netstandard2.0
This commit is contained in:
commit
003fe42ad8
@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PackageId>GeWuYou.$(AssemblyName)</PackageId>
|
<PackageId>GeWuYou.$(AssemblyName)</PackageId>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
|
||||||
<!-- 这是 Analyzer,不是运行时库 -->
|
<!-- 这是 Analyzer,不是运行时库 -->
|
||||||
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
||||||
|
|||||||
@ -6,6 +6,9 @@
|
|||||||
<Nullable>enable</Nullable>
|
<Nullable>enable</Nullable>
|
||||||
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
|
||||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||||
|
<!-- Godot.SourceGenerators expects this property from Godot.NET.Sdk.
|
||||||
|
Provide a safe default so source generators can run in plain SDK-style builds as well. -->
|
||||||
|
<GodotProjectDir Condition="'$(GodotProjectDir)' == ''">$(MSBuildProjectDirectory)</GodotProjectDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
namespace GFramework.SourceGenerators.Abstractions.Bases;
|
namespace GFramework.SourceGenerators.Abstractions.Bases;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 标记类的优先级,自动生成 <see cref="GFramework.Core.Abstractions.Bases.IPrioritized"/> 接口实现
|
/// 标记类的优先级,自动生成 <c>GFramework.Core.Abstractions.Bases.IPrioritized</c> 接口实现。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <remarks>
|
/// <remarks>
|
||||||
/// 使用此特性可以避免手动实现 IPrioritized 接口。
|
/// 使用此特性可以避免手动实现 IPrioritized 接口。
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@ -14,9 +14,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Using Include="GFramework.SourceGenerators.Abstractions"/>
|
<Using Include="GFramework.SourceGenerators.Abstractions"/>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj" PrivateAssets="all"/>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<PackageReference Update="Meziantou.Analyzer" Version="3.0.25">
|
<PackageReference Update="Meziantou.Analyzer" Version="3.0.25">
|
||||||
<PrivateAssets>all</PrivateAssets>
|
<PrivateAssets>all</PrivateAssets>
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
<Project>
|
<Project>
|
||||||
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
<!-- import parent: https://docs.microsoft.com/en-us/visualstudio/msbuild/customize-your-build -->
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
||||||
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
<EmbedUntrackedSources>true</EmbedUntrackedSources>
|
||||||
<!--
|
<!--
|
||||||
|
|||||||
@ -56,7 +56,7 @@ public sealed class PriorityGenerator : MetadataAttributeClassGeneratorBase
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 3. 必须是 partial
|
// 3. 必须是 partial
|
||||||
if (syntax.Modifiers.All(m => m.Kind() != SyntaxKind.PartialKeyword))
|
if (syntax.Modifiers.All(m => !m.IsKind(SyntaxKind.PartialKeyword)))
|
||||||
{
|
{
|
||||||
context.ReportDiagnostic(Diagnostic.Create(
|
context.ReportDiagnostic(Diagnostic.Create(
|
||||||
PriorityDiagnostic.MustBePartial,
|
PriorityDiagnostic.MustBePartial,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<PackageId>GeWuYou.$(AssemblyName)</PackageId>
|
<PackageId>GeWuYou.$(AssemblyName)</PackageId>
|
||||||
<TargetFramework>netstandard2.1</TargetFramework>
|
<TargetFramework>netstandard2.0</TargetFramework>
|
||||||
|
|
||||||
<!-- 这是 Analyzer,不是运行时库 -->
|
<!-- 这是 Analyzer,不是运行时库 -->
|
||||||
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
<IsRoslynAnalyzer>true</IsRoslynAnalyzer>
|
||||||
@ -30,7 +30,6 @@
|
|||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\$(AssemblyName).Abstractions\$(AssemblyName).Abstractions.csproj" PrivateAssets="all"/>
|
<ProjectReference Include="..\$(AssemblyName).Abstractions\$(AssemblyName).Abstractions.csproj" PrivateAssets="all"/>
|
||||||
<ProjectReference Include="..\$(AssemblyName).Common\$(AssemblyName).Common.csproj" PrivateAssets="all"/>
|
<ProjectReference Include="..\$(AssemblyName).Common\$(AssemblyName).Common.csproj" PrivateAssets="all"/>
|
||||||
<ProjectReference Include="..\GFramework.Core.Abstractions\GFramework.Core.Abstractions.csproj" PrivateAssets="all"/>
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<!-- ★关键:只把 Generator DLL 放进 analyzers -->
|
<!-- ★关键:只把 Generator DLL 放进 analyzers -->
|
||||||
|
|||||||
@ -16,11 +16,16 @@
|
|||||||
<PackageReadmeFile>README.md</PackageReadmeFile>
|
<PackageReadmeFile>README.md</PackageReadmeFile>
|
||||||
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
|
<TargetFrameworks>net8.0;net9.0;net10.0</TargetFrameworks>
|
||||||
<IncludeBuildOutput>false</IncludeBuildOutput>
|
<IncludeBuildOutput>false</IncludeBuildOutput>
|
||||||
|
<!-- This package is a pure meta-package that only aggregates dependencies. -->
|
||||||
|
<NoPackageAnalysis>false</NoPackageAnalysis>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<!-- 排除不需要参与打包/编译的目录 -->
|
<!-- 排除不需要参与打包/编译的目录 -->
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="README.md" Pack="true" PackagePath=""/>
|
<None Include="README.md" Pack="true" PackagePath=""/>
|
||||||
|
<None Include="packaging/_._" Pack="true" PackagePath="lib/net8.0/_._"/>
|
||||||
|
<None Include="packaging/_._" Pack="true" PackagePath="lib/net9.0/_._"/>
|
||||||
|
<None Include="packaging/_._" Pack="true" PackagePath="lib/net10.0/_._"/>
|
||||||
<None Remove="GFramework.Core\**"/>
|
<None Remove="GFramework.Core\**"/>
|
||||||
<None Remove="GFramework.Game\**"/>
|
<None Remove="GFramework.Game\**"/>
|
||||||
<None Remove="GFramework.Godot\**"/>
|
<None Remove="GFramework.Godot\**"/>
|
||||||
|
|||||||
1
packaging/_._
Normal file
1
packaging/_._
Normal file
@ -0,0 +1 @@
|
|||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user