diff --git a/mROA.Codegen/SampleIncrementalSourceGenerator.cs b/mROA.Codegen/SampleIncrementalSourceGenerator.cs index 109639b..31f9dd6 100644 --- a/mROA.Codegen/SampleIncrementalSourceGenerator.cs +++ b/mROA.Codegen/SampleIncrementalSourceGenerator.cs @@ -102,23 +102,25 @@ namespace {Namespace} .OfType(); Console.WriteLine(methodBody.Select(i => i.ToDisplayString())); + var originalName = className; // Build up the source code className = className.TrimStart('I') + "RemoteEndpoint"; var code = $@"// using System; +using mROA.Implementation; using System.Collections.Generic; namespace {namespaceName}; -partial class {className} (int id, ISerialisationModule.IFrontendSerialisationModule serialisationModule) : ITestParameter, IRemoteObject +partial class {className} (int id, ISerialisationModule.IFrontendSerialisationModule serialisationModule) : {originalName}, IRemoteObject {{ public int Id => id; }} "; // Add the source code to the compilation. - context.AddSource($"{className}.g.cs", SourceText.From(code, Encoding.UTF8)); + // context.AddSource($"{className}.g.cs", SourceText.From(code, Encoding.UTF8)); } } } \ No newline at end of file diff --git a/mROA.Codegen/obj/Debug/netstandard2.0/mROA.Codegen.AssemblyInfo.cs b/mROA.Codegen/obj/Debug/netstandard2.0/mROA.Codegen.AssemblyInfo.cs index 9ad4294..01dbb28 100644 --- a/mROA.Codegen/obj/Debug/netstandard2.0/mROA.Codegen.AssemblyInfo.cs +++ b/mROA.Codegen/obj/Debug/netstandard2.0/mROA.Codegen.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("mROA.Codegen")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1888db3522e2880c8ef7146ee78cc413905212c4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d732510a9fde122ff874ca08ed8c0f85b5fe6c02")] [assembly: System.Reflection.AssemblyProductAttribute("mROA.Codegen")] [assembly: System.Reflection.AssemblyTitleAttribute("mROA.Codegen")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/mROA.Example/ITestController.cs b/mROA.Example/ITestController.cs index adf052e..66da71d 100644 --- a/mROA.Example/ITestController.cs +++ b/mROA.Example/ITestController.cs @@ -2,7 +2,7 @@ namespace mROA.Example; -[SharedObjectInterafce] +[SharedObjectInterface] public interface ITestController { void A(); diff --git a/mROA.Example/ITestParameter.cs b/mROA.Example/ITestParameter.cs index 7658ef7..415603d 100644 --- a/mROA.Example/ITestParameter.cs +++ b/mROA.Example/ITestParameter.cs @@ -2,7 +2,7 @@ using mROA.Implementation; namespace mROA.Example; -[SharedObjectInterafce] +[SharedObjectInterface] public interface ITestParameter { public int Test(); diff --git a/mROA.Example/obj/Debug/net9.0/mROA.Example.AssemblyInfo.cs b/mROA.Example/obj/Debug/net9.0/mROA.Example.AssemblyInfo.cs index 1a0d397..f58ad61 100644 --- a/mROA.Example/obj/Debug/net9.0/mROA.Example.AssemblyInfo.cs +++ b/mROA.Example/obj/Debug/net9.0/mROA.Example.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("mROA.Example")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1888db3522e2880c8ef7146ee78cc413905212c4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d732510a9fde122ff874ca08ed8c0f85b5fe6c02")] [assembly: System.Reflection.AssemblyProductAttribute("mROA.Example")] [assembly: System.Reflection.AssemblyTitleAttribute("mROA.Example")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/mROA.Test/obj/Debug/net9.0/mROA.Test.AssemblyInfo.cs b/mROA.Test/obj/Debug/net9.0/mROA.Test.AssemblyInfo.cs index 3d55e76..a68ed5a 100644 --- a/mROA.Test/obj/Debug/net9.0/mROA.Test.AssemblyInfo.cs +++ b/mROA.Test/obj/Debug/net9.0/mROA.Test.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("mROA.Test")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1888db3522e2880c8ef7146ee78cc413905212c4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d732510a9fde122ff874ca08ed8c0f85b5fe6c02")] [assembly: System.Reflection.AssemblyProductAttribute("mROA.Test")] [assembly: System.Reflection.AssemblyTitleAttribute("mROA.Test")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")] diff --git a/mROA/Implementation/Attributes/SharedObjectInterafceAttribute.cs b/mROA/Implementation/Attributes/SharedObjectInterafceAttribute.cs deleted file mode 100644 index 798e581..0000000 --- a/mROA/Implementation/Attributes/SharedObjectInterafceAttribute.cs +++ /dev/null @@ -1,3 +0,0 @@ -namespace mROA.Implementation; - -public class SharedObjectInterafceAttribute : Attribute; \ No newline at end of file diff --git a/mROA/Implementation/Attributes/SharedObjectInterfaceAttribute.cs b/mROA/Implementation/Attributes/SharedObjectInterfaceAttribute.cs new file mode 100644 index 0000000..b177e09 --- /dev/null +++ b/mROA/Implementation/Attributes/SharedObjectInterfaceAttribute.cs @@ -0,0 +1,3 @@ +namespace mROA.Implementation; + +public class SharedObjectInterfaceAttribute : Attribute; \ No newline at end of file diff --git a/mROA/Implementation/ContextRepository.cs b/mROA/Implementation/ContextRepository.cs index 62d129d..e07f58c 100644 --- a/mROA/Implementation/ContextRepository.cs +++ b/mROA/Implementation/ContextRepository.cs @@ -27,7 +27,7 @@ public class ContextRepository : IContextRepository _singletons = types.ToFrozenDictionary( t => t.GetInterfaces().FirstOrDefault(i => - i.GetCustomAttributes(typeof(SharedObjectInterafceAttribute), true).Length > 0)!.GetHashCode(), + i.GetCustomAttributes(typeof(SharedObjectInterfaceAttribute), true).Length > 0)!.GetHashCode(), Activator.CreateInstance); } diff --git a/mROA/Implementation/MethodRepository.cs b/mROA/Implementation/MethodRepository.cs index a15c986..5ecc91d 100644 --- a/mROA/Implementation/MethodRepository.cs +++ b/mROA/Implementation/MethodRepository.cs @@ -27,7 +27,7 @@ public class MethodRepository : IMethodRepository public void CollectForAssembly(Assembly assembly) { - var types = assembly.GetTypes().Where(i => i.IsInterface && i.GetCustomAttributes(typeof(SharedObjectInterafceAttribute), true).Length > 0); + var types = assembly.GetTypes().Where(i => i.IsInterface && i.GetCustomAttributes(typeof(SharedObjectInterfaceAttribute), true).Length > 0); foreach (var type in types) { foreach (var method in type.GetMethods()) diff --git a/mROA/obj/Debug/net9.0/mROA.AssemblyInfo.cs b/mROA/obj/Debug/net9.0/mROA.AssemblyInfo.cs index 1e63963..497e2c7 100644 --- a/mROA/obj/Debug/net9.0/mROA.AssemblyInfo.cs +++ b/mROA/obj/Debug/net9.0/mROA.AssemblyInfo.cs @@ -13,7 +13,7 @@ using System.Reflection; [assembly: System.Reflection.AssemblyCompanyAttribute("mROA")] [assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")] [assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")] -[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+1888db3522e2880c8ef7146ee78cc413905212c4")] +[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+d732510a9fde122ff874ca08ed8c0f85b5fe6c02")] [assembly: System.Reflection.AssemblyProductAttribute("mROA")] [assembly: System.Reflection.AssemblyTitleAttribute("mROA")] [assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]