SourceGen started

This commit is contained in:
ThomasCharester committed 2026-01-20 16:59:57 +03:00
1 parent a3cd3e86a1
commit a409054750
274 files changed
+14862 -3

No files matched your search

@@ -0,0 +1,5 @@
Customer
Product
Stock
Shop
Employee
@@ -0,0 +1,26 @@
using System.Collections.Generic;
using Entities;
namespace InfraGens.Sample;
public class Examples
{
// Create generated entities, based on DDD.UbiquitousLanguageRegistry.txt
public object[] CreateEntities()
{
return new object[]
{
new Customer(),
new Employee(),
new Product(),
new Shop(),
new Stock()
};
}
// Execute generated method Report
public IEnumerable<string> CreateEntityReport(SampleEntity entity)
{
return entity.Report();
}
}
@@ -0,0 +1,12 @@
using Generators;
namespace InfraGens.Sample;
// This code will not compile until you build the project with the Source Generators
[Report]
public partial class SampleEntity
{
public int Id { get; } = 42;
public string? Name { get; } = "Sample";
}
@@ -0,0 +1,23 @@
{
"runtimeTarget": {
"name": ".NETCoreApp,Version=v8.0",
"signature": ""
},
"compilationOptions": {},
"targets": {
".NETCoreApp,Version=v8.0": {
"InfraGens.Sample/1.0.0": {
"runtime": {
"InfraGens.Sample.dll": {}
}
}
}
},
"libraries": {
"InfraGens.Sample/1.0.0": {
"type": "project",
"serviceable": false,
"sha512": ""
}
}
}
@@ -0,0 +1,4 @@
// <autogenerated />
using System;
using System.Reflection;
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
@@ -0,0 +1,22 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
using System;
using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("InfraGens.Sample")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+a3cd3e86a161e3ee450256b1b37c6a4583c70840")]
[assembly: System.Reflection.AssemblyProductAttribute("InfraGens.Sample")]
[assembly: System.Reflection.AssemblyTitleAttribute("InfraGens.Sample")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
// Generated by the MSBuild WriteCodeFragment class.
@@ -0,0 +1 @@
ff49a1d065da3858c1224dae22c001fae5c9d17e1737f7b26cef44c567a20d60
@@ -0,0 +1,13 @@
is_global = true
build_property.TargetFramework = net8.0
build_property.TargetPlatformMinVersion =
build_property.UsingMicrosoftNETSdkWeb =
build_property.ProjectTypeGuids =
build_property.InvariantGlobalization =
build_property.PlatformNeutralAssembly =
build_property.EnforceExtendedAnalyzerRules =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = InfraGens.Sample
build_property.ProjectDir = A:\Projects\Infra\Assets\SourceGeneration\InfraGens~\InfraGens\InfraGens.Sample\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
@@ -0,0 +1 @@
5537530838be492c04f86b64a3b48c9b7673bfd8a4cff99fd1e4630f277aae64
@@ -0,0 +1,11 @@
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.deps.json
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.dll
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\bin\Debug\net8.0\InfraGens.Sample.pdb
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.GeneratedMSBuildEditorConfig.editorconfig
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.AssemblyInfoInputs.cache
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.AssemblyInfo.cs
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.csproj.CoreCompileInputs.cache
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.dll
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\refint\InfraGens.Sample.dll
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\InfraGens.Sample.pdb
A:\Projects\Infra\Assets\SourceGeneration\InfraGens\InfraGens\InfraGens.Sample\obj\Debug\net8.0\ref\InfraGens.Sample.dll
@@ -0,0 +1,66 @@
{
"format": 1,
"restore": {
"A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj": {}
},
"projects": {
"A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj",
"projectName": "InfraGens.Sample",
"projectPath": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj",
"packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\",
"outputPath": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.417/PortableRuntimeIdentifierGraph.json"
}
}
}
}
}
@@ -0,0 +1,15 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Administrator\.nuget\packages\</NuGetPackageFolders>
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.10.1</NuGetToolVersion>
</PropertyGroup>
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
<SourceRoot Include="C:\Users\Administrator\.nuget\packages\" />
</ItemGroup>
</Project>
@@ -0,0 +1,2 @@
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" />
@@ -0,0 +1,71 @@
{
"version": 3,
"targets": {
"net8.0": {}
},
"libraries": {},
"projectFileDependencyGroups": {
"net8.0": []
},
"packageFolders": {
"C:\\Users\\Administrator\\.nuget\\packages\\": {}
},
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj",
"projectName": "InfraGens.Sample",
"projectPath": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj",
"packagesPath": "C:\\Users\\Administrator\\.nuget\\packages\\",
"outputPath": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\Administrator\\AppData\\Roaming\\NuGet\\NuGet.Config"
],
"originalTargetFrameworks": [
"net8.0"
],
"sources": {
"https://api.nuget.org/v3/index.json": {}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"projectReferences": {}
}
},
"warningProperties": {
"warnAsError": [
"NU1605"
]
},
"restoreAuditProperties": {
"enableAudit": "true",
"auditLevel": "low",
"auditMode": "direct"
}
},
"frameworks": {
"net8.0": {
"targetAlias": "net8.0",
"imports": [
"net461",
"net462",
"net47",
"net471",
"net472",
"net48",
"net481"
],
"assetTargetFallback": true,
"warn": true,
"frameworkReferences": {
"Microsoft.NETCore.App": {
"privateAssets": "all"
}
},
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\8.0.417/PortableRuntimeIdentifierGraph.json"
}
}
}
}
@@ -0,0 +1,8 @@
{
"version": 2,
"dgSpecHash": "EVFRe6jvxS4=",
"success": true,
"projectFilePath": "A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj",
"expectedPackageFiles": [],
"logs": []
}
@@ -0,0 +1 @@
"restore":{"projectUniqueName":"A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj","projectName":"InfraGens.Sample","projectPath":"A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\InfraGens.Sample.csproj","outputPath":"A:\\Projects\\Infra\\Assets\\SourceGeneration\\InfraGens~\\InfraGens\\InfraGens.Sample\\obj\\","projectStyle":"PackageReference","originalTargetFrameworks":["net8.0"],"sources":{"https://api.nuget.org/v3/index.json":{}},"frameworks":{"net8.0":{"targetAlias":"net8.0","projectReferences":{}}},"warningProperties":{"warnAsError":["NU1605"]},"restoreAuditProperties":{"enableAudit":"true","auditLevel":"low","auditMode":"direct"}}"frameworks":{"net8.0":{"targetAlias":"net8.0","imports":["net461","net462","net47","net471","net472","net48","net481"],"assetTargetFallback":true,"warn":true,"frameworkReferences":{"Microsoft.NETCore.App":{"privateAssets":"all"}},"runtimeIdentifierGraphPath":"C:\\Program Files\\dotnet\\sdk\\8.0.417/PortableRuntimeIdentifierGraph.json"}}