com.wallstop-studios.dxmessaging 2.2.0 → 3.1.0
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.
- package/CHANGELOG.md +315 -67
- package/CHANGELOG.md.meta +7 -7
- package/Editor/Analyzers/BaseCallIlInspector.cs +277 -0
- package/Editor/Analyzers/BaseCallIlInspector.cs.meta +11 -0
- package/Editor/Analyzers/BaseCallLogMessageParser.cs +295 -0
- package/Editor/Analyzers/BaseCallLogMessageParser.cs.meta +11 -0
- package/Editor/Analyzers/BaseCallReportAggregator.cs +308 -0
- package/Editor/Analyzers/BaseCallReportAggregator.cs.meta +11 -0
- package/Editor/Analyzers/BaseCallTypeScanner.cs +110 -0
- package/Editor/Analyzers/BaseCallTypeScanner.cs.meta +11 -0
- package/Editor/Analyzers/BaseCallTypeScannerCore.cs +562 -0
- package/Editor/Analyzers/BaseCallTypeScannerCore.cs.meta +11 -0
- package/Editor/Analyzers/DxMessagingConsoleHarvester.cs +1129 -0
- package/Editor/Analyzers/DxMessagingConsoleHarvester.cs.meta +11 -0
- package/Editor/Analyzers/Microsoft.CodeAnalysis.CSharp.dll.meta +44 -44
- package/Editor/Analyzers/Microsoft.CodeAnalysis.dll.meta +44 -44
- package/Editor/Analyzers/System.Collections.Immutable.dll.meta +44 -44
- package/Editor/Analyzers/System.Reflection.Metadata.dll.meta +44 -44
- package/Editor/Analyzers/System.Runtime.CompilerServices.Unsafe.dll.meta +44 -44
- package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll +0 -0
- package/Editor/Analyzers/WallstopStudios.DxMessaging.Analyzer.dll.meta +46 -0
- package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll +0 -0
- package/Editor/Analyzers/WallstopStudios.DxMessaging.SourceGenerators.dll.meta +72 -72
- package/Editor/Analyzers.meta +8 -8
- package/Editor/AssemblyInfo.cs.meta +11 -3
- package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs +81 -0
- package/Editor/CustomEditors/MessageAwareComponentFallbackEditor.cs.meta +11 -0
- package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs +429 -0
- package/Editor/CustomEditors/MessageAwareComponentInspectorOverlay.cs.meta +11 -0
- package/Editor/CustomEditors/MessagingComponentEditor.cs +1 -1
- package/Editor/CustomEditors/MessagingComponentEditor.cs.meta +11 -3
- package/Editor/CustomEditors.meta +2 -2
- package/Editor/DxMessagingEditorIdle.cs +62 -0
- package/Editor/DxMessagingEditorIdle.cs.meta +11 -0
- package/Editor/DxMessagingEditorInitializer.cs +112 -15
- package/Editor/DxMessagingEditorInitializer.cs.meta +11 -3
- package/Editor/DxMessagingEditorLog.cs +32 -0
- package/Editor/DxMessagingEditorLog.cs.meta +11 -0
- package/Editor/DxMessagingMenu.cs.meta +11 -11
- package/Editor/DxMessagingSceneBuildProcessor.cs.meta +11 -11
- package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs +313 -0
- package/Editor/Settings/DxMessagingBaseCallIgnoreSync.cs.meta +11 -0
- package/Editor/Settings/DxMessagingSettings.cs +261 -11
- package/Editor/Settings/DxMessagingSettings.cs.meta +11 -3
- package/Editor/Settings/DxMessagingSettingsProvider.cs +50 -33
- package/Editor/Settings/DxMessagingSettingsProvider.cs.meta +11 -3
- package/Editor/Settings.meta +2 -2
- package/Editor/SetupCscRsp.cs +406 -39
- package/Editor/SetupCscRsp.cs.meta +11 -3
- package/Editor/Testing/MessagingComponentEditorHarness.cs +2 -2
- package/Editor/Testing/MessagingComponentEditorHarness.cs.meta +11 -3
- package/Editor/Testing.meta +3 -3
- package/Editor/WallstopStudios.DxMessaging.Editor.asmdef +14 -14
- package/Editor/WallstopStudios.DxMessaging.Editor.asmdef.meta +7 -7
- package/Editor.meta +8 -8
- package/LICENSE.md +9 -9
- package/LICENSE.md.meta +7 -7
- package/README.md +940 -900
- package/README.md.meta +7 -7
- package/Runtime/AssemblyInfo.cs +4 -0
- package/Runtime/AssemblyInfo.cs.meta +11 -3
- package/Runtime/Core/Attributes/DxAutoConstructorAttribute.cs.meta +11 -3
- package/Runtime/Core/Attributes/DxBroadcastMessageAttribute.cs.meta +11 -3
- package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs +26 -0
- package/Runtime/Core/Attributes/DxIgnoreMissingBaseCallAttribute.cs.meta +11 -0
- package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs +2 -4
- package/Runtime/Core/Attributes/DxOptionalParameterAttribute.cs.meta +11 -3
- package/Runtime/Core/Attributes/DxTargetedMessageAttribute.cs.meta +11 -3
- package/Runtime/Core/Attributes/DxUntargetedMessageAttribute.cs.meta +11 -3
- package/Runtime/Core/Attributes/Il2CppSetOptionAttribute.cs +56 -0
- package/Runtime/Core/Attributes/Il2CppSetOptionAttribute.cs.meta +11 -0
- package/Runtime/Core/Attributes.meta +2 -2
- package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs +195 -0
- package/Runtime/Core/Configuration/DxMessagingRuntimeSettings.cs.meta +11 -0
- package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs +179 -0
- package/Runtime/Core/Configuration/DxMessagingRuntimeSettingsProvider.cs.meta +11 -0
- package/Runtime/Core/Configuration.meta +9 -0
- package/Runtime/Core/DataStructure/CyclicBuffer.cs +46 -28
- package/Runtime/Core/DataStructure/CyclicBuffer.cs.meta +11 -3
- package/Runtime/Core/DataStructure.meta +2 -2
- package/Runtime/Core/Diagnostics/MessageEmissionData.cs.meta +11 -3
- package/Runtime/Core/Diagnostics/MessageRegistrationData.cs.meta +11 -3
- package/Runtime/Core/Diagnostics/MessageRegistrationType.cs.meta +11 -3
- package/Runtime/Core/Diagnostics.meta +2 -2
- package/Runtime/Core/DxMessagingStaticState.cs +19 -0
- package/Runtime/Core/DxMessagingStaticState.cs.meta +11 -11
- package/Runtime/Core/Extensions/EnumExtensions.cs +6 -5
- package/Runtime/Core/Extensions/EnumExtensions.cs.meta +11 -3
- package/Runtime/Core/Extensions/IListExtensions.cs.meta +11 -3
- package/Runtime/Core/Extensions/MessageBusExtensions.cs.meta +12 -12
- package/Runtime/Core/Extensions/MessageExtensions.cs +0 -60
- package/Runtime/Core/Extensions/MessageExtensions.cs.meta +11 -11
- package/Runtime/Core/Extensions.meta +8 -8
- package/Runtime/Core/Helper/MessageCache.cs +32 -0
- package/Runtime/Core/Helper/MessageCache.cs.meta +11 -3
- package/Runtime/Core/Helper/MessageHelperIndexer.cs.meta +11 -3
- package/Runtime/Core/Helper.meta +2 -2
- package/Runtime/Core/IMessage.cs +3 -3
- package/Runtime/Core/IMessage.cs.meta +11 -11
- package/Runtime/Core/InstanceId.cs +25 -1
- package/Runtime/Core/InstanceId.cs.meta +11 -11
- package/Runtime/Core/Internal/DxUnsafe.cs +60 -0
- package/Runtime/Core/Internal/DxUnsafe.cs.meta +11 -0
- package/Runtime/Core/Internal/FlatDispatch.cs +198 -0
- package/Runtime/Core/Internal/FlatDispatch.cs.meta +11 -0
- package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs +38 -0
- package/Runtime/Core/Internal/TypedGlobalSlotIndex.cs.meta +11 -0
- package/Runtime/Core/Internal/TypedSlotIndex.cs +81 -0
- package/Runtime/Core/Internal/TypedSlotIndex.cs.meta +11 -0
- package/Runtime/Core/Internal/TypedSlots.cs +597 -0
- package/Runtime/Core/Internal/TypedSlots.cs.meta +11 -0
- package/Runtime/Core/Internal.meta +9 -0
- package/Runtime/Core/MessageBus/DiagnosticsTarget.cs.meta +11 -11
- package/Runtime/Core/MessageBus/GlobalMessageBusProvider.cs.meta +11 -11
- package/Runtime/Core/MessageBus/IMessageBus.cs +189 -15
- package/Runtime/Core/MessageBus/IMessageBus.cs.meta +11 -11
- package/Runtime/Core/MessageBus/IMessageBusProvider.cs.meta +11 -11
- package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs +1 -0
- package/Runtime/Core/MessageBus/IMessageRegistrationBuilder.cs.meta +11 -11
- package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs +16 -0
- package/Runtime/Core/MessageBus/Internal/BusContextIndex.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs +40 -0
- package/Runtime/Core/MessageBus/Internal/BusSinkIndex.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/BusSlots.cs +719 -0
- package/Runtime/Core/MessageBus/Internal/BusSlots.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/DispatchKind.cs +38 -0
- package/Runtime/Core/MessageBus/Internal/DispatchKind.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs +20 -0
- package/Runtime/Core/MessageBus/Internal/DispatchPhase.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs +28 -0
- package/Runtime/Core/MessageBus/Internal/DispatchVariant.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs +48 -0
- package/Runtime/Core/MessageBus/Internal/IEvictableSlot.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/ISweepable.cs +15 -0
- package/Runtime/Core/MessageBus/Internal/ISweepable.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs +222 -0
- package/Runtime/Core/MessageBus/Internal/RegistrationMethodAxes.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal/SlotKey.cs +192 -0
- package/Runtime/Core/MessageBus/Internal/SlotKey.cs.meta +11 -0
- package/Runtime/Core/MessageBus/Internal.meta +9 -0
- package/Runtime/Core/MessageBus/MessageBus.cs +5366 -3838
- package/Runtime/Core/MessageBus/MessageBus.cs.meta +11 -11
- package/Runtime/Core/MessageBus/MessageBusRebindMode.cs.meta +11 -11
- package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs +187 -14
- package/Runtime/Core/MessageBus/MessageRegistrationBuilder.cs.meta +11 -11
- package/Runtime/Core/MessageBus/MessagingRegistration.cs.meta +11 -11
- package/Runtime/Core/MessageBus/RegistrationLog.cs.meta +11 -11
- package/Runtime/Core/MessageBus.meta +8 -8
- package/Runtime/Core/MessageHandler.cs +2399 -1042
- package/Runtime/Core/MessageHandler.cs.meta +11 -11
- package/Runtime/Core/MessageRegistrationHandle.cs.meta +11 -11
- package/Runtime/Core/MessageRegistrationToken.cs +429 -44
- package/Runtime/Core/MessageRegistrationToken.cs.meta +11 -11
- package/Runtime/Core/Messages/GlobalStringMessage.cs.meta +11 -3
- package/Runtime/Core/Messages/IBroadcastMessage.cs.meta +11 -11
- package/Runtime/Core/Messages/ITargetedMessage.cs.meta +11 -11
- package/Runtime/Core/Messages/IUntargetedMessage.cs.meta +11 -11
- package/Runtime/Core/Messages/ReflexiveMessage.cs.meta +11 -3
- package/Runtime/Core/Messages/SourcedStringMessage.cs.meta +11 -11
- package/Runtime/Core/Messages/StringMessage.cs.meta +11 -3
- package/Runtime/Core/Messages.meta +8 -8
- package/Runtime/Core/MessagingDebug.cs.meta +11 -11
- package/Runtime/Core/Pooling/CollectionPool.cs +266 -0
- package/Runtime/Core/Pooling/CollectionPool.cs.meta +11 -0
- package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs +30 -0
- package/Runtime/Core/Pooling/CollectionPoolDiagnostics.cs.meta +11 -0
- package/Runtime/Core/Pooling/DxPools.cs +157 -0
- package/Runtime/Core/Pooling/DxPools.cs.meta +11 -0
- package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs +106 -0
- package/Runtime/Core/Pooling/EvictionPlayerLoopHook.cs.meta +11 -0
- package/Runtime/Core/Pooling/IDxMessagingClock.cs +18 -0
- package/Runtime/Core/Pooling/IDxMessagingClock.cs.meta +11 -0
- package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs +55 -0
- package/Runtime/Core/Pooling/PoolDiagnosticsSnapshot.cs.meta +11 -0
- package/Runtime/Core/Pooling/StopwatchClock.cs +27 -0
- package/Runtime/Core/Pooling/StopwatchClock.cs.meta +11 -0
- package/Runtime/Core/Pooling/UnityRealtimeClock.cs +31 -0
- package/Runtime/Core/Pooling/UnityRealtimeClock.cs.meta +11 -0
- package/Runtime/Core/Pooling.meta +9 -0
- package/Runtime/Core.meta +8 -8
- package/Runtime/Unity/CurrentGlobalMessageBusProvider.cs.meta +12 -12
- package/Runtime/Unity/DxMessagingRuntimeInitializer.cs.meta +11 -11
- package/Runtime/Unity/InitialGlobalMessageBusProvider.cs.meta +12 -12
- package/Runtime/Unity/Integrations/Reflex/AssemblyInfo.cs.meta +11 -3
- package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs +73 -0
- package/Runtime/Unity/Integrations/Reflex/ReflexRegistrationInstaller.cs.meta +11 -11
- package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef +20 -20
- package/Runtime/Unity/Integrations/Reflex/WallstopStudios.DxMessaging.Reflex.asmdef.meta +7 -7
- package/Runtime/Unity/Integrations/Reflex.meta +8 -8
- package/Runtime/Unity/Integrations/VContainer/AssemblyInfo.cs.meta +11 -3
- package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs +109 -1
- package/Runtime/Unity/Integrations/VContainer/VContainerRegistrationExtensions.cs.meta +11 -11
- package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef +30 -30
- package/Runtime/Unity/Integrations/VContainer/WallstopStudios.DxMessaging.VContainer.asmdef.meta +7 -7
- package/Runtime/Unity/Integrations/VContainer.meta +8 -8
- package/Runtime/Unity/Integrations/Zenject/AssemblyInfo.cs.meta +11 -3
- package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef +30 -30
- package/Runtime/Unity/Integrations/Zenject/WallstopStudios.DxMessaging.Zenject.asmdef.meta +7 -7
- package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs +79 -1
- package/Runtime/Unity/Integrations/Zenject/ZenjectRegistrationInstaller.cs.meta +11 -11
- package/Runtime/Unity/Integrations/Zenject.meta +8 -8
- package/Runtime/Unity/Integrations.meta +8 -8
- package/Runtime/Unity/MessageAwareComponent.cs +74 -0
- package/Runtime/Unity/MessageAwareComponent.cs.meta +11 -11
- package/Runtime/Unity/MessageBusProviderHandle.cs.meta +12 -12
- package/Runtime/Unity/MessagingComponent.cs +43 -10
- package/Runtime/Unity/MessagingComponent.cs.meta +11 -11
- package/Runtime/Unity/MessagingComponentInstaller.cs.meta +12 -12
- package/Runtime/Unity/ScriptableMessageBusProvider.cs.meta +12 -12
- package/Runtime/Unity.meta +8 -8
- package/Runtime/WallstopStudios.DxMessaging.asmdef +14 -14
- package/Runtime/WallstopStudios.DxMessaging.asmdef.meta +7 -7
- package/Runtime.meta +8 -8
- package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab +98 -98
- package/Samples~/DI/Prefabs/MessagingInstallerSample.prefab.meta +7 -7
- package/Samples~/DI/Prefabs.meta +8 -8
- package/Samples~/DI/Providers/GlobalMessageBusProvider.asset +14 -14
- package/Samples~/DI/Providers/GlobalMessageBusProvider.asset.meta +8 -8
- package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset +14 -14
- package/Samples~/DI/Providers/InitialGlobalMessageBusProvider.asset.meta +8 -8
- package/Samples~/DI/Providers.meta +8 -8
- package/Samples~/DI/README.md +51 -51
- package/Samples~/DI/README.md.meta +7 -7
- package/Samples~/DI/Reflex/SampleInstaller.cs +7 -0
- package/Samples~/DI/Reflex/SampleInstaller.cs.meta +11 -11
- package/Samples~/DI/Reflex.meta +8 -8
- package/Samples~/DI/VContainer/SampleLifetimeScope.cs +6 -1
- package/Samples~/DI/VContainer/SampleLifetimeScope.cs.meta +11 -11
- package/Samples~/DI/VContainer.meta +8 -8
- package/Samples~/DI/Zenject/SampleInstaller.cs +8 -0
- package/Samples~/DI/Zenject/SampleInstaller.cs.meta +11 -11
- package/Samples~/DI/Zenject.meta +8 -8
- package/Samples~/DI.meta +8 -8
- package/Samples~/Mini Combat/Boot.cs.meta +11 -11
- package/Samples~/Mini Combat/Enemy.cs.meta +11 -11
- package/Samples~/Mini Combat/Messages.cs.meta +11 -11
- package/Samples~/Mini Combat/Player.cs.meta +11 -11
- package/Samples~/Mini Combat/README.md +324 -323
- package/Samples~/Mini Combat/README.md.meta +7 -7
- package/Samples~/Mini Combat/UIOverlay.cs.meta +11 -11
- package/Samples~/Mini Combat/Walkthrough.md +430 -430
- package/Samples~/Mini Combat/Walkthrough.md.meta +7 -7
- package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef +13 -13
- package/Samples~/Mini Combat/WallstopStudios.DxMessaging.MiniCombat.Sample.asmdef.meta +7 -7
- package/Samples~/Mini Combat.meta +8 -8
- package/Samples~/UI Buttons + Inspector/DiagnosticsEnabler.cs.meta +11 -11
- package/Samples~/UI Buttons + Inspector/Messages.cs.meta +11 -11
- package/Samples~/UI Buttons + Inspector/MessagingObserver.cs.meta +11 -11
- package/Samples~/UI Buttons + Inspector/README.md +210 -209
- package/Samples~/UI Buttons + Inspector/README.md.meta +7 -7
- package/Samples~/UI Buttons + Inspector/UIButtonEmitter.cs.meta +11 -11
- package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef +13 -13
- package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta +7 -7
- package/Samples~/UI Buttons + Inspector.meta +8 -8
- package/SourceGenerators/Directory.Build.props +50 -3
- package/SourceGenerators/Directory.Build.props.meta +7 -7
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs +96 -63
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs.meta +11 -11
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs +745 -87
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxMessageIdGenerator.cs.meta +11 -3
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj +39 -46
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.csproj.meta +7 -7
- package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators.meta +8 -8
- package/SourceGenerators/global.json +7 -0
- package/SourceGenerators/global.json.meta +7 -0
- package/SourceGenerators.meta +8 -8
- package/Third Party Notices.md +3 -3
- package/Third Party Notices.md.meta +7 -7
- package/package.json +102 -92
- package/package.json.meta +7 -7
package/Samples~/UI Buttons + Inspector/WallstopStudios.DxMessaging.UIButtons.Sample.asmdef.meta
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: e475c165078bed643a9e5b28abb34c94
|
|
3
|
-
AssemblyDefinitionImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: e475c165078bed643a9e5b28abb34c94
|
|
3
|
+
AssemblyDefinitionImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 54a9de7795e63374ea588cd687ad1184
|
|
3
|
-
folderAsset: yes
|
|
4
|
-
DefaultImporter:
|
|
5
|
-
externalObjects: {}
|
|
6
|
-
userData:
|
|
7
|
-
assetBundleName:
|
|
8
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 54a9de7795e63374ea588cd687ad1184
|
|
3
|
+
folderAsset: yes
|
|
4
|
+
DefaultImporter:
|
|
5
|
+
externalObjects: {}
|
|
6
|
+
userData:
|
|
7
|
+
assetBundleName:
|
|
8
|
+
assetBundleVariant:
|
|
@@ -1,9 +1,56 @@
|
|
|
1
1
|
<Project>
|
|
2
|
-
|
|
2
|
+
<!--
|
|
3
|
+
Redirect ALL build output for every project under SourceGenerators/ into the
|
|
4
|
+
repo's Unity-ignored, git-ignored .artifacts/ tree.
|
|
5
|
+
|
|
6
|
+
WHY: this repo IS a Unity UPM package and the repo root is the package root,
|
|
7
|
+
so Unity imports everything under it that is not in a Unity-ignored location.
|
|
8
|
+
Unity ignores files/folders whose names start with '.' (e.g. .artifacts) or
|
|
9
|
+
end with '~'. If a SourceGenerators project builds its obj/ or bin/ in-tree,
|
|
10
|
+
Unity imports those build outputs. The analyzer/source-generator DLLs there
|
|
11
|
+
have the SAME assembly names as the correctly-configured shipped analyzers in
|
|
12
|
+
Editor/Analyzers/, but their Unity-auto-generated .meta lack the
|
|
13
|
+
RoslynAnalyzer label / validateReferences:0 / all-platforms-disabled config.
|
|
14
|
+
Unity then fails to resolve their Microsoft.CodeAnalysis reference and the
|
|
15
|
+
duplicate shadows the real analyzers, so the source generator never runs and
|
|
16
|
+
every [Dx*Message] type fails to implement its generated interface
|
|
17
|
+
(CS0315/CS0452) project-wide.
|
|
18
|
+
|
|
19
|
+
Building these projects is REQUIRED by the dev workflow (the main projects'
|
|
20
|
+
PostBuildCopyAnalyzers target copies the freshly-built DLL into
|
|
21
|
+
Editor/Analyzers/), so the build MUST go somewhere Unity ignores.
|
|
22
|
+
|
|
23
|
+
HOW: redirect per-project obj/ and bin/ to
|
|
24
|
+
$(SolutionDir).artifacts/$(MSBuildProjectName)/{obj,bin}/$(Configuration)/.
|
|
25
|
+
BaseIntermediateOutputPath is set here because Directory.Build.props is
|
|
26
|
+
imported BEFORE the .NET SDK's default-path logic (Sdk.props) that derives
|
|
27
|
+
obj/ paths and before NuGet restore writes project.assets.json; setting it
|
|
28
|
+
here ensures even 'dotnet restore' writes obj/project.assets.json under
|
|
29
|
+
.artifacts/ instead of an in-tree obj/. IntermediateOutputPath (the
|
|
30
|
+
Configuration-scoped obj subfolder) and OutputPath (bin) are set for the
|
|
31
|
+
build itself. $(TargetPath) therefore resolves under .artifacts/, and the
|
|
32
|
+
PostBuildCopyAnalyzers targets still copy the built DLL into
|
|
33
|
+
Editor/Analyzers/ correctly.
|
|
34
|
+
-->
|
|
35
|
+
<PropertyGroup>
|
|
3
36
|
<SolutionDir Condition="'$(SolutionDir)' == ''">$(MSBuildThisFileDirectory)..\</SolutionDir>
|
|
4
|
-
<ArtifactsRoot
|
|
5
|
-
|
|
37
|
+
<ArtifactsRoot Condition="'$(ArtifactsRoot)' == ''"
|
|
38
|
+
>$(SolutionDir).artifacts/$(MSBuildProjectName)/</ArtifactsRoot>
|
|
39
|
+
<!-- Set BaseIntermediateOutputPath early so NuGet restore's obj/ (and
|
|
40
|
+
project.assets.json) is written under .artifacts/, never in-tree. The
|
|
41
|
+
trailing slash is required by the SDK's path-joining logic. -->
|
|
42
|
+
<BaseIntermediateOutputPath>$(ArtifactsRoot)obj/</BaseIntermediateOutputPath>
|
|
43
|
+
<IntermediateOutputPath>$(BaseIntermediateOutputPath)$(Configuration)/</IntermediateOutputPath>
|
|
6
44
|
<OutputPath>$(ArtifactsRoot)bin/$(Configuration)/</OutputPath>
|
|
7
45
|
<VSTestResultsDirectory>$(ArtifactsRoot)TestResults/</VSTestResultsDirectory>
|
|
46
|
+
<LangVersion>10.0</LangVersion>
|
|
47
|
+
<Deterministic>true</Deterministic>
|
|
48
|
+
<ContinuousIntegrationBuild>true</ContinuousIntegrationBuild>
|
|
49
|
+
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
|
50
|
+
<DebugType>none</DebugType>
|
|
51
|
+
<DebugSymbols>false</DebugSymbols>
|
|
52
|
+
<CopyAnalyzerPayload Condition="'$(CopyAnalyzerPayload)' == ''">true</CopyAnalyzerPayload>
|
|
53
|
+
<AnalyzerPayloadOutputDir Condition="'$(AnalyzerPayloadOutputDir)' == ''"
|
|
54
|
+
>$([System.IO.Path]::Combine('$(SolutionDir)', 'Editor', 'Analyzers'))</AnalyzerPayloadOutputDir>
|
|
8
55
|
</PropertyGroup>
|
|
9
56
|
</Project>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 5b80e1cf4c3c72a43bbd48e4667f00f7
|
|
3
|
-
DefaultImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
userData:
|
|
6
|
-
assetBundleName:
|
|
7
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 5b80e1cf4c3c72a43bbd48e4667f00f7
|
|
3
|
+
DefaultImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
userData:
|
|
6
|
+
assetBundleName:
|
|
7
|
+
assetBundleVariant:
|
package/SourceGenerators/WallstopStudios.DxMessaging.SourceGenerators/DxAutoConstructorGenerator.cs
CHANGED
|
@@ -13,8 +13,8 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
13
13
|
using Microsoft.CodeAnalysis.CSharp.Syntax;
|
|
14
14
|
using Microsoft.CodeAnalysis.Text;
|
|
15
15
|
|
|
16
|
-
[Generator
|
|
17
|
-
public sealed class DxAutoConstructorGenerator :
|
|
16
|
+
[Generator]
|
|
17
|
+
public sealed class DxAutoConstructorGenerator : ISourceGenerator
|
|
18
18
|
{
|
|
19
19
|
private static readonly DiagnosticDescriptor NonPartialContainerDiagnostic = new(
|
|
20
20
|
id: "DXMSG003",
|
|
@@ -57,46 +57,34 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
57
57
|
);
|
|
58
58
|
|
|
59
59
|
/// <summary>
|
|
60
|
-
/// Configures
|
|
60
|
+
/// Configures syntax collection for annotated types that need generated constructors.
|
|
61
61
|
/// </summary>
|
|
62
62
|
/// <param name="context">Initialization context provided by Roslyn.</param>
|
|
63
|
-
public void Initialize(
|
|
63
|
+
public void Initialize(GeneratorInitializationContext context)
|
|
64
64
|
{
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
context.SyntaxProvider.CreateSyntaxProvider(
|
|
68
|
-
predicate: static (node, _) => IsSyntaxTargetForGeneration(node),
|
|
69
|
-
transform: static (ctx, _) => (TypeDeclarationSyntax)ctx.Node
|
|
70
|
-
);
|
|
65
|
+
context.RegisterForSyntaxNotifications(static () => new TypeSyntaxReceiver());
|
|
66
|
+
}
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
GetSemanticTargetForGeneration(data.Left, data.Right, ct)
|
|
79
|
-
);
|
|
68
|
+
public void Execute(GeneratorExecutionContext context)
|
|
69
|
+
{
|
|
70
|
+
if (context.SyntaxReceiver is not TypeSyntaxReceiver receiver)
|
|
71
|
+
{
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
80
74
|
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
ImmutableArray<TypeToGenerateInfo> typesToGenerate = receiver
|
|
76
|
+
.Candidates.Select(typeDeclarationSyntax =>
|
|
77
|
+
GetSemanticTargetForGeneration(
|
|
78
|
+
typeDeclarationSyntax,
|
|
79
|
+
context.Compilation,
|
|
80
|
+
context.CancellationToken
|
|
81
|
+
)
|
|
82
|
+
)
|
|
83
83
|
.Where(static target => target.HasValue)
|
|
84
|
-
.Select(static
|
|
85
|
-
|
|
86
|
-
// Collect all valid types for generation
|
|
87
|
-
IncrementalValueProvider<ImmutableArray<TypeToGenerateInfo>> collectedTargets =
|
|
88
|
-
validSemanticTargets.Collect();
|
|
89
|
-
|
|
90
|
-
IncrementalValueProvider<(
|
|
91
|
-
Compilation,
|
|
92
|
-
ImmutableArray<TypeToGenerateInfo>
|
|
93
|
-
)> compilationAndTypes = context.CompilationProvider.Combine(collectedTargets);
|
|
84
|
+
.Select(static target => target!.Value)
|
|
85
|
+
.ToImmutableArray();
|
|
94
86
|
|
|
95
|
-
|
|
96
|
-
context.RegisterSourceOutput(
|
|
97
|
-
compilationAndTypes,
|
|
98
|
-
static (spc, source) => Execute(source.Item1, source.Item2, spc)
|
|
99
|
-
);
|
|
87
|
+
Execute(typesToGenerate, context);
|
|
100
88
|
}
|
|
101
89
|
|
|
102
90
|
private static bool IsSyntaxTargetForGeneration(SyntaxNode node) =>
|
|
@@ -105,7 +93,11 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
105
93
|
typeDecl.IsKind(SyntaxKind.ClassDeclaration)
|
|
106
94
|
|| typeDecl.IsKind(SyntaxKind.StructDeclaration)
|
|
107
95
|
|| typeDecl.IsKind(SyntaxKind.RecordDeclaration)
|
|
108
|
-
||
|
|
96
|
+
|| string.Equals(
|
|
97
|
+
typeDecl.Kind().ToString(),
|
|
98
|
+
"RecordStructDeclaration",
|
|
99
|
+
StringComparison.Ordinal
|
|
100
|
+
)
|
|
109
101
|
);
|
|
110
102
|
|
|
111
103
|
private static TypeToGenerateInfo? GetSemanticTargetForGeneration(
|
|
@@ -163,9 +155,8 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
163
155
|
}
|
|
164
156
|
|
|
165
157
|
private static void Execute(
|
|
166
|
-
Compilation compilation,
|
|
167
158
|
ImmutableArray<TypeToGenerateInfo> typesToGenerate,
|
|
168
|
-
|
|
159
|
+
GeneratorExecutionContext context
|
|
169
160
|
)
|
|
170
161
|
{
|
|
171
162
|
if (typesToGenerate.IsDefaultOrEmpty)
|
|
@@ -235,7 +226,11 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
235
226
|
}
|
|
236
227
|
|
|
237
228
|
// Generate the partial class/struct with the constructor
|
|
238
|
-
string generatedSource = GenerateConstructorSource(
|
|
229
|
+
string generatedSource = GenerateConstructorSource(
|
|
230
|
+
context.Compilation,
|
|
231
|
+
typeInfo,
|
|
232
|
+
context
|
|
233
|
+
);
|
|
239
234
|
string hintName =
|
|
240
235
|
$"{typeInfo.TypeSymbol.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat)}.AutoGenConstructor.g.cs"
|
|
241
236
|
.Replace("global::", "")
|
|
@@ -250,7 +245,7 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
250
245
|
private static string GenerateConstructorSource(
|
|
251
246
|
Compilation compilation,
|
|
252
247
|
TypeToGenerateInfo typeInfo,
|
|
253
|
-
|
|
248
|
+
GeneratorExecutionContext spc
|
|
254
249
|
)
|
|
255
250
|
{
|
|
256
251
|
INamedTypeSymbol typeSymbol = typeInfo.TypeSymbol;
|
|
@@ -290,10 +285,11 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
290
285
|
_ => "internal",
|
|
291
286
|
};
|
|
292
287
|
|
|
288
|
+
bool containerIsRecord = IsRecordDeclaration(container);
|
|
293
289
|
string containerKind = container.TypeKind switch
|
|
294
290
|
{
|
|
295
|
-
TypeKind.Class =>
|
|
296
|
-
TypeKind.Struct =>
|
|
291
|
+
TypeKind.Class => containerIsRecord ? "record class" : "class",
|
|
292
|
+
TypeKind.Struct => containerIsRecord ? "record struct" : "struct",
|
|
297
293
|
_ => "class",
|
|
298
294
|
};
|
|
299
295
|
|
|
@@ -323,10 +319,11 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
323
319
|
+ ">"
|
|
324
320
|
: string.Empty;
|
|
325
321
|
string typeName = typeSymbol.Name + typeGenericParams;
|
|
322
|
+
bool typeIsRecord = IsRecordDeclaration(typeSymbol);
|
|
326
323
|
string typeKind = typeSymbol.TypeKind switch
|
|
327
324
|
{
|
|
328
|
-
TypeKind.Class =>
|
|
329
|
-
TypeKind.Struct =>
|
|
325
|
+
TypeKind.Class => typeIsRecord ? "record class" : "class",
|
|
326
|
+
TypeKind.Struct => typeIsRecord ? "record struct" : "struct",
|
|
330
327
|
_ => throw new InvalidOperationException(
|
|
331
328
|
"Unsupported type kind for constructor generation"
|
|
332
329
|
),
|
|
@@ -524,25 +521,30 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
524
521
|
containersClose.Append(currentIndent).AppendLine("}");
|
|
525
522
|
}
|
|
526
523
|
|
|
527
|
-
return
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
524
|
+
return string.Join(
|
|
525
|
+
"\r\n",
|
|
526
|
+
new[]
|
|
527
|
+
{
|
|
528
|
+
"// <auto-generated by DxAutoGenConstructorGenerator/>",
|
|
529
|
+
"#pragma warning disable",
|
|
530
|
+
"#nullable enable annotations",
|
|
531
|
+
string.Empty,
|
|
532
|
+
namespaceBlockOpen,
|
|
533
|
+
$"{containersOpen}{innerIndent}{typeAccessibility} partial {typeKind} {typeName}",
|
|
534
|
+
$"{innerIndent}{{",
|
|
535
|
+
$"{Indent} /// <summary>",
|
|
536
|
+
$"{Indent} /// Auto-generated constructor by DxAutoGenConstructorGenerator.",
|
|
537
|
+
$"{Indent} /// </summary>",
|
|
538
|
+
$"{innerIndent} {constructorAccessibility} {typeSymbol.Name}({constructorParams})",
|
|
539
|
+
$"{innerIndent} {{",
|
|
540
|
+
$"{constructorBody}",
|
|
541
|
+
$"{innerIndent} }}",
|
|
542
|
+
$"{innerIndent}}}",
|
|
543
|
+
$"{containersClose}",
|
|
544
|
+
namespaceBlockClose,
|
|
545
|
+
string.Empty,
|
|
546
|
+
}
|
|
547
|
+
);
|
|
546
548
|
}
|
|
547
549
|
|
|
548
550
|
private static string FormatLiteral(object value, ITypeSymbol type)
|
|
@@ -651,6 +653,23 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
651
653
|
}
|
|
652
654
|
}
|
|
653
655
|
|
|
656
|
+
private static bool IsRecordDeclaration(INamedTypeSymbol symbol)
|
|
657
|
+
{
|
|
658
|
+
foreach (SyntaxReference syntaxReference in symbol.DeclaringSyntaxReferences)
|
|
659
|
+
{
|
|
660
|
+
if (syntaxReference.GetSyntax() is TypeDeclarationSyntax declaration)
|
|
661
|
+
{
|
|
662
|
+
string kind = declaration.Kind().ToString();
|
|
663
|
+
if (kind.IndexOf("Record", StringComparison.Ordinal) >= 0)
|
|
664
|
+
{
|
|
665
|
+
return true;
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
}
|
|
669
|
+
|
|
670
|
+
return false;
|
|
671
|
+
}
|
|
672
|
+
|
|
654
673
|
private static List<INamedTypeSymbol> GetNonPartialContainers(INamedTypeSymbol typeSymbol)
|
|
655
674
|
{
|
|
656
675
|
List<INamedTypeSymbol> result = new();
|
|
@@ -694,5 +713,19 @@ namespace WallstopStudios.DxMessaging.SourceGenerators
|
|
|
694
713
|
|
|
695
714
|
return true;
|
|
696
715
|
}
|
|
716
|
+
|
|
717
|
+
private sealed class TypeSyntaxReceiver : ISyntaxReceiver
|
|
718
|
+
{
|
|
719
|
+
public List<TypeDeclarationSyntax> Candidates { get; } =
|
|
720
|
+
new List<TypeDeclarationSyntax>();
|
|
721
|
+
|
|
722
|
+
public void OnVisitSyntaxNode(SyntaxNode syntaxNode)
|
|
723
|
+
{
|
|
724
|
+
if (IsSyntaxTargetForGeneration(syntaxNode))
|
|
725
|
+
{
|
|
726
|
+
Candidates.Add((TypeDeclarationSyntax)syntaxNode);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
697
730
|
}
|
|
698
731
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
fileFormatVersion: 2
|
|
2
|
-
guid: 1b72dc77d3697c1d6bc2f3e1d262f9af
|
|
3
|
-
MonoImporter:
|
|
4
|
-
externalObjects: {}
|
|
5
|
-
serializedVersion: 2
|
|
6
|
-
defaultReferences: []
|
|
7
|
-
executionOrder: 0
|
|
8
|
-
icon: {instanceID: 0}
|
|
9
|
-
userData:
|
|
10
|
-
assetBundleName:
|
|
11
|
-
assetBundleVariant:
|
|
1
|
+
fileFormatVersion: 2
|
|
2
|
+
guid: 1b72dc77d3697c1d6bc2f3e1d262f9af
|
|
3
|
+
MonoImporter:
|
|
4
|
+
externalObjects: {}
|
|
5
|
+
serializedVersion: 2
|
|
6
|
+
defaultReferences: []
|
|
7
|
+
executionOrder: 0
|
|
8
|
+
icon: {instanceID: 0}
|
|
9
|
+
userData:
|
|
10
|
+
assetBundleName:
|
|
11
|
+
assetBundleVariant:
|