From 34744bc86063628acdd32f61ae61e129dc2cf5a7 Mon Sep 17 00:00:00 2001 From: Habetdin <15926758+Habetdin@users.noreply.github.com> Date: Sat, 12 Jul 2025 21:07:12 +0300 Subject: [PATCH] Define assembly constraints to avoid DllNotFoundException on unsupported platforms --- .../Scripts/Apple.Core.Demos.asmdef | 18 ++++++++++++++++++ .../Apple.Core/Runtime/Apple.Core.asmdef | 4 +++- .../Tests/Runtime/Apple.Core.Tests.asmdef | 1 + .../Tests/Apple.CoreHaptics.Tests.asmdef | 1 + .../Apple.Arcade.GameKit.Sample.asmdef | 4 +++- .../Apple.GameKit/Source/Apple.GameKit.asmdef | 4 +++- .../Demos/Scripts/Apple.PHASE.Demos.asmdef | 4 +++- .../Assets/Editor/Apple.PHASE.Editor.asmdef | 4 +++- .../Assets/Runtime/Apple.PHASE.asmdef | 4 +++- .../Tests/Runtime/Apple.PHASE.Tests.asmdef | 1 + 10 files changed, 39 insertions(+), 6 deletions(-) create mode 100644 plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scripts/Apple.Core.Demos.asmdef diff --git a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scripts/Apple.Core.Demos.asmdef b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scripts/Apple.Core.Demos.asmdef new file mode 100644 index 00000000..2f3d7401 --- /dev/null +++ b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Demos/Apple.Core.AvailabilitySample/Scripts/Apple.Core.Demos.asmdef @@ -0,0 +1,18 @@ +{ + "name": "Apple.Core.Demos", + "rootNamespace": "", + "references": [ + "GUID:1e90ac084be3f8d469f923da4b9f7c81" + ], + "includePlatforms": [], + "excludePlatforms": [], + "allowUnsafeCode": false, + "overrideReferences": false, + "precompiledReferences": [], + "autoReferenced": true, + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], + "versionDefines": [], + "noEngineReferences": false +} \ No newline at end of file diff --git a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Runtime/Apple.Core.asmdef b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Runtime/Apple.Core.asmdef index fc59d4b2..66cda8b7 100644 --- a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Runtime/Apple.Core.asmdef +++ b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Runtime/Apple.Core.asmdef @@ -14,7 +14,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Tests/Runtime/Apple.Core.Tests.asmdef b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Tests/Runtime/Apple.Core.Tests.asmdef index 3e893a92..1d1333db 100644 --- a/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Tests/Runtime/Apple.Core.Tests.asmdef +++ b/plug-ins/Apple.Core/Apple.Core_Unity/Assets/Apple.Core/Tests/Runtime/Apple.Core.Tests.asmdef @@ -14,6 +14,7 @@ ], "autoReferenced": false, "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS", "UNITY_INCLUDE_TESTS" ], "versionDefines": [], diff --git a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Tests/Apple.CoreHaptics.Tests.asmdef b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Tests/Apple.CoreHaptics.Tests.asmdef index e0700d60..18d669fb 100644 --- a/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Tests/Apple.CoreHaptics.Tests.asmdef +++ b/plug-ins/Apple.CoreHaptics/Apple.CoreHaptics_Unity/Assets/Apple.CoreHaptics/Tests/Apple.CoreHaptics.Tests.asmdef @@ -17,6 +17,7 @@ ], "autoReferenced": false, "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS", "UNITY_INCLUDE_TESTS" ], "versionDefines": [], diff --git a/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Demos/Apple.GameKit.Sample/Apple.Arcade.GameKit.Sample.asmdef b/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Demos/Apple.GameKit.Sample/Apple.Arcade.GameKit.Sample.asmdef index b4e044a6..9882e725 100644 --- a/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Demos/Apple.GameKit.Sample/Apple.Arcade.GameKit.Sample.asmdef +++ b/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Demos/Apple.GameKit.Sample/Apple.Arcade.GameKit.Sample.asmdef @@ -17,7 +17,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/Apple.GameKit.asmdef b/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/Apple.GameKit.asmdef index 79601579..36f568ba 100644 --- a/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/Apple.GameKit.asmdef +++ b/plug-ins/Apple.GameKit/Apple.GameKit_Unity/Assets/Apple.GameKit/Source/Apple.GameKit.asmdef @@ -16,7 +16,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Demos/Scripts/Apple.PHASE.Demos.asmdef b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Demos/Scripts/Apple.PHASE.Demos.asmdef index cd56dbfa..ecb0ce4b 100644 --- a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Demos/Scripts/Apple.PHASE.Demos.asmdef +++ b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Demos/Scripts/Apple.PHASE.Demos.asmdef @@ -9,7 +9,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Editor/Apple.PHASE.Editor.asmdef b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Editor/Apple.PHASE.Editor.asmdef index 89935963..08056a0c 100644 --- a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Editor/Apple.PHASE.Editor.asmdef +++ b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Editor/Apple.PHASE.Editor.asmdef @@ -15,7 +15,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Runtime/Apple.PHASE.asmdef b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Runtime/Apple.PHASE.asmdef index bc62bbcc..e059b08f 100644 --- a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Runtime/Apple.PHASE.asmdef +++ b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Runtime/Apple.PHASE.asmdef @@ -17,7 +17,9 @@ "overrideReferences": false, "precompiledReferences": [], "autoReferenced": true, - "defineConstraints": [], + "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS" + ], "versionDefines": [], "noEngineReferences": false } \ No newline at end of file diff --git a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Tests/Runtime/Apple.PHASE.Tests.asmdef b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Tests/Runtime/Apple.PHASE.Tests.asmdef index a7d09e67..cdc5e2f5 100644 --- a/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Tests/Runtime/Apple.PHASE.Tests.asmdef +++ b/plug-ins/Apple.PHASE/Apple.PHASE_Unity/Assets/Tests/Runtime/Apple.PHASE.Tests.asmdef @@ -21,6 +21,7 @@ ], "autoReferenced": false, "defineConstraints": [ + "UNITY_IOS || UNITY_STANDALONE_OSX || UNITY_TVOS || UNITY_VISIONOS", "UNITY_INCLUDE_TESTS" ], "versionDefines": [],