调整源码生成器结构

This commit is contained in:
ChenYi 2025-04-29 09:14:58 +08:00
parent 5c19d02fdd
commit 083a28f7af
15 changed files with 46 additions and 34 deletions

View File

@ -62,9 +62,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "0.Docs", "0.Docs", "{D8346C
readme.md = readme.md
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Analyzers.Attributes", "shared\JiShe.CollectBus.Analyzers.Attributes\JiShe.CollectBus.Analyzers.Attributes.csproj", "{D834B28F-E336-4E05-A5DD-DAF68E3342AA}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Analyzers.Shared", "shared\JiShe.CollectBus.Analyzers.Shared\JiShe.CollectBus.Analyzers.Shared.csproj", "{DD68F314-BC66-5601-B094-B1A7BE93F4E0}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Analyzers", "shared\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj", "{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "JiShe.CollectBus.Analyzers", "modules\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj", "{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -152,14 +152,14 @@ Global
{75B7D419-C261-577D-58D6-AA3ACED9129F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75B7D419-C261-577D-58D6-AA3ACED9129F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75B7D419-C261-577D-58D6-AA3ACED9129F}.Release|Any CPU.Build.0 = Release|Any CPU
{D834B28F-E336-4E05-A5DD-DAF68E3342AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D834B28F-E336-4E05-A5DD-DAF68E3342AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D834B28F-E336-4E05-A5DD-DAF68E3342AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D834B28F-E336-4E05-A5DD-DAF68E3342AA}.Release|Any CPU.Build.0 = Release|Any CPU
{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24}.Debug|Any CPU.Build.0 = Debug|Any CPU
{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24}.Release|Any CPU.ActiveCfg = Release|Any CPU
{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24}.Release|Any CPU.Build.0 = Release|Any CPU
{DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD68F314-BC66-5601-B094-B1A7BE93F4E0}.Release|Any CPU.Build.0 = Release|Any CPU
{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -185,8 +185,8 @@ Global
{8A61DF78-069B-40B5-8811-614E2960443E} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC}
{E27377CC-E2D3-4237-060F-96EA214D3129} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC}
{75B7D419-C261-577D-58D6-AA3ACED9129F} = {3C3F9DB2-EC97-4464-B49F-BF1A0C2B46DC}
{D834B28F-E336-4E05-A5DD-DAF68E3342AA} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B}
{00DF55EE-82CF-B5AA-F8C7-0E5B823FBC24} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B}
{DD68F314-BC66-5601-B094-B1A7BE93F4E0} = {EBF7C01F-9B4F-48E6-8418-2CBFDA51EB0B}
{EB97C7BB-1E4A-CBA4-04C1-22DBF48A253A} = {2E0FE301-34C3-4561-9CAE-C7A9E65AEE59}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4324B3B4-B60B-4E3C-91D8-59576B4E26DD}

View File

@ -11,9 +11,9 @@ namespace JiShe.CollectBus.IncrementalGenerator
/// 复杂类型源生成器
/// </summary>
[Generator(LanguageNames.CSharp)]
public class ComplexTypeSourceGenerator : IIncrementalGenerator
public class ComplexTypeSourceAnalyzers : IIncrementalGenerator
{
private const string AttributeFullName = "JiShe.CollectBus.Analyzers.Attributes.GenerateAccessorsAttribute";
private const string AttributeFullName = "JiShe.CollectBus.Analyzers.Shared.GenerateAccessorsAttribute";
public void Initialize(IncrementalGeneratorInitializationContext context)
{

View File

@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;
namespace JiShe.CollectBus.Analyzers
{
internal class ISourceAnalyzersProvider
{
}
}

View File

@ -16,6 +16,6 @@
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.13.0" PrivateAssets="all" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\JiShe.CollectBus.Analyzers.Attributes\JiShe.CollectBus.Analyzers.Attributes.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers.Shared\JiShe.CollectBus.Analyzers.Shared.csproj" />
</ItemGroup>
</Project>

View File

@ -10,11 +10,11 @@
<PackageReference Include="Volo.Abp" Version="8.3.3" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers.Attributes\JiShe.CollectBus.Analyzers.Attributes.csproj"/>
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers.Shared\JiShe.CollectBus.Analyzers.Shared.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Common\JiShe.CollectBus.Common.csproj" />
<ProjectReference Include="..\..\modules\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
</Project>

View File

@ -1,4 +1,4 @@
using JiShe.CollectBus.Analyzers.Attributes;
using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;

View File

@ -1,4 +1,4 @@
using JiShe.CollectBus.Analyzers.Attributes;
using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;

View File

@ -66,7 +66,7 @@ public class SampleAppService : CollectBusAppService, ISampleAppService, IKafkaS
IssuedMessageHexString = "messageHexString",
Timestamps = testTime// DateTimeOffset.UtcNow.ToUnixTimeNanoseconds()//testTime.GetDateTimeOffset().ToUnixTimeNanoseconds(),
};
//ElectricityMeterExtension.get
//ElectricityMeterTreeModelExtension.GetCurrent()
await _iotDBProvider.InsertAsync(meter);
}

View File

@ -1,4 +1,4 @@
using JiShe.CollectBus.Analyzers.Attributes;
using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;
using JiShe.CollectBus.IoTDB.Model;

View File

@ -1,4 +1,4 @@
using JiShe.CollectBus.Analyzers.Attributes;
using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;
using JiShe.CollectBus.IoTDB.Model;

View File

@ -1,4 +1,4 @@
using JiShe.CollectBus.Analyzers.Attributes;
using JiShe.CollectBus.Analyzers.Shared;
using JiShe.CollectBus.IoTDB.Attribute;
using JiShe.CollectBus.IoTDB.Enums;
using JiShe.CollectBus.IoTDB.Model;

View File

@ -1,6 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<RootNamespace>JiShe.CollectBus</RootNamespace>
@ -21,13 +23,11 @@
<ItemGroup>
<ProjectReference Include="..\..\modules\JiShe.CollectBus.FreeSql\JiShe.CollectBus.FreeSql.csproj" />
<ProjectReference Include="..\..\modules\JiShe.CollectBus.IoTDB\JiShe.CollectBus.IoTDB.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers.Shared\JiShe.CollectBus.Analyzers.Shared.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Common\JiShe.CollectBus.Common.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Domain.Shared\JiShe.CollectBus.Domain.Shared.csproj" />
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers.Attributes\JiShe.CollectBus.Analyzers.Attributes.csproj"/>
<ProjectReference Include="..\..\shared\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj" OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
<ProjectReference Include="..\..\modules\JiShe.CollectBus.Analyzers\JiShe.CollectBus.Analyzers.csproj"
OutputItemType="Analyzer" ReferenceOutputAssembly="false"/>
</ItemGroup>
<ItemGroup>

View File

@ -1,6 +1,6 @@
using System;
namespace JiShe.CollectBus.Analyzers.Attributes
namespace JiShe.CollectBus.Analyzers.Shared
{
/// <summary>
/// 标记需要生成源码的类

View File

@ -1,5 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\common.props" />
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>