Compare commits
2
Commits
AR
...
NotLiminalOne
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
85ac63425c | ||
|
|
a409054750 |
No files matched your search
Generated
+13
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/contentModel.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.Infra.iml
|
||||
/modules.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
Generated
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
Generated
+6
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 07cf07a937934e0094469237b5865b60
|
||||
timeCreated: 1766350980
|
||||
@@ -16,7 +16,7 @@ namespace Code.Infrastructure.App
|
||||
[Inject] public CameraStateMachine Camera { get; set; }
|
||||
}
|
||||
|
||||
[Generators.StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
|
||||
[global::StateMachine(typeof(AppStateMachineContext),typeof(AppStates))]
|
||||
public partial class AppStateMachine
|
||||
{
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Example;
|
||||
using Reflex.Core;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -1,7 +1,4 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.SceneManagement;
|
||||
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
using Code.Infrastructure.Camera;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.SceneLoader;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
|
||||
|
||||
namespace Code.Infrastructure.App.States
|
||||
{
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Camera
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System.Collections.Generic;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Code.Infrastructure.Input;
|
||||
using Reflex.Attributes;
|
||||
using UnityEngine.AddressableAssets;
|
||||
@@ -46,7 +45,7 @@ namespace Code.Infrastructure.Camera
|
||||
[Inject] public EventBus.EventBus EventBus;
|
||||
}
|
||||
|
||||
[Generators.StateMachine(typeof(CameraStateMachineContext), typeof(CameraMode))]
|
||||
[global::StateMachine(typeof(CameraStateMachineContext), typeof(CameraMode))]
|
||||
public partial class CameraStateMachine
|
||||
{
|
||||
public UnityEngine.Camera Camera => StateMachineContext.cameraLoadedData.Camera;
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Camera.CameraStates
|
||||
{
|
||||
[State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
|
||||
// [State(typeof(CameraMode),typeof(CameraStateMachineContext), true)]
|
||||
public partial class NoneCameraState : BaseCameraState
|
||||
{
|
||||
public NoneCameraState(CameraStateMachineContext context, EventBus.EventBus eventBus) : base(context, eventBus)
|
||||
|
||||
File renamed without changes.
File renamed without changes.
@@ -1,17 +1,26 @@
|
||||
using System;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class Config : Attribute
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class State : Attribute
|
||||
@@ -27,23 +36,15 @@ namespace Code.Infrastructure.Generators
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
}
|
||||
public class StateRaisingEvent : Attribute
|
||||
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
}
|
||||
public class Config : Attribute
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
public class SceneIdEnum : Attribute
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class ConfigGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
var configs = TypeCache.GetTypesWithAttribute<Config>();
|
||||
|
||||
var configsCode = "";
|
||||
var configAddCode = "";
|
||||
var configReferencesCode = "";
|
||||
var configReferencesUsingsCode = "";
|
||||
var configOfConfigsCode = "";
|
||||
|
||||
foreach (var cfg in configs)
|
||||
{
|
||||
var configFields = "";
|
||||
var configUsings = "";
|
||||
|
||||
var mem = cfg.GetFields();
|
||||
var members = mem.Where(m => m.HasAttribute<ToConfig>()).ToList();
|
||||
foreach (var m in members)
|
||||
{
|
||||
configUsings += $"using {m.FieldType.Namespace};\n";
|
||||
configFields += $"public {m.FieldType.FullName} {m.Name};\n";
|
||||
}
|
||||
|
||||
var attribute = cfg.GetAttribute<Config>();
|
||||
|
||||
configUsings += @"
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
";
|
||||
var configCode = $@"
|
||||
#pragma warning disable CS0105
|
||||
{configUsings}
|
||||
namespace {cfg.Namespace}{{
|
||||
#pragma warning restore CS0105
|
||||
[CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
|
||||
public class {cfg.Name}Config : ScriptableObject
|
||||
{{
|
||||
{configFields}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
|
||||
|
||||
configReferencesUsingsCode += $"using {cfg.Namespace};\n";
|
||||
|
||||
if (attribute.Multiple)
|
||||
{
|
||||
configReferencesCode += $"public string {cfg.Name};\n";
|
||||
configAddCode += $@"
|
||||
_multipleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
";
|
||||
}
|
||||
else
|
||||
{
|
||||
configReferencesCode += $"public AssetReference {cfg.Name};\n";
|
||||
configAddCode += $@"
|
||||
_singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
";
|
||||
}
|
||||
}
|
||||
configsCode += $@"
|
||||
#pragma warning disable CS0105
|
||||
{configReferencesUsingsCode}
|
||||
using UnityEngine;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs
|
||||
{{
|
||||
|
||||
public partial class ConfigLocator
|
||||
{{
|
||||
partial void LoadConfigs()
|
||||
{{
|
||||
SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>(""SystemConfigsReferences"");
|
||||
{configAddCode}
|
||||
//_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"ConfigLocator.Generated.cs", configsCode);
|
||||
|
||||
configOfConfigsCode += $@"
|
||||
#pragma warning disable CS0105
|
||||
{configReferencesUsingsCode}
|
||||
using UnityEngine.AddressableAssets;
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.Configs{{
|
||||
public partial class SystemConfigsReferences
|
||||
{{
|
||||
{configReferencesCode}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 026403be8eae4546adcb407308031c1d
|
||||
timeCreated: 1765660396
|
||||
@@ -1,148 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class SceneLoaderGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
var Enum = TypeCache.GetTypesWithAttribute<SceneIdEnum>();
|
||||
|
||||
var loaderCode = "";
|
||||
var dictionaryCode = "";
|
||||
var interfacesCode = "";
|
||||
var interfacesUsingsCode = $@"
|
||||
using Code.Infrastructure.EventBus;
|
||||
";
|
||||
|
||||
foreach (var en in Enum)
|
||||
{
|
||||
if (!en.IsEnum) return;
|
||||
|
||||
var members = en.GetFields();
|
||||
foreach (var member in members)
|
||||
{
|
||||
if(member.FieldType.FullName != en.FullName) continue;
|
||||
interfacesCode += $@"
|
||||
public interface IOn{member.Name}SceneLoadedHandler : IGlobalSubscriber
|
||||
{{
|
||||
void On{member.Name}SceneLoaded();
|
||||
}}
|
||||
";
|
||||
dictionaryCode += $@"
|
||||
|
||||
_scenesActions.Add(SceneId.{member.Name},() => _eventBus.RaiseEvent<IOn{member.Name}SceneLoadedHandler>(h=> h.On{member.Name}SceneLoaded()));
|
||||
";
|
||||
}
|
||||
}
|
||||
|
||||
loaderCode = $@"
|
||||
#pragma warning disable CS0105
|
||||
{interfacesUsingsCode}
|
||||
#pragma warning restore CS0105
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{{
|
||||
public partial class SceneLoader{{
|
||||
partial void SetupScenesInfo(){{
|
||||
{dictionaryCode}
|
||||
}}
|
||||
}}
|
||||
{interfacesCode}
|
||||
}}
|
||||
";
|
||||
context.AddCode($"SceneLoader.Generated.cs", loaderCode);
|
||||
// var configsCode = "";
|
||||
// var configCode = "";
|
||||
// var configUsings = "";
|
||||
// var configFields = "";
|
||||
// var configAddCode = "";
|
||||
// var configReferencesCode = "";
|
||||
// var configReferencesUsingsCode = "";
|
||||
// var configOfConfigsCode = "";
|
||||
//
|
||||
// foreach (var cfg in configs)
|
||||
// {
|
||||
// var mem = cfg.GetFields();
|
||||
// var members = mem.Where(m => m.HasAttribute<ToConfig>()).ToList();
|
||||
// foreach (var m in members)
|
||||
// {
|
||||
// configUsings += $"using {m.FieldType.Namespace};\n";
|
||||
// configFields += $"public {m.FieldType.FullName} {m.Name};\n";
|
||||
// }
|
||||
//
|
||||
// var attribute = cfg.GetAttribute<Config>();
|
||||
//
|
||||
// configUsings += @"
|
||||
// using UnityEngine;
|
||||
// using UnityEngine.AddressableAssets;
|
||||
// ";
|
||||
// configCode = $@"
|
||||
// {configUsings}
|
||||
// namespace {cfg.Namespace}{{
|
||||
// [CreateAssetMenu(fileName = ""{cfg.Name}Config"", menuName = ""{attribute.MenuName}"")]
|
||||
// public class {cfg.Name}Config : ScriptableObject
|
||||
// {{
|
||||
// {configFields}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"{cfg.Name}Config.Generated.cs", configCode);
|
||||
//
|
||||
// configReferencesUsingsCode += $"using {cfg.Namespace};\n";
|
||||
//
|
||||
// if (attribute.Multiple)
|
||||
// {
|
||||
// configReferencesCode += $"public String {cfg.Name};\n";
|
||||
// configAddCode += $@"
|
||||
// _multipleConfigReferences.Add(typeof({cfg.FullName}), systemConfigsReferences.{cfg.Name});
|
||||
// ";
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// configReferencesCode += $"public AssetReference {cfg.Name};\n";
|
||||
// configAddCode += $@"
|
||||
// _singleConfigReferences.Add(typeof({cfg.FullName}Config), systemConfigsReferences.{cfg.Name});
|
||||
// ";
|
||||
// }
|
||||
// }
|
||||
// configsCode += $@"
|
||||
// {configReferencesUsingsCode}
|
||||
// using UnityEngine;
|
||||
//
|
||||
// namespace Code.Infrastructure.Configs
|
||||
// {{
|
||||
//
|
||||
// public partial class ConfigLocator
|
||||
// {{
|
||||
// partial void LoadConfigs()
|
||||
// {{
|
||||
// SystemConfigsReferences systemConfigsReferences = Resources.Load<SystemConfigsReferences>(""SystemConfigsReferences"");
|
||||
// {configAddCode}
|
||||
// //_singleConfigReferences.Add(typeof(ScenesAssetReferences), systemConfigsReferences.scenesAssetReferences);
|
||||
// }}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"ConfigLocator.Generated.cs", configsCode);
|
||||
//
|
||||
// configOfConfigsCode += $@"
|
||||
// {configReferencesUsingsCode}
|
||||
// using UnityEngine.AddressableAssets;
|
||||
//
|
||||
// namespace Code.Infrastructure.Configs{{
|
||||
// public partial class SystemConfigsReferences
|
||||
// {{
|
||||
// {configReferencesCode}
|
||||
// }}
|
||||
// }}
|
||||
// ";
|
||||
// context.AddCode($"SystemConfigsReferences.Generated.cs", configOfConfigsCode);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 92ec56ffd46d4a569bb9a7d436790439
|
||||
timeCreated: 1766423754
|
||||
@@ -1,131 +0,0 @@
|
||||
using System.Linq;
|
||||
using Unity.VisualScripting;
|
||||
using UnityCodeGen;
|
||||
using UnityEditor;
|
||||
|
||||
namespace Code.Infrastructure.Generators
|
||||
{
|
||||
[Generator]
|
||||
public class StateMachineGenerator : ICodeGenerator
|
||||
{
|
||||
public void Execute(GeneratorContext context)
|
||||
{
|
||||
GenerateStates(context);
|
||||
|
||||
GenerateStateMachine(context);
|
||||
}
|
||||
|
||||
private void GenerateStateMachine(GeneratorContext context)
|
||||
{
|
||||
var stateMachines = TypeCache.GetTypesWithAttribute<StateMachine>();
|
||||
|
||||
foreach (var sm in stateMachines)
|
||||
{
|
||||
var attribute = sm.GetAttribute<StateMachine>();
|
||||
|
||||
var states = TypeCache.GetTypesWithAttribute<State>()
|
||||
.Where(st =>
|
||||
st.GetAttribute<State>().StateMachineContext.FullName ==
|
||||
attribute.StateMachineContextType.FullName);
|
||||
|
||||
var statesCode = "";
|
||||
var statesNamespacesCode = "";
|
||||
|
||||
foreach (var st in states)
|
||||
{
|
||||
statesNamespacesCode += $@"
|
||||
using {st.Namespace};
|
||||
";
|
||||
statesCode += $@"
|
||||
var state{st.Name} = new {st.Name}(StateMachineContext,eventBus);
|
||||
States.Add(state{st.Name}.myState, state{st.Name});
|
||||
";
|
||||
}
|
||||
|
||||
var stateMachineCode =
|
||||
$@"
|
||||
// <auto-generated/>
|
||||
#pragma warning disable CS0105
|
||||
using Code.Infrastructure.StateMachine;
|
||||
{statesNamespacesCode}
|
||||
#pragma warning restore CS0105
|
||||
namespace {sm.Namespace}
|
||||
{{
|
||||
|
||||
public partial class {sm.Name} : AbstractStateMachine<{attribute.StateMachineEnumType.FullName},{attribute.StateMachineContextType.FullName}>
|
||||
{{
|
||||
|
||||
public {sm.Name}({attribute.StateMachineContextType.FullName} context, EventBus.EventBus eventBus) : base(context)
|
||||
{{
|
||||
{statesCode}
|
||||
}}
|
||||
|
||||
protected override bool CheckTransitionAllowed({attribute.StateMachineEnumType.FullName} nextState) => AllowedStates.HasFlag(nextState);
|
||||
protected override void ResetAllowedTransitions() => AllowedStates = 0;
|
||||
}}
|
||||
|
||||
public static class {sm.Name}Extensions
|
||||
{{
|
||||
public static AbstractStateMachine<{attribute.StateMachineEnumType.FullName}, {attribute.StateMachineContextType.FullName}> AllowStateTransition(
|
||||
this AbstractStateMachine<{attribute.StateMachineEnumType.FullName}, {attribute.StateMachineContextType.FullName}> stateMachine, {attribute.StateMachineEnumType.FullName} state)
|
||||
{{
|
||||
if (stateMachine == null) return null;
|
||||
|
||||
stateMachine.AllowedStates |= state;
|
||||
return stateMachine;
|
||||
}}
|
||||
}}
|
||||
}}
|
||||
|
||||
";
|
||||
|
||||
context.AddCode($"{sm.FullName}.Generated.cs", stateMachineCode);
|
||||
}
|
||||
}
|
||||
|
||||
private void GenerateStates(GeneratorContext context)
|
||||
{
|
||||
var states = TypeCache.GetTypesWithAttribute<State>();
|
||||
|
||||
var statesCode = "";
|
||||
foreach (var st in states)
|
||||
{
|
||||
var attribute = st.GetAttribute<State>();
|
||||
|
||||
var fireStatesCode = "";
|
||||
if(st.HasAttribute<StateRaisingEvent>()) fireStatesCode = $@"
|
||||
protected override void _fireEnterState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IEnterStateHandle<{st.FullName}>>(h => h.EnterState());
|
||||
}}
|
||||
|
||||
protected override void _fireExitState()
|
||||
{{
|
||||
EventBus.RaiseEvent<IExitStateHandle<{st.FullName}>>(h => h.ExitState());
|
||||
}}
|
||||
";
|
||||
var genetics = "";
|
||||
if(!attribute.SilentBitch) genetics = $@" : BaseState<{attribute.StateEnum.FullName}, {attribute.StateMachineContext.FullName}>";
|
||||
|
||||
statesCode = $@"
|
||||
|
||||
// retard-generated
|
||||
|
||||
using Code.Infrastructure.StateMachine;
|
||||
|
||||
namespace {st.Namespace}
|
||||
{{
|
||||
public partial class {st.Name} {genetics}
|
||||
{{
|
||||
{fireStatesCode}
|
||||
}}
|
||||
}}
|
||||
";
|
||||
|
||||
|
||||
context.AddCode($"{st.FullName}.Generated.cs", statesCode);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,3 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9fb4b6961cd0471d8183511316c15000
|
||||
timeCreated: 1765563824
|
||||
@@ -1,7 +1,6 @@
|
||||
using System;
|
||||
using Code.Infrastructure.Configs;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.InputSystem;
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using Code.Infrastructure.Generators;
|
||||
|
||||
namespace Code.Infrastructure.SceneLoader
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using Code.Infrastructure.Configs;
|
||||
using Code.Infrastructure.EventBus;
|
||||
using Code.Infrastructure.Generators;
|
||||
using Cysharp.Threading.Tasks;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using Code.Infrastructure.App;
|
||||
|
||||
namespace Code.Infrastructure.StateMachine
|
||||
{
|
||||
public abstract class BaseState<TEnum, TStateMachineContext>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3d2c689e65afcd2498be16afac55fa0f
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3e1d53c76c82adb46902c4d2603e79c2
|
||||
labels:
|
||||
- RoslynAnalyzer
|
||||
PluginImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 3
|
||||
iconMap: {}
|
||||
executionOrder: {}
|
||||
defineConstraints: []
|
||||
isPreloaded: 0
|
||||
isOverridable: 0
|
||||
isExplicitlyReferenced: 1
|
||||
validateReferences: 0
|
||||
platformData:
|
||||
Android:
|
||||
enabled: 0
|
||||
settings:
|
||||
AndroidLibraryDependee: UnityLibrary
|
||||
AndroidSharedLibraryType: Executable
|
||||
CPU: ARMv7
|
||||
Any:
|
||||
enabled: 0
|
||||
settings:
|
||||
Exclude Android: 1
|
||||
Exclude Editor: 1
|
||||
Exclude Linux64: 1
|
||||
Exclude OSXUniversal: 1
|
||||
Exclude Win: 1
|
||||
Exclude Win64: 1
|
||||
Editor:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
DefaultValueInitialized: true
|
||||
OS: AnyOS
|
||||
Linux64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
OSXUniversal:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Win:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
Win64:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: None
|
||||
WindowsStoreApps:
|
||||
enabled: 0
|
||||
settings:
|
||||
CPU: AnyCPU
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,13 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Rider ignored files
|
||||
/contentModel.xml
|
||||
/modules.xml
|
||||
/projectSettingsUpdater.xml
|
||||
/.idea.InfraGens.iml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
||||
@@ -0,0 +1 @@
|
||||
InfraGens
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="UserContentModel">
|
||||
<attachedFolders />
|
||||
<explicitIncludes />
|
||||
<explicitExcludes />
|
||||
</component>
|
||||
</project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/../../.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
||||
+5
@@ -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,56 @@
|
||||
using System;
|
||||
|
||||
[Config("Configs/Camera/CameraConfig")]
|
||||
public class GameCamera
|
||||
{
|
||||
[ToConfig] public int Camera;
|
||||
}
|
||||
public class StateMachine : Attribute
|
||||
{
|
||||
public Type StateMachineContextType;
|
||||
public Type StateMachineEnumType;
|
||||
|
||||
public StateMachine(Type stateMachineContextType, Type stateMachineEnumType)
|
||||
{
|
||||
StateMachineContextType = stateMachineContextType;
|
||||
StateMachineEnumType = stateMachineEnumType;
|
||||
}
|
||||
}
|
||||
|
||||
public class State : Attribute
|
||||
{
|
||||
public Type StateEnum;
|
||||
public Type StateMachineContext;
|
||||
public bool SilentBitch; // Поэтому нейминг переменных очень важен
|
||||
|
||||
public State(Type stateEnum, Type stateMachineContext, bool silentBitch = false)
|
||||
{
|
||||
StateEnum = stateEnum;
|
||||
StateMachineContext = stateMachineContext;
|
||||
SilentBitch = silentBitch;
|
||||
}
|
||||
}
|
||||
|
||||
public class StateRaisingEvent : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class Config : Attribute
|
||||
{
|
||||
public bool Multiple;
|
||||
public string MenuName;
|
||||
|
||||
public Config(string menuName, bool multiple = false)
|
||||
{
|
||||
Multiple = multiple;
|
||||
MenuName = menuName;
|
||||
}
|
||||
}
|
||||
|
||||
public class ToConfig : Attribute
|
||||
{
|
||||
}
|
||||
|
||||
public class SceneIdEnum : Attribute
|
||||
{
|
||||
}
|
||||
+23
@@ -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": ""
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v8.0", FrameworkDisplayName = ".NET 8.0")]
|
||||
+22
@@ -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+a4090547509ba65f8ba7b22442c10d06c15217e0")]
|
||||
[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.
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
ef1fde298251b87291e3f53f6d50441cec1268cfc54dba8a1b093bc8be99164e
|
||||
+13
@@ -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 =
|
||||
BIN
Binary file not shown.
+1
@@ -0,0 +1 @@
|
||||
5537530838be492c04f86b64a3b48c9b7673bfd8a4cff99fd1e4630f277aae64
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
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
|
||||
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\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\ref\InfraGens.Sample.dll
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+66
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+15
@@ -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>
|
||||
+2
@@ -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": []
|
||||
}
|
||||
+1
@@ -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"}}
|
||||
+1
@@ -0,0 +1 @@
|
||||
17689168828010022
|
||||
+1
@@ -0,0 +1 @@
|
||||
17689172170614712
|
||||
+67
@@ -0,0 +1,67 @@
|
||||
// using System.Linq;
|
||||
// using Microsoft.CodeAnalysis;
|
||||
// using Microsoft.CodeAnalysis.CSharp;
|
||||
// using Xunit;
|
||||
//
|
||||
// namespace InfraGens.Tests;
|
||||
//
|
||||
// public class SampleIncrementalSourceGeneratorTests
|
||||
// {
|
||||
// private const string VectorClassText = @"
|
||||
// namespace TestNamespace;
|
||||
//
|
||||
// [Generators.Report]
|
||||
// public partial class Vector3
|
||||
// {
|
||||
// public float X { get; set; }
|
||||
// public float Y { get; set; }
|
||||
// public float Z { get; set; }
|
||||
// }";
|
||||
//
|
||||
// private const string ExpectedGeneratedClassText = @"// <auto-generated/>
|
||||
//
|
||||
// using System;
|
||||
// using System.Collections.Generic;
|
||||
//
|
||||
// namespace TestNamespace;
|
||||
//
|
||||
// partial class Vector3
|
||||
// {
|
||||
// public IEnumerable<string> Report()
|
||||
// {
|
||||
// yield return $""X:{this.X}"";
|
||||
// yield return $""Y:{this.Y}"";
|
||||
// yield return $""Z:{this.Z}"";
|
||||
// }
|
||||
// }
|
||||
// ";
|
||||
//
|
||||
// [Fact]
|
||||
// public void GenerateReportMethod()
|
||||
// {
|
||||
// // Create an instance of the source generator.
|
||||
// var generator = new SampleIncrementalSourceGenerator();
|
||||
//
|
||||
// // Source generators should be tested using 'GeneratorDriver'.
|
||||
// var driver = CSharpGeneratorDriver.Create(generator);
|
||||
//
|
||||
// // We need to create a compilation with the required source code.
|
||||
// var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests),
|
||||
// new[] { CSharpSyntaxTree.ParseText(VectorClassText) },
|
||||
// new[]
|
||||
// {
|
||||
// // To support 'System.Attribute' inheritance, add reference to 'System.Private.CoreLib'.
|
||||
// MetadataReference.CreateFromFile(typeof(object).Assembly.Location)
|
||||
// });
|
||||
//
|
||||
// // Run generators and retrieve all results.
|
||||
// var runResult = driver.RunGenerators(compilation).GetRunResult();
|
||||
//
|
||||
// // All generated files can be found in 'RunResults.GeneratedTrees'.
|
||||
// var generatedFileSyntax = runResult.GeneratedTrees.Single(t => t.FilePath.EndsWith("Vector3.g.cs"));
|
||||
//
|
||||
// // Complex generators should be tested using text comparison.
|
||||
// Assert.Equal(ExpectedGeneratedClassText, generatedFileSyntax.GetText().ToString(),
|
||||
// ignoreLineEndingDifferences: true);
|
||||
// }
|
||||
// }
|
||||
+48
@@ -0,0 +1,48 @@
|
||||
// using System.IO;
|
||||
// using System.Linq;
|
||||
// using InfraGens.Tests.Utils;
|
||||
// using Microsoft.CodeAnalysis.CSharp;
|
||||
// using Xunit;
|
||||
//
|
||||
// namespace InfraGens.Tests;
|
||||
//
|
||||
// public class SampleSourceGeneratorTests
|
||||
// {
|
||||
// private const string DddRegistryText = @"User
|
||||
// Document
|
||||
// Customer";
|
||||
//
|
||||
// [Fact]
|
||||
// public void GenerateClassesBasedOnDDDRegistry()
|
||||
// {
|
||||
// // Create an instance of the source generator.
|
||||
// var generator = new SampleSourceGenerator();
|
||||
//
|
||||
// // Source generators should be tested using 'GeneratorDriver'.
|
||||
// var driver = CSharpGeneratorDriver.Create(new[] { generator },
|
||||
// new[]
|
||||
// {
|
||||
// // Add the additional file separately from the compilation.
|
||||
// new TestAdditionalFile("./DDD.UbiquitousLanguageRegistry.txt", DddRegistryText)
|
||||
// });
|
||||
//
|
||||
// // To run generators, we can use an empty compilation.
|
||||
// var compilation = CSharpCompilation.Create(nameof(SampleSourceGeneratorTests));
|
||||
//
|
||||
// // Run generators. Don't forget to use the new compilation rather than the previous one.
|
||||
// driver.RunGeneratorsAndUpdateCompilation(compilation, out var newCompilation, out _);
|
||||
//
|
||||
// // Retrieve all files in the compilation.
|
||||
// var generatedFiles = newCompilation.SyntaxTrees
|
||||
// .Select(t => Path.GetFileName(t.FilePath))
|
||||
// .ToArray();
|
||||
//
|
||||
// // In this case, it is enough to check the file name.
|
||||
// Assert.Equivalent(new[]
|
||||
// {
|
||||
// "User.g.cs",
|
||||
// "Document.g.cs",
|
||||
// "Customer.g.cs"
|
||||
// }, generatedFiles);
|
||||
// }
|
||||
// }
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
using System.Threading;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.Text;
|
||||
|
||||
namespace InfraGens.Tests.Utils;
|
||||
|
||||
public class TestAdditionalFile : AdditionalText
|
||||
{
|
||||
private readonly SourceText _text;
|
||||
|
||||
public TestAdditionalFile(string path, string text)
|
||||
{
|
||||
Path = path;
|
||||
_text = SourceText.From(text);
|
||||
}
|
||||
|
||||
public override SourceText GetText(CancellationToken cancellationToken = new()) => _text;
|
||||
|
||||
public override string Path { get; }
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+2736
File diff suppressed because it is too large.
Load diff
BIN
Binary file not shown.
+12
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"runtimeOptions": {
|
||||
"tfm": "net8.0",
|
||||
"framework": {
|
||||
"name": "Microsoft.NETCore.App",
|
||||
"version": "8.0.0"
|
||||
},
|
||||
"configProperties": {
|
||||
"System.Runtime.Serialization.EnableUnsafeBinaryFormatterSerialization": false
|
||||
}
|
||||
}
|
||||
}
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Loaded 100 of 332 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user