com.wallstop-studios.dxmessaging 2.2.0 → 3.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (248) hide show
  1. package/CHANGELOG.md +106 -67
  2. package/CHANGELOG.md.meta +7 -7
  3. package/Editor/Analyzers/BaseCallIlInspector.cs +277 -0
  4. package/Editor/Analyzers/BaseCallIlInspector.cs.meta +11 -0
  5. package/Editor/Analyzers/BaseCallLogMessageParser.cs +295 -0
  6. package/Editor/Analyzers/BaseCallLogMessageParser.cs.meta +11 -0
  7. package/Editor/Analyzers/BaseCallReportAggregator.cs +308 -0
  8. package/Editor/Analyzers/BaseCallReportAggregator.cs.meta +11 -0
  9. package/Editor/Analyzers/BaseCallTypeScanner.cs +110 -0
  10. package/Editor/Analyzers/BaseCallTypeScanner.cs.meta +11 -0
  11. package/Editor/Analyzers/BaseCallTypeScannerCore.cs +562 -0
  12. package/Editor/Analyzers/BaseCallTypeScannerCore.cs.meta +11 -0
  13. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs +1122 -0
  14. package/Editor/Analyzers/DxMessagingConsoleHarvester.cs.meta +11 -0
  15. package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +44 -44
  16. package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +44 -44
  17. package/Editor/Analyzers/System.Collections.Immutable.dll.meta +44 -44
  18. package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +44 -44
  19. package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +44 -44
  20. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll +0 -0
  21. package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll.meta +33 -0
  22. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
  23. package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +72 -72
  24. package/Editor/Analyzers.meta +8 -8
  25. package/Editor/AssemblyInfo.cs.meta +3 -3
  26. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +81 -0
  27. package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +11 -0
  28. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +420 -0
  29. package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs.meta +11 -0
  30. package/Editor/CustomEditors/MessagingComponentEditor.cs +1 -1
  31. package/Editor/CustomEditors/MessagingComponentEditor.cs.meta +2 -2
  32. package/Editor/CustomEditors.meta +2 -2
  33. package/Editor/DxMessagingEditorInitializer.cs.meta +2 -2
  34. package/Editor/DxMessagingMenu.cs.meta +11 -11
  35. package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -11
  36. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +190 -0
  37. package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +11 -0
  38. package/Editor/Settings/DxMessagingSettings.cs +189 -0
  39. package/Editor/Settings/DxMessagingSettings.cs.meta +2 -2
  40. package/Editor/Settings/DxMessagingSettingsProvider.cs +50 -33
  41. package/Editor/Settings/DxMessagingSettingsProvider.cs.meta +2 -2
  42. package/Editor/Settings.meta +2 -2
  43. package/Editor/SetupCscRsp.cs +209 -8
  44. package/Editor/SetupCscRsp.cs.meta +2 -2
  45. package/Editor/Testing/MessagingComponentEditorHarness.cs +1 -1
  46. package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +3 -3
  47. package/Editor/Testing.meta +3 -3
  48. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +14 -14
  49. package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
  50. package/Editor.meta +8 -8
  51. package/LICENSE.md +9 -9
  52. package/LICENSE.md.meta +7 -7
  53. package/README.md +941 -900
  54. package/README.md.meta +7 -7
  55. package/Runtime/AssemblyInfo.cs +4 -0
  56. package/Runtime/AssemblyInfo.cs.meta +2 -2
  57. package/Runtime/Core/Attributes/DxAutoConstructorAttribute.cs.meta +2 -2
  58. package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +2 -2
  59. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs +26 -0
  60. package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +11 -0
  61. package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs.meta +2 -2
  62. package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +2 -2
  63. package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +2 -2
  64. package/Runtime/Core/Attributes.meta +2 -2
  65. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs +195 -0
  66. package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs.meta +11 -0
  67. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs +179 -0
  68. package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs.meta +11 -0
  69. package/Runtime/Core/Configuration.meta +9 -0
  70. package/Runtime/Core/DataStructure/CyclicBuffer.cs +2 -2
  71. package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +2 -2
  72. package/Runtime/Core/DataStructure.meta +2 -2
  73. package/Runtime/Core/Diagnostics/MessageEmissionData.cs.meta +2 -2
  74. package/Runtime/Core/Diagnostics/MessageRegistrationData.cs.meta +2 -2
  75. package/Runtime/Core/Diagnostics/MessageRegistrationType.cs.meta +2 -2
  76. package/Runtime/Core/Diagnostics.meta +2 -2
  77. package/Runtime/Core/DxMessagingStaticState.cs +19 -0
  78. package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -11
  79. package/Runtime/Core/Extensions/EnumExtensions.cs.meta +2 -2
  80. package/Runtime/Core/Extensions/IListExtensions.cs.meta +2 -2
  81. package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +12 -12
  82. package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
  83. package/Runtime/Core/Extensions.meta +8 -8
  84. package/Runtime/Core/Helper/MessageCache.cs +32 -0
  85. package/Runtime/Core/Helper/MessageCache.cs.meta +2 -2
  86. package/Runtime/Core/Helper/MessageHelperIndexer.cs.meta +2 -2
  87. package/Runtime/Core/Helper.meta +2 -2
  88. package/Runtime/Core/IMessage.cs +3 -3
  89. package/Runtime/Core/IMessage.cs.meta +11 -11
  90. package/Runtime/Core/InstanceId.cs.meta +11 -11
  91. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs +51 -0
  92. package/Runtime/Core/Internal/TypedDispatchLinkIndex.cs.meta +11 -0
  93. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs +38 -0
  94. package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs.meta +11 -0
  95. package/Runtime/Core/Internal/TypedSlotIndex.cs +81 -0
  96. package/Runtime/Core/Internal/TypedSlotIndex.cs.meta +11 -0
  97. package/Runtime/Core/Internal/TypedSlots.cs +613 -0
  98. package/Runtime/Core/Internal/TypedSlots.cs.meta +11 -0
  99. package/Runtime/Core/Internal.meta +9 -0
  100. package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -11
  101. package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +11 -11
  102. package/Runtime/Core/MessageBus/IMessageBus.cs +177 -3
  103. package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
  104. package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +11 -11
  105. package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +11 -11
  106. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs +16 -0
  107. package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs.meta +11 -0
  108. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs +40 -0
  109. package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs.meta +11 -0
  110. package/Runtime/Core/MessageBus/Internal/BusSlots.cs +718 -0
  111. package/Runtime/Core/MessageBus/Internal/BusSlots.cs.meta +11 -0
  112. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs +38 -0
  113. package/Runtime/Core/MessageBus/Internal/DispatchKind.cs.meta +11 -0
  114. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs +20 -0
  115. package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs.meta +11 -0
  116. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs +28 -0
  117. package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs.meta +11 -0
  118. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs +48 -0
  119. package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs.meta +11 -0
  120. package/Runtime/Core/MessageBus/Internal/ISweepable.cs +15 -0
  121. package/Runtime/Core/MessageBus/Internal/ISweepable.cs.meta +11 -0
  122. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs +222 -0
  123. package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs.meta +11 -0
  124. package/Runtime/Core/MessageBus/Internal/SlotKey.cs +192 -0
  125. package/Runtime/Core/MessageBus/Internal/SlotKey.cs.meta +11 -0
  126. package/Runtime/Core/MessageBus/Internal.meta +9 -0
  127. package/Runtime/Core/MessageBus/MessageBus.cs +2651 -500
  128. package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
  129. package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +11 -11
  130. package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +11 -11
  131. package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
  132. package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
  133. package/Runtime/Core/MessageBus.meta +8 -8
  134. package/Runtime/Core/MessageHandler.cs +2019 -542
  135. package/Runtime/Core/MessageHandler.cs.meta +11 -11
  136. package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
  137. package/Runtime/Core/MessageRegistrationToken.cs +7 -0
  138. package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
  139. package/Runtime/Core/Messages/GlobalStringMessage.cs.meta +2 -2
  140. package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
  141. package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
  142. package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
  143. package/Runtime/Core/Messages/ReflexiveMessage.cs.meta +2 -2
  144. package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +11 -11
  145. package/Runtime/Core/Messages/StringMessage.cs.meta +2 -2
  146. package/Runtime/Core/Messages.meta +8 -8
  147. package/Runtime/Core/MessagingDebug.cs.meta +11 -11
  148. package/Runtime/Core/Pooling/CollectionPool.cs +266 -0
  149. package/Runtime/Core/Pooling/CollectionPool.cs.meta +11 -0
  150. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs +30 -0
  151. package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs.meta +11 -0
  152. package/Runtime/Core/Pooling/DxPools.cs +157 -0
  153. package/Runtime/Core/Pooling/DxPools.cs.meta +11 -0
  154. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs +106 -0
  155. package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs.meta +11 -0
  156. package/Runtime/Core/Pooling/IDxMessagingClock.cs +18 -0
  157. package/Runtime/Core/Pooling/IDxMessagingClock.cs.meta +11 -0
  158. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs +55 -0
  159. package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs.meta +11 -0
  160. package/Runtime/Core/Pooling/StopwatchClock.cs +27 -0
  161. package/Runtime/Core/Pooling/StopwatchClock.cs.meta +11 -0
  162. package/Runtime/Core/Pooling/UnityRealtimeClock.cs +31 -0
  163. package/Runtime/Core/Pooling/UnityRealtimeClock.cs.meta +11 -0
  164. package/Runtime/Core/Pooling.meta +9 -0
  165. package/Runtime/Core.meta +8 -8
  166. package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +12 -12
  167. package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -11
  168. package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +12 -12
  169. package/Runtime/Unity/Integrations/Reflex/AssemblyInfo.cs.meta +2 -2
  170. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +73 -0
  171. package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +11 -11
  172. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef +20 -20
  173. package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef.meta +7 -7
  174. package/Runtime/Unity/Integrations/Reflex.meta +8 -8
  175. package/Runtime/Unity/Integrations/VContainer/AssemblyInfo.cs.meta +2 -2
  176. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +109 -1
  177. package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +11 -11
  178. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef +30 -30
  179. package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef.meta +7 -7
  180. package/Runtime/Unity/Integrations/VContainer.meta +8 -8
  181. package/Runtime/Unity/Integrations/Zenject/AssemblyInfo.cs.meta +2 -2
  182. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef +30 -30
  183. package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef.meta +7 -7
  184. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +79 -1
  185. package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +11 -11
  186. package/Runtime/Unity/Integrations/Zenject.meta +8 -8
  187. package/Runtime/Unity/Integrations.meta +8 -8
  188. package/Runtime/Unity/MessageAwareComponent.cs +29 -0
  189. package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
  190. package/Runtime/Unity/MessageBusProviderHandle.cs.meta +12 -12
  191. package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
  192. package/Runtime/Unity/MessagingComponentInstaller.cs.meta +12 -12
  193. package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +12 -12
  194. package/Runtime/Unity.meta +8 -8
  195. package/Runtime/WallstopStudios.DxMessaging.asmdef +14 -14
  196. package/Runtime/WallstopStudios.DxMessaging.asmdef.meta +7 -7
  197. package/Runtime.meta +8 -8
  198. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab +98 -98
  199. package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab.meta +7 -7
  200. package/Samples~/DI/Prefabs.meta +8 -8
  201. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset +14 -14
  202. package/Samples~/DI/Providers/GlobalMessageBusProvider.asset.meta +8 -8
  203. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset +14 -14
  204. package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset.meta +8 -8
  205. package/Samples~/DI/Providers.meta +8 -8
  206. package/Samples~/DI/README.md +51 -51
  207. package/Samples~/DI/README.md.meta +7 -7
  208. package/Samples~/DI/Reflex/SampleInstaller.cs +7 -0
  209. package/Samples~/DI/Reflex/SampleInstaller.cs.meta +11 -11
  210. package/Samples~/DI/Reflex.meta +8 -8
  211. package/Samples~/DI/VContainer/SampleLifetimeScope.cs +6 -1
  212. package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +11 -11
  213. package/Samples~/DI/VContainer.meta +8 -8
  214. package/Samples~/DI/Zenject/SampleInstaller.cs +8 -0
  215. package/Samples~/DI/Zenject/SampleInstaller.cs.meta +11 -11
  216. package/Samples~/DI/Zenject.meta +8 -8
  217. package/Samples~/DI.meta +8 -8
  218. package/Samples~/Mini Combat/Boot.cs.meta +11 -11
  219. package/Samples~/Mini Combat/Enemy.cs.meta +11 -11
  220. package/Samples~/Mini Combat/Messages.cs.meta +11 -11
  221. package/Samples~/Mini Combat/Player.cs.meta +11 -11
  222. package/Samples~/Mini Combat/README.md +324 -323
  223. package/Samples~/Mini Combat/README.md.meta +7 -7
  224. package/Samples~/Mini Combat/UIOverlay.cs.meta +11 -11
  225. package/Samples~/Mini Combat/Walkthrough.md +430 -430
  226. package/Samples~/Mini Combat/Walkthrough.md.meta +7 -7
  227. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef +13 -13
  228. package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef.meta +7 -7
  229. package/Samples~/Mini Combat.meta +8 -8
  230. package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +11 -11
  231. package/Samples~/UI Buttons + Inspector/Messages.cs.meta +11 -11
  232. package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +11 -11
  233. package/Samples~/UI Buttons + Inspector/README.md +210 -209
  234. package/Samples~/UI Buttons + Inspector/README.md.meta +7 -7
  235. package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +11 -11
  236. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef +13 -13
  237. package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta +7 -7
  238. package/Samples~/UI Buttons + Inspector.meta +8 -8
  239. package/SourceGenerators/Directory.Build.props.meta +7 -7
  240. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +11 -11
  241. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs.meta +2 -2
  242. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
  243. package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
  244. package/SourceGenerators.meta +8 -8
  245. package/Third Party Notices.md +3 -3
  246. package/Third Party Notices.md.meta +7 -7
  247. package/package.json +115 -92
  248. package/package.json.meta +7 -7
@@ -7,6 +7,7 @@ namespace DxMessaging.Editor
7
7
  using System.IO;
8
8
  using System.Linq;
9
9
  using System.Security.Cryptography;
10
+ using DxMessaging.Editor.Settings;
10
11
  using UnityEditor;
11
12
  using UnityEngine;
12
13
  using Object = UnityEngine.Object;
@@ -30,9 +31,20 @@ namespace DxMessaging.Editor
30
31
  private static readonly string SourceGeneratorDllName =
31
32
  "WallstopStudios.DxMessaging.SourceGenerators.dll";
32
33
 
34
+ // The analyzer DLL is a SEPARATE assembly compiled against Roslyn 3.8.0 because Unity 2021's
35
+ // analyzer loader silently rejects analyzer DLLs built against Roslyn 4.x. The source-
36
+ // generator DLL above stays at Roslyn 4.x because it uses IIncrementalGenerator (4.0+).
37
+ // Both DLLs ship side-by-side and both need the RoslynAnalyzer label.
38
+ private static readonly string AnalyzerDllName = "WallstopStudios.DxMessaging.Analyzer.dll";
39
+
40
+ // The analyzer DLLs and shared Roslyn surface ship unconditionally; they're light enough
41
+ // and required for DXMSG002–DXMSG009 to function at all. The list intentionally references
42
+ // a few transitive Roslyn deps that may or may not physically ship with the package; the
43
+ // copy loop below silently skips any name that isn't on disk.
33
44
  private static readonly string[] RequiredDllNames =
34
45
  {
35
46
  SourceGeneratorDllName,
47
+ AnalyzerDllName,
36
48
  "Microsoft.CodeAnalysis.dll",
37
49
  "Microsoft.CodeAnalysis.CSharp.dll",
38
50
  "System.Text.Encodings.Web.dll",
@@ -44,7 +56,17 @@ namespace DxMessaging.Editor
44
56
  "System.Threading.Tasks.Extensions.dll",
45
57
  "System.Numerics.Vectors.dll",
46
58
  "System.Text.Encoding.CodePages.dll",
47
- "Microsoft.Bcl.AsyncInterfaces.dll",
59
+ };
60
+
61
+ // DLLs that must be tagged with Unity's "RoslynAnalyzer" asset label so Unity's compiler
62
+ // pipeline picks them up as analyzer/source-generator hosts. Other DLLs in the same folder
63
+ // (Roslyn runtime, immutable collections) are plain Editor-only plugin DLLs.
64
+ private static readonly HashSet<string> AnalyzerLabeledDllNames = new(
65
+ StringComparer.OrdinalIgnoreCase
66
+ )
67
+ {
68
+ SourceGeneratorDllName,
69
+ AnalyzerDllName,
48
70
  };
49
71
 
50
72
  private static readonly HashSet<string> DllNames = new(StringComparer.OrdinalIgnoreCase);
@@ -53,6 +75,7 @@ namespace DxMessaging.Editor
53
75
  {
54
76
  EditorApplication.delayCall += EnsureDLLsExistInAssets;
55
77
  EditorApplication.delayCall += EnsureCscRsp;
78
+ EditorApplication.delayCall += EnsureAdditionalFileForIgnoreList;
56
79
  }
57
80
 
58
81
  private static void EnsureDLLsExistInAssets()
@@ -107,7 +130,7 @@ namespace DxMessaging.Editor
107
130
  AssetDatabase.ImportAsset(outputAsset);
108
131
  }
109
132
 
110
- if (requiredDllName == SourceGeneratorDllName)
133
+ if (AnalyzerLabeledDllNames.Contains(requiredDllName))
111
134
  {
112
135
  Object loadedDll = AssetDatabase.LoadMainAssetAtPath(outputAsset);
113
136
  if (loadedDll != null)
@@ -190,6 +213,10 @@ namespace DxMessaging.Editor
190
213
  return !sourceHash.AsSpan().SequenceEqual(destinationHash);
191
214
  }
192
215
 
216
+ /// <summary>
217
+ /// Synchronizes <c>csc.rsp</c> with the current set of analyzer arguments derived from the
218
+ /// on-disk DLL roster.
219
+ /// </summary>
193
220
  private static void EnsureCscRsp()
194
221
  {
195
222
  try
@@ -201,20 +228,81 @@ namespace DxMessaging.Editor
201
228
  }
202
229
 
203
230
  string rspContent = File.ReadAllText(RspFilePath);
204
- bool modified = false;
205
- foreach (string analyzerArgument in GetAnalyzerArguments())
231
+
232
+ // Get current valid analyzer arguments
233
+ HashSet<string> currentAnalyzerArgs = new(
234
+ GetAnalyzerArguments(),
235
+ StringComparer.OrdinalIgnoreCase
236
+ );
237
+
238
+ // Parse existing lines and filter out stale DxMessaging analyzer entries
239
+ List<string> newLines = new();
240
+ bool foundStaleEntries = false;
241
+
242
+ foreach (
243
+ string line in rspContent.Split(
244
+ new[] { '\r', '\n' },
245
+ StringSplitOptions.RemoveEmptyEntries
246
+ )
247
+ )
206
248
  {
207
- if (rspContent.Contains(analyzerArgument, StringComparison.OrdinalIgnoreCase))
249
+ string trimmedLine = line.Trim();
250
+
251
+ // Check if this is a DxMessaging analyzer line
252
+ bool isDxMessagingAnalyzer =
253
+ trimmedLine.StartsWith("-a:", StringComparison.OrdinalIgnoreCase)
254
+ && (
255
+ trimmedLine.Contains(
256
+ "com.wallstop-studios.dxmessaging",
257
+ StringComparison.OrdinalIgnoreCase
258
+ )
259
+ || trimmedLine.Contains(
260
+ "WallstopStudios.DxMessaging",
261
+ StringComparison.OrdinalIgnoreCase
262
+ )
263
+ );
264
+
265
+ if (isDxMessagingAnalyzer)
208
266
  {
209
- continue;
267
+ // Only keep if it's in the current valid set
268
+ if (currentAnalyzerArgs.Contains(trimmedLine))
269
+ {
270
+ newLines.Add(trimmedLine);
271
+ }
272
+ else
273
+ {
274
+ foundStaleEntries = true;
275
+ }
210
276
  }
277
+ else
278
+ {
279
+ // Keep all non-DxMessaging lines as-is
280
+ newLines.Add(trimmedLine);
281
+ }
282
+ }
211
283
 
212
- File.AppendAllText(RspFilePath, analyzerArgument + Environment.NewLine);
213
- modified = true;
284
+ // Add any new analyzer arguments that aren't already present
285
+ bool foundNewEntries = false;
286
+ foreach (string analyzerArgument in currentAnalyzerArgs)
287
+ {
288
+ if (!newLines.Contains(analyzerArgument, StringComparer.OrdinalIgnoreCase))
289
+ {
290
+ newLines.Add(analyzerArgument);
291
+ foundNewEntries = true;
292
+ }
214
293
  }
215
294
 
295
+ bool modified = foundStaleEntries || foundNewEntries;
296
+
216
297
  if (modified)
217
298
  {
299
+ // Write the cleaned up content
300
+ string newContent = string.Join(Environment.NewLine, newLines);
301
+ if (!string.IsNullOrEmpty(newContent))
302
+ {
303
+ newContent += Environment.NewLine;
304
+ }
305
+ File.WriteAllText(RspFilePath, newContent);
218
306
  AssetDatabase.ImportAsset("csc.rsp");
219
307
  Debug.Log("Updated csc.rsp.");
220
308
  }
@@ -225,6 +313,119 @@ namespace DxMessaging.Editor
225
313
  }
226
314
  }
227
315
 
316
+ /// <summary>
317
+ /// Ensures <c>csc.rsp</c> contains a single <c>-additionalfile:</c> line pointing at the
318
+ /// base-call ignore sidecar, when (and only when) that sidecar physically exists. Stale
319
+ /// entries pointing at moved or deleted sidecar paths are removed.
320
+ /// </summary>
321
+ /// <remarks>
322
+ /// The sidecar is generated by <see cref="DxMessagingBaseCallIgnoreSync"/> only when there
323
+ /// is content to write. csc happily runs without it, so this method does NOT auto-create.
324
+ /// </remarks>
325
+ private static void EnsureAdditionalFileForIgnoreList()
326
+ {
327
+ try
328
+ {
329
+ if (!File.Exists(RspFilePath))
330
+ {
331
+ File.WriteAllText(RspFilePath, string.Empty);
332
+ AssetDatabase.ImportAsset("csc.rsp");
333
+ }
334
+
335
+ string sidecarRelativePath = DxMessagingBaseCallIgnoreSync.SidecarAssetPath;
336
+ string projectRoot = Path.GetFullPath(Path.Combine(Application.dataPath, ".."))
337
+ .Replace("\\", "/");
338
+ string sidecarAbsolutePath = Path.Combine(projectRoot, sidecarRelativePath)
339
+ .Replace("\\", "/");
340
+
341
+ bool sidecarExists = File.Exists(sidecarAbsolutePath);
342
+ string desiredLine = $"-additionalfile:\"{sidecarRelativePath}\"";
343
+
344
+ string rspContent = File.ReadAllText(RspFilePath);
345
+ List<string> newLines = new();
346
+ bool foundDesired = false;
347
+ bool foundStale = false;
348
+
349
+ foreach (
350
+ string line in rspContent.Split(
351
+ new[] { '\r', '\n' },
352
+ StringSplitOptions.RemoveEmptyEntries
353
+ )
354
+ )
355
+ {
356
+ string trimmedLine = line.Trim();
357
+
358
+ bool isDxMessagingAdditionalFile =
359
+ trimmedLine.StartsWith(
360
+ "-additionalfile:",
361
+ StringComparison.OrdinalIgnoreCase
362
+ )
363
+ && trimmedLine.Contains("DxMessaging.", StringComparison.OrdinalIgnoreCase)
364
+ && trimmedLine.Contains(
365
+ "BaseCallIgnore",
366
+ StringComparison.OrdinalIgnoreCase
367
+ );
368
+
369
+ if (isDxMessagingAdditionalFile)
370
+ {
371
+ if (
372
+ sidecarExists
373
+ && string.Equals(
374
+ trimmedLine,
375
+ desiredLine,
376
+ StringComparison.OrdinalIgnoreCase
377
+ )
378
+ )
379
+ {
380
+ if (!foundDesired)
381
+ {
382
+ newLines.Add(trimmedLine);
383
+ foundDesired = true;
384
+ }
385
+ else
386
+ {
387
+ // Drop duplicate.
388
+ foundStale = true;
389
+ }
390
+ }
391
+ else
392
+ {
393
+ // Stale entry pointing at a moved/renamed/deleted sidecar; drop it.
394
+ foundStale = true;
395
+ }
396
+ }
397
+ else
398
+ {
399
+ newLines.Add(trimmedLine);
400
+ }
401
+ }
402
+
403
+ bool needsAppend = sidecarExists && !foundDesired;
404
+ if (needsAppend)
405
+ {
406
+ newLines.Add(desiredLine);
407
+ }
408
+
409
+ bool modified = foundStale || needsAppend;
410
+
411
+ if (modified)
412
+ {
413
+ string newContent = string.Join(Environment.NewLine, newLines);
414
+ if (!string.IsNullOrEmpty(newContent))
415
+ {
416
+ newContent += Environment.NewLine;
417
+ }
418
+ File.WriteAllText(RspFilePath, newContent);
419
+ AssetDatabase.ImportAsset("csc.rsp");
420
+ Debug.Log("Updated csc.rsp additionalfile entries.");
421
+ }
422
+ }
423
+ catch (IOException ex)
424
+ {
425
+ Debug.LogError($"Failed to update csc.rsp additionalfile entry: {ex}");
426
+ }
427
+ }
428
+
228
429
  private static IEnumerable<string> GetAnalyzerArguments()
229
430
  {
230
431
  HashSet<string> yielded = new(StringComparer.OrdinalIgnoreCase);
@@ -1,3 +1,3 @@
1
- fileFormatVersion: 2
2
- guid: 54bd01ff5fd34bbc9950a1c7230a15d8
1
+ fileFormatVersion: 2
2
+ guid: 54bd01ff5fd34bbc9950a1c7230a15d8
3
3
  timeCreated: 1730841461
@@ -7,7 +7,7 @@ namespace DxMessaging.Editor.Testing
7
7
  using Core;
8
8
  using Core.Diagnostics;
9
9
  using Core.MessageBus;
10
- using Unity;
10
+ using DxMessaging.Unity;
11
11
  using UnityEngine;
12
12
 
13
13
  /// <summary>
@@ -1,3 +1,3 @@
1
- fileFormatVersion: 2
2
- guid: 2624c9e8eb5243ebb71545774f411c2c
3
- timeCreated: 1761880591
1
+ fileFormatVersion: 2
2
+ guid: 2624c9e8eb5243ebb71545774f411c2c
3
+ timeCreated: 1761880591
@@ -1,3 +1,3 @@
1
- fileFormatVersion: 2
2
- guid: a61780c8ba084b29bb44fdefc9b7fcf2
3
- timeCreated: 1761880591
1
+ fileFormatVersion: 2
2
+ guid: a61780c8ba084b29bb44fdefc9b7fcf2
3
+ timeCreated: 1761880591
@@ -1,14 +1,14 @@
1
- {
2
- "name": "WallstopStudios.DxMessaging.Editor",
3
- "rootNamespace": "DxMessaging.Editor",
4
- "references": ["WallstopStudios.DxMessaging"],
5
- "includePlatforms": ["Editor"],
6
- "excludePlatforms": [],
7
- "allowUnsafeCode": false,
8
- "overrideReferences": false,
9
- "precompiledReferences": [],
10
- "autoReferenced": true,
11
- "defineConstraints": [],
12
- "versionDefines": [],
13
- "noEngineReferences": false
14
- }
1
+ {
2
+ "name": "WallstopStudios.DxMessaging.Editor",
3
+ "rootNamespace": "DxMessaging.Editor",
4
+ "references": ["WallstopStudios.DxMessaging"],
5
+ "includePlatforms": ["Editor"],
6
+ "excludePlatforms": [],
7
+ "allowUnsafeCode": false,
8
+ "overrideReferences": false,
9
+ "precompiledReferences": [],
10
+ "autoReferenced": true,
11
+ "defineConstraints": [],
12
+ "versionDefines": [],
13
+ "noEngineReferences": false
14
+ }
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 4be90ea11db262f43913b0e065a25c7f
3
- AssemblyDefinitionImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 4be90ea11db262f43913b0e065a25c7f
3
+ AssemblyDefinitionImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant:
package/Editor.meta CHANGED
@@ -1,8 +1,8 @@
1
- fileFormatVersion: 2
2
- guid: 41dce8be641afe34ca8363865b8cd5d9
3
- folderAsset: yes
4
- DefaultImporter:
5
- externalObjects: {}
6
- userData:
7
- assetBundleName:
8
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 41dce8be641afe34ca8363865b8cd5d9
3
+ folderAsset: yes
4
+ DefaultImporter:
5
+ externalObjects: {}
6
+ userData:
7
+ assetBundleName:
8
+ assetBundleVariant:
package/LICENSE.md CHANGED
@@ -1,9 +1,9 @@
1
- # License
2
-
3
- Copyright 2023 Eli Pinkerton
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
-
7
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
-
9
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1
+ # License
2
+
3
+ Copyright 2023 Eli Pinkerton
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/LICENSE.md.meta CHANGED
@@ -1,7 +1,7 @@
1
- fileFormatVersion: 2
2
- guid: 2f7b715fd1838ea49b6fe45bcdd2e7eb
3
- TextScriptImporter:
4
- externalObjects: {}
5
- userData:
6
- assetBundleName:
7
- assetBundleVariant:
1
+ fileFormatVersion: 2
2
+ guid: 2f7b715fd1838ea49b6fe45bcdd2e7eb
3
+ TextScriptImporter:
4
+ externalObjects: {}
5
+ userData:
6
+ assetBundleName:
7
+ assetBundleVariant: