From 66b6f6a97773fc1b0c8897e88a143e5ef902dad8 Mon Sep 17 00:00:00 2001 From: nirinchev Date: Wed, 17 May 2023 14:55:26 +0200 Subject: [PATCH 01/33] wip --- Realm - Windows.sln | 51 +++++++++++++++ Realm/Realm.PlatformHelpers/AssemblyInfo.cs | 22 +++++++ .../DeviceInfo.android.cs | 27 ++++++++ Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs | 28 ++++++++ .../DeviceInfo.netstandard.cs | 27 ++++++++ .../DeviceInfo.shared.cs | 27 ++++++++ .../Realm.PlatformHelpers/Platform.shared.cs | 43 +++++++++++++ .../Realm.PlatformHelpers.csproj | 64 +++++++++++++++++++ Realm/Realm.UnityUtils/DeviceInfo.cs | 28 ++++++++ Realm/Realm.UnityUtils/Initializer.cs | 3 + Realm/Realm/Handles/AppHandle.cs | 6 +- Realm/Realm/Realm.csproj | 1 + 12 files changed, 324 insertions(+), 3 deletions(-) create mode 100644 Realm/Realm.PlatformHelpers/AssemblyInfo.cs create mode 100644 Realm/Realm.PlatformHelpers/DeviceInfo.android.cs create mode 100644 Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs create mode 100644 Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs create mode 100644 Realm/Realm.PlatformHelpers/DeviceInfo.shared.cs create mode 100644 Realm/Realm.PlatformHelpers/Platform.shared.cs create mode 100644 Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj create mode 100644 Realm/Realm.UnityUtils/DeviceInfo.cs diff --git a/Realm - Windows.sln b/Realm - Windows.sln index 677f1d0ffc..a07ecc6318 100644 --- a/Realm - Windows.sln +++ b/Realm - Windows.sln @@ -89,6 +89,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Maui", "Tests\Tests.M EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeployApps", "Tools\DeployApps\DeployApps.csproj", "{10026D09-FC37-48B3-AAEA-B322AA6D89CE}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.PlatformHelpers", "Realm\Realm.PlatformHelpers\Realm.PlatformHelpers.csproj", "{536C3309-F848-4485-ABF3-56DCD9C9F9E8}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1373,6 +1375,54 @@ Global {10026D09-FC37-48B3-AAEA-B322AA6D89CE}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {10026D09-FC37-48B3-AAEA-B322AA6D89CE}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {10026D09-FC37-48B3-AAEA-B322AA6D89CE}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|Any CPU.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|ARM.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|ARM.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|iPhone.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|x64.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|x64.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|x86.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Debug|x86.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|Any CPU.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|Any CPU.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|ARM.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|ARM.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|iPhone.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|iPhone.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|iPhoneSimulator.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|x64.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|x64.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|x86.ActiveCfg = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.MinSizeRel|x86.Build.0 = Debug|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|Any CPU.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|Any CPU.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|ARM.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|ARM.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|iPhone.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|iPhone.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|x64.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|x64.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|x86.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.Release|x86.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|Any CPU.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|Any CPU.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|ARM.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|ARM.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|iPhone.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|iPhone.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x64.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU + {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1406,6 +1456,7 @@ Global {3C3CEB09-94C5-4FE4-BF75-1CEF4EAF6E47} = {EC97E75C-3A79-4B00-95BD-218D71C58746} {C84EBA8B-5F7F-4519-BB34-EDE93E275D66} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {10026D09-FC37-48B3-AAEA-B322AA6D89CE} = {073F6C2D-FECB-41E3-BEA3-1685FAA580DB} + {536C3309-F848-4485-ABF3-56DCD9C9F9E8} = {50F058DF-2B41-403C-BB73-8B4180D1CF39} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BE5E0028-B74D-4BE1-B1DA-5FFCC8469C41} diff --git a/Realm/Realm.PlatformHelpers/AssemblyInfo.cs b/Realm/Realm.PlatformHelpers/AssemblyInfo.cs new file mode 100644 index 0000000000..4be70d1b5b --- /dev/null +++ b/Realm/Realm.PlatformHelpers/AssemblyInfo.cs @@ -0,0 +1,22 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using System.Runtime.CompilerServices; + +[assembly: InternalsVisibleTo("Realm")] +[assembly: InternalsVisibleTo("Realm.UnityUtils")] diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs new file mode 100644 index 0000000000..bcc0c3311b --- /dev/null +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +namespace Realms.PlatformHelpers +{ + internal class DeviceInfo : IDeviceInfo + { + public string DeviceName => Build.Model; + + public string DeviceVersion => throw new System.NotImplementedException(); + } +} diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs new file mode 100644 index 0000000000..81f569389b --- /dev/null +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +namespace Realms.PlatformHelpers +{ + internal class DeviceInfo : IDeviceInfo + { + public string DeviceName => UIKit.UIDevice.CurrentDevice.Model; + + // TODO: what should these be? + public string DeviceVersion => UIKit.UIDevice.CurrentDevice.Model; + } +} diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs new file mode 100644 index 0000000000..a16d01e16f --- /dev/null +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +namespace Realms.PlatformHelpers +{ + public class DeviceInfo : IDeviceInfo + { + public string DeviceName => "Unknown"; + + public string DeviceVersion => "Unknown"; + } +} diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.shared.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.shared.cs new file mode 100644 index 0000000000..9b65c709c8 --- /dev/null +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.shared.cs @@ -0,0 +1,27 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +namespace Realms.PlatformHelpers +{ + internal interface IDeviceInfo + { + string DeviceName { get; } + + string DeviceVersion { get; } + } +} diff --git a/Realm/Realm.PlatformHelpers/Platform.shared.cs b/Realm/Realm.PlatformHelpers/Platform.shared.cs new file mode 100644 index 0000000000..7fa29f8bcf --- /dev/null +++ b/Realm/Realm.PlatformHelpers/Platform.shared.cs @@ -0,0 +1,43 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using System; + +namespace Realms.PlatformHelpers +{ + internal static class Platform + { + private static IDeviceInfo? _deviceInfo; + + private static Lazy _deviceInfoLazy = new(() => _deviceInfo ?? new DeviceInfo()); + + public static IDeviceInfo DeviceInfo + { + get => _deviceInfoLazy.Value; + set + { + if (_deviceInfoLazy.IsValueCreated) + { + throw new Exception("DeviceInfo should only be configured once"); + } + + _deviceInfo = value; + } + } + } +} diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj new file mode 100644 index 0000000000..fce74ae614 --- /dev/null +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -0,0 +1,64 @@ + + + + net6.0-ios;netstandard2.0;net6.0-android + false + 10.0 + enable + + + + + + + + + + + + + Windows Desktop Extensions for the UWP + + + Windows Mobile Extensions for the UWP + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Runtime + + + + + + + + + + + diff --git a/Realm/Realm.UnityUtils/DeviceInfo.cs b/Realm/Realm.UnityUtils/DeviceInfo.cs new file mode 100644 index 0000000000..e36abbc78d --- /dev/null +++ b/Realm/Realm.UnityUtils/DeviceInfo.cs @@ -0,0 +1,28 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using Realms.PlatformHelpers; +using UnityEngine; + +namespace Realm.UnityUtils +{ + internal class UnityDeviceInfo : IDeviceInfo + { + public string DeviceName => SystemInfo.deviceName; + } +} diff --git a/Realm/Realm.UnityUtils/Initializer.cs b/Realm/Realm.UnityUtils/Initializer.cs index f22df09a95..d33bfa79f1 100644 --- a/Realm/Realm.UnityUtils/Initializer.cs +++ b/Realm/Realm.UnityUtils/Initializer.cs @@ -17,7 +17,9 @@ //////////////////////////////////////////////////////////////////////////// using System.Threading; +using Realm.UnityUtils; using Realms; +using Realms.PlatformHelpers; using UnityEngine; namespace UnityUtils @@ -31,6 +33,7 @@ public static void Initialize() { if (Interlocked.CompareExchange(ref _isInitialized, 1, 0) == 0) { + Platform.DeviceInfo = new UnityDeviceInfo(); InteropConfig.AddPotentialStorageFolder(FileHelper.GetStorageFolder()); Realms.Logging.Logger.Console = new UnityLogger(); Application.quitting += () => diff --git a/Realm/Realm/Handles/AppHandle.cs b/Realm/Realm/Handles/AppHandle.cs index bc922d4da1..01929a23d2 100644 --- a/Realm/Realm/Handles/AppHandle.cs +++ b/Realm/Realm/Handles/AppHandle.cs @@ -23,6 +23,7 @@ using System.Runtime.InteropServices; using System.Threading.Tasks; using Realms.Native; +using Realms.PlatformHelpers; using Realms.Sync.Exceptions; using Realms.Sync.Native; @@ -173,9 +174,8 @@ public static void Initialize() var cpuArch = RuntimeInformation.ProcessArchitecture.ToString(); - // TODO: try and infer device information as part of RNET-849 - var deviceName = "unknown"; - var deviceVersion = "unknown"; + var deviceName = Platform.DeviceInfo.DeviceName; + var deviceVersion = Platform.DeviceInfo.DeviceVersion; NativeMethods.initialize( frameworkName, frameworkName.IntPtrLength(), diff --git a/Realm/Realm/Realm.csproj b/Realm/Realm/Realm.csproj index 3034319cd4..22cf3b08ed 100644 --- a/Realm/Realm/Realm.csproj +++ b/Realm/Realm/Realm.csproj @@ -37,6 +37,7 @@ false + false From f288bd36c2dc4dc44de9cc5c44ed84ac2a750fde Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 17 May 2023 18:40:57 +0200 Subject: [PATCH 02/33] more wip --- .../DeviceInfo.android.cs | 8 ++- Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs | 50 ++++++++++++++++++- Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs | 32 ++++++++++++ .../Realm.PlatformHelpers/Platform.shared.cs | 2 + .../Realm.PlatformHelpers.csproj | 22 +++----- .../Realm.UnityUtils/Realm.UnityUtils.csproj | 2 +- .../Realm.UnityWeaver.csproj | 2 +- Realm/Realm.Weaver/Realm.Weaver.projitems | 2 +- Tests/Tests.iOS/Tests.iOS.csproj | 6 +++ 9 files changed, 103 insertions(+), 23 deletions(-) create mode 100644 Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs index bcc0c3311b..ee2b607c9b 100644 --- a/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs @@ -16,12 +16,16 @@ // //////////////////////////////////////////////////////////////////////////// +using Android.OS; + +using static Realms.PlatformHelpers.Platform; + namespace Realms.PlatformHelpers { internal class DeviceInfo : IDeviceInfo { - public string DeviceName => Build.Model; + public string DeviceName => Build.Manufacturer ?? Unknown; - public string DeviceVersion => throw new System.NotImplementedException(); + public string DeviceVersion => Build.Model ?? Unknown; } } diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs index 81f569389b..89e5253254 100644 --- a/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs @@ -16,13 +16,59 @@ // //////////////////////////////////////////////////////////////////////////// +using System; +using System.Runtime.InteropServices; +using ObjCRuntime; +using static Realms.PlatformHelpers.Platform; + namespace Realms.PlatformHelpers { internal class DeviceInfo : IDeviceInfo { + [DllImport(Constants.SystemLibrary, EntryPoint = "sysctlbyname")] + internal static extern int SysctlByName([MarshalAs(UnmanagedType.LPStr)] string property, IntPtr output, IntPtr oldLen, IntPtr newp, uint newlen); + + internal static string GetSystemLibraryProperty(string property) + { + var lengthPtr = Marshal.AllocHGlobal(sizeof(int)); + SysctlByName(property, IntPtr.Zero, lengthPtr, IntPtr.Zero, 0); + + var propertyLength = Marshal.ReadInt32(lengthPtr); + + if (propertyLength == 0) + { + Marshal.FreeHGlobal(lengthPtr); + throw new InvalidOperationException("Unable to read length of property."); + } + + var valuePtr = Marshal.AllocHGlobal(propertyLength); + SysctlByName(property, valuePtr, lengthPtr, IntPtr.Zero, 0); + + var returnValue = Marshal.PtrToStringAnsi(valuePtr); + + Marshal.FreeHGlobal(lengthPtr); + Marshal.FreeHGlobal(valuePtr); + + return returnValue!; + } + + private static readonly Lazy _version = new(FindVersion); + + private static string FindVersion() + { + try + { + return GetSystemLibraryProperty("hw.machine")!; + } + catch + { + } + + return Unknown; + } + public string DeviceName => UIKit.UIDevice.CurrentDevice.Model; - // TODO: what should these be? - public string DeviceVersion => UIKit.UIDevice.CurrentDevice.Model; + public string DeviceVersion => _version.Value; } } diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs b/Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs new file mode 100644 index 0000000000..2a18bf88d8 --- /dev/null +++ b/Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs @@ -0,0 +1,32 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using System; +using System.Runtime.InteropServices; +using ObjCRuntime; +using static Realms.PlatformHelpers.Platform; + +namespace Realms.PlatformHelpers +{ + internal class DeviceInfo : IDeviceInfo + { + public string DeviceName => Unknown; + + public string DeviceVersion => Unknown; + } +} diff --git a/Realm/Realm.PlatformHelpers/Platform.shared.cs b/Realm/Realm.PlatformHelpers/Platform.shared.cs index 7fa29f8bcf..c6daa6b601 100644 --- a/Realm/Realm.PlatformHelpers/Platform.shared.cs +++ b/Realm/Realm.PlatformHelpers/Platform.shared.cs @@ -22,6 +22,8 @@ namespace Realms.PlatformHelpers { internal static class Platform { + public const string Unknown = "unknown"; + private static IDeviceInfo? _deviceInfo; private static Lazy _deviceInfoLazy = new(() => _deviceInfo ?? new DeviceInfo()); diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj index fce74ae614..bc6c6bff18 100644 --- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -1,9 +1,11 @@  - net6.0-ios;netstandard2.0;net6.0-android + netstandard2.0 + $(TargetFrameworks);net6.0-ios;net6.0-android + $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 false - 10.0 + 9.0 enable @@ -32,26 +34,14 @@ - - + - - - - - - - - - - - Runtime - + diff --git a/Realm/Realm.UnityUtils/Realm.UnityUtils.csproj b/Realm/Realm.UnityUtils/Realm.UnityUtils.csproj index 5da87b19bd..23a71edae0 100644 --- a/Realm/Realm.UnityUtils/Realm.UnityUtils.csproj +++ b/Realm/Realm.UnityUtils/Realm.UnityUtils.csproj @@ -25,7 +25,7 @@ - + diff --git a/Realm/Realm.UnityWeaver/Realm.UnityWeaver.csproj b/Realm/Realm.UnityWeaver/Realm.UnityWeaver.csproj index 366230d062..68282f29f4 100644 --- a/Realm/Realm.UnityWeaver/Realm.UnityWeaver.csproj +++ b/Realm/Realm.UnityWeaver/Realm.UnityWeaver.csproj @@ -22,7 +22,7 @@ - + diff --git a/Realm/Realm.Weaver/Realm.Weaver.projitems b/Realm/Realm.Weaver/Realm.Weaver.projitems index b3ac2cae1b..3d14f8f13f 100644 --- a/Realm/Realm.Weaver/Realm.Weaver.projitems +++ b/Realm/Realm.Weaver/Realm.Weaver.projitems @@ -10,6 +10,6 @@ - + \ No newline at end of file diff --git a/Tests/Tests.iOS/Tests.iOS.csproj b/Tests/Tests.iOS/Tests.iOS.csproj index 98873ed664..481bd5581b 100644 --- a/Tests/Tests.iOS/Tests.iOS.csproj +++ b/Tests/Tests.iOS/Tests.iOS.csproj @@ -163,6 +163,12 @@ {C0DB0E07-4FBC-44D1-8E84-A074497385C6} Realm + + {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} + Realm.PlatformHelpers + Xamarin.iOS10 + $(Platform) + \ No newline at end of file From 862f0e5fd8d53cd7896c80d6b360b18696e8de88 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 17 May 2023 19:48:23 +0200 Subject: [PATCH 03/33] msbuild magic --- Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj | 6 +++--- Tests/Tests.Android/Tests.Android.csproj | 4 ++++ 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj index bc6c6bff18..acbae11453 100644 --- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -1,9 +1,9 @@  - netstandard2.0 - $(TargetFrameworks);net6.0-ios;net6.0-android - $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 + netstandard2.0 + $(TargetFrameworks);net6.0-ios;net6.0-android + $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 false 9.0 enable diff --git a/Tests/Tests.Android/Tests.Android.csproj b/Tests/Tests.Android/Tests.Android.csproj index 09ae3af737..74daa983a8 100644 --- a/Tests/Tests.Android/Tests.Android.csproj +++ b/Tests/Tests.Android/Tests.Android.csproj @@ -87,6 +87,10 @@ {C0DB0E07-4FBC-44D1-8E84-A074497385C6} Realm + + {536c3309-f848-4485-abf3-56dcd9c9f9e8} + Realm.PlatformHelpers + lib\x86\librealm-wrappers.so PreserveNewest From 46d66e500557e48b320633face64ba4847bf6959 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Wed, 17 May 2023 19:51:24 +0200 Subject: [PATCH 04/33] Add reference to Realm.sln --- Realm.sln | 269 ++++++++++++++++++++++++++++++------------------------ 1 file changed, 148 insertions(+), 121 deletions(-) diff --git a/Realm.sln b/Realm.sln index 23fa8bdc78..ae84417497 100644 --- a/Realm.sln +++ b/Realm.sln @@ -44,44 +44,46 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SourceGenerators", "SourceG EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.XamarinTVOS", "Tests\Tests.XamarinTVOS\Tests.XamarinTVOS.csproj", "{80B9697D-0C57-40E8-A71A-F5E81C7BF467}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DeployApps", "Tools\DeployApps\DeployApps.csproj", "{56029D1A-0AF6-4535-9D6A-CD5CD61325C6}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeployApps", "Tools\DeployApps\DeployApps.csproj", "{56029D1A-0AF6-4535-9D6A-CD5CD61325C6}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Realm.Fody", "Realm\Realm.Fody\Realm.Fody.csproj", "{2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.Fody", "Realm\Realm.Fody\Realm.Fody.csproj", "{2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Tests.XamarinMac", "Tests\Tests.XamarinMac\Tests.XamarinMac.csproj", "{EEB44902-3249-4945-8ACA-125912E6F2F5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.XamarinMac", "Tests\Tests.XamarinMac\Tests.XamarinMac.csproj", "{3A6CC342-40D0-4487-9964-DDAEBA628199}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Realm.FakeForWeaverTests", "Tests\Weaver\Realm.FakeForWeaverTests\Realm.FakeForWeaverTests.csproj", "{7174D68E-E76D-4A4F-9F9A-601F5FB2DB65}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.FakeForWeaverTests", "Tests\Weaver\Realm.FakeForWeaverTests\Realm.FakeForWeaverTests.csproj", "{7174D68E-E76D-4A4F-9F9A-601F5FB2DB65}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "RealmFreeAssemblyToProcess", "Tests\Weaver\RealmFreeAssemblyToProcess\RealmFreeAssemblyToProcess.csproj", "{C04E5F74-83F0-4A2F-981D-A3442B083F40}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "RealmFreeAssemblyToProcess", "Tests\Weaver\RealmFreeAssemblyToProcess\RealmFreeAssemblyToProcess.csproj", "{C04E5F74-83F0-4A2F-981D-A3442B083F40}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "AssemblyToProcess", "Tests\Weaver\AssemblyToProcess\AssemblyToProcess.csproj", "{FAD8E779-25DD-4AF1-BEB0-4B8D9696ACAD}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "AssemblyToProcess", "Tests\Weaver\AssemblyToProcess\AssemblyToProcess.csproj", "{FAD8E779-25DD-4AF1-BEB0-4B8D9696ACAD}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Realm.Fody.Tests", "Tests\Weaver\Realm.Fody.Tests\Realm.Fody.Tests.csproj", "{218C6795-AA18-4861-8613-D022C0C53628}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.Fody.Tests", "Tests\Weaver\Realm.Fody.Tests\Realm.Fody.Tests.csproj", "{218C6795-AA18-4861-8613-D022C0C53628}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "PerformanceTests", "Tests\Benchmarks\PerformanceTests\PerformanceTests.csproj", "{90616AF5-9024-4054-B40B-9A82F8F4DC83}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PerformanceTests", "Tests\Benchmarks\PerformanceTests\PerformanceTests.csproj", "{90616AF5-9024-4054-B40B-9A82F8F4DC83}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Benchmarks", "Tests\Benchmarks\Benchmarks\Benchmarks.csproj", "{BECF4F60-9741-49A6-BD79-D59664C2682E}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Benchmarks", "Tests\Benchmarks\Benchmarks\Benchmarks.csproj", "{BECF4F60-9741-49A6-BD79-D59664C2682E}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Benchmarks.Android", "Tests\Benchmarks\Benchmarks.Android\Benchmarks.Android.csproj", "{197FBF65-C978-4FB4-BB6F-F7D76C320218}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks.Android", "Tests\Benchmarks\Benchmarks.Android\Benchmarks.Android.csproj", "{907F4283-1EA9-41FE-B482-9BD2A72F0850}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Benchmarks.iOS", "Tests\Benchmarks\Benchmarks.iOS\Benchmarks.iOS.csproj", "{B7340A22-2989-45EE-B05D-0682B5C43897}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Benchmarks.iOS", "Tests\Benchmarks\Benchmarks.iOS\Benchmarks.iOS.csproj", "{CE887906-33F1-4B47-8E8F-C6A7A60D1372}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Tests.Android", "Tests\Tests.Android\Tests.Android.csproj", "{E14C7032-A542-4A5A-AB5B-62E25F2B105C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.Android", "Tests\Tests.Android\Tests.Android.csproj", "{10725A22-B22F-46AB-B5C4-7BC505A1E74A}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Tests.XUnit", "Tests\Tests.XUnit\Tests.XUnit.csproj", "{12EFED5B-E168-401E-9BCB-4FBB928720AB}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.XUnit", "Tests\Tests.XUnit\Tests.XUnit.csproj", "{12EFED5B-E168-401E-9BCB-4FBB928720AB}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Tests.Maui", "Tests\Tests.Maui\Tests.Maui.csproj", "{B4C6AD4A-DA91-4171-90D8-0F46378EAEBE}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests.Maui", "Tests\Tests.Maui\Tests.Maui.csproj", "{B4C6AD4A-DA91-4171-90D8-0F46378EAEBE}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "SourceGeneratorAssemblyToProcess", "Tests\SourceGenerators\SourceGeneratorAssemblyToProcess\SourceGeneratorAssemblyToProcess.csproj", "{5466EA2B-2810-4E79-8DA4-BE580832B568}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SourceGeneratorAssemblyToProcess", "Tests\SourceGenerators\SourceGeneratorAssemblyToProcess\SourceGeneratorAssemblyToProcess.csproj", "{5466EA2B-2810-4E79-8DA4-BE580832B568}" EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "Realm.SourceGenerator.Tests", "Tests\SourceGenerators\Realm.SourceGenerator.Tests\Realm.SourceGenerator.Tests.csproj", "{641367F9-5149-4E5D-9459-B19DAFC426A8}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.SourceGenerator.Tests", "Tests\SourceGenerators\Realm.SourceGenerator.Tests\Realm.SourceGenerator.Tests.csproj", "{641367F9-5149-4E5D-9459-B19DAFC426A8}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.UWP", "Tests\Tests.UWP\Tests.UWP.csproj", "{7EFF9E5C-5E74-469B-8DB7-C25C9AF0444E}" ProjectSection(ProjectDependencies) = postProject {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4} = {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4} EndProjectSection EndProject -Project("{9344BDBB-3E7F-41FC-A0DD-8665D75EE146}") = "SetupUnityPackage", "Tools\SetupUnityPackage\SetupUnityPackage.csproj", "{A9B5E8CA-E1B8-47E4-89D4-8A55327F4121}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SetupUnityPackage", "Tools\SetupUnityPackage\SetupUnityPackage.csproj", "{A9B5E8CA-E1B8-47E4-89D4-8A55327F4121}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.PlatformHelpers", "Realm\Realm.PlatformHelpers\Realm.PlatformHelpers.csproj", "{D08C71CE-0F5B-4855-A77C-58062A5ECB78}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -315,30 +317,30 @@ Global {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4}.Release|x64.Build.0 = Release|Any CPU {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4}.Release|x86.ActiveCfg = Release|Any CPU {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4}.Release|x86.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|ARM.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|ARM.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|iPhone.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|x64.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|x64.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|x86.ActiveCfg = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Debug|x86.Build.0 = Debug|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|Any CPU.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|ARM.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|ARM.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|iPhone.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|iPhone.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|x64.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|x64.Build.0 = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|x86.ActiveCfg = Release|Any CPU - {EEB44902-3249-4945-8ACA-125912E6F2F5}.Release|x86.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|Any CPU.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|ARM.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|ARM.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhone.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x64.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x64.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.ActiveCfg = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Debug|x86.Build.0 = Debug|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|Any CPU.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|ARM.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|ARM.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhone.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhone.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x64.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x64.Build.0 = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.ActiveCfg = Release|Any CPU + {3A6CC342-40D0-4487-9964-DDAEBA628199}.Release|x86.Build.0 = Release|Any CPU {7174D68E-E76D-4A4F-9F9A-601F5FB2DB65}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7174D68E-E76D-4A4F-9F9A-601F5FB2DB65}.Debug|Any CPU.Build.0 = Debug|Any CPU {7174D68E-E76D-4A4F-9F9A-601F5FB2DB65}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -483,78 +485,78 @@ Global {BECF4F60-9741-49A6-BD79-D59664C2682E}.Release|x64.Build.0 = Release|Any CPU {BECF4F60-9741-49A6-BD79-D59664C2682E}.Release|x86.ActiveCfg = Release|Any CPU {BECF4F60-9741-49A6-BD79-D59664C2682E}.Release|x86.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|Any CPU.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|ARM.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|ARM.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|iPhone.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|x64.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|x64.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|x86.ActiveCfg = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Debug|x86.Build.0 = Debug|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|Any CPU.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|Any CPU.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|ARM.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|ARM.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|iPhone.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|iPhone.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|x64.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|x64.Build.0 = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|x86.ActiveCfg = Release|Any CPU - {197FBF65-C978-4FB4-BB6F-F7D76C320218}.Release|x86.Build.0 = Release|Any CPU - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|ARM.Build.0 = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|iPhone.ActiveCfg = Debug|iPhone - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|iPhone.Build.0 = Debug|iPhone - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|x64.Build.0 = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Debug|x86.Build.0 = Debug|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|Any CPU.Build.0 = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|ARM.ActiveCfg = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|ARM.Build.0 = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|iPhone.ActiveCfg = Release|iPhone - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|iPhone.Build.0 = Release|iPhone - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|x64.ActiveCfg = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|x64.Build.0 = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|x86.ActiveCfg = Release|iPhoneSimulator - {B7340A22-2989-45EE-B05D-0682B5C43897}.Release|x86.Build.0 = Release|iPhoneSimulator - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|ARM.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|ARM.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|iPhone.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|iPhone.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|x64.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|x64.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|x86.ActiveCfg = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Debug|x86.Build.0 = Debug|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|Any CPU.Build.0 = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|ARM.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|ARM.Build.0 = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|iPhone.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|iPhone.Build.0 = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|x64.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|x64.Build.0 = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|x86.ActiveCfg = Release|Any CPU - {E14C7032-A542-4A5A-AB5B-62E25F2B105C}.Release|x86.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|Any CPU.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|ARM.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|ARM.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|iPhone.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|x64.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|x64.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|x86.ActiveCfg = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Debug|x86.Build.0 = Debug|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|Any CPU.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|Any CPU.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|ARM.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|ARM.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|iPhone.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|iPhone.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|x64.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|x64.Build.0 = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|x86.ActiveCfg = Release|Any CPU + {907F4283-1EA9-41FE-B482-9BD2A72F0850}.Release|x86.Build.0 = Release|Any CPU + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|ARM.Build.0 = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|iPhone.ActiveCfg = Debug|iPhone + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|iPhone.Build.0 = Debug|iPhone + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Debug|x86.Build.0 = Debug|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|ARM.Build.0 = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|iPhone.ActiveCfg = Release|iPhone + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|iPhone.Build.0 = Release|iPhone + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|x64.Build.0 = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {CE887906-33F1-4B47-8E8F-C6A7A60D1372}.Release|x86.Build.0 = Release|iPhoneSimulator + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|ARM.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|ARM.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|iPhone.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x64.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x64.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x86.ActiveCfg = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|x86.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|Any CPU.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|Any CPU.Build.0 = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|ARM.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|ARM.Build.0 = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|iPhone.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|iPhone.Build.0 = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x64.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x64.Build.0 = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x86.ActiveCfg = Release|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Release|x86.Build.0 = Release|Any CPU {12EFED5B-E168-401E-9BCB-4FBB928720AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {12EFED5B-E168-401E-9BCB-4FBB928720AB}.Debug|Any CPU.Build.0 = Debug|Any CPU {12EFED5B-E168-401E-9BCB-4FBB928720AB}.Debug|ARM.ActiveCfg = Debug|Any CPU @@ -699,6 +701,30 @@ Global {A9B5E8CA-E1B8-47E4-89D4-8A55327F4121}.Release|x64.Build.0 = Release|Any CPU {A9B5E8CA-E1B8-47E4-89D4-8A55327F4121}.Release|x86.ActiveCfg = Release|Any CPU {A9B5E8CA-E1B8-47E4-89D4-8A55327F4121}.Release|x86.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|Any CPU.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|ARM.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|ARM.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|iPhone.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|iPhone.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|x64.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|x64.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|x86.ActiveCfg = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Debug|x86.Build.0 = Debug|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|Any CPU.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|Any CPU.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|ARM.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|ARM.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|iPhone.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|iPhone.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|iPhoneSimulator.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|x64.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|x64.Build.0 = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|x86.ActiveCfg = Release|Any CPU + {D08C71CE-0F5B-4855-A77C-58062A5ECB78}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -717,29 +743,30 @@ Global {80B9697D-0C57-40E8-A71A-F5E81C7BF467} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {56029D1A-0AF6-4535-9D6A-CD5CD61325C6} = {A25317DE-BB3A-47CC-8E65-F96C9B6AD984} {2AC1DA0E-2B6E-4DBA-A73F-6784BA0A7DB4} = {50F058DF-2B41-403C-BB73-8B4180D1CF39} - {EEB44902-3249-4945-8ACA-125912E6F2F5} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} - {E14C7032-A542-4A5A-AB5B-62E25F2B105C} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} - {12EFED5B-E168-401E-9BCB-4FBB928720AB} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} - {B4C6AD4A-DA91-4171-90D8-0F46378EAEBE} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} - {7EFF9E5C-5E74-469B-8DB7-C25C9AF0444E} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} + {3A6CC342-40D0-4487-9964-DDAEBA628199} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {7174D68E-E76D-4A4F-9F9A-601F5FB2DB65} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51} {C04E5F74-83F0-4A2F-981D-A3442B083F40} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51} {FAD8E779-25DD-4AF1-BEB0-4B8D9696ACAD} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51} {218C6795-AA18-4861-8613-D022C0C53628} = {4FF9AAE6-210E-41F0-A5E1-8D7C4A864F51} {90616AF5-9024-4054-B40B-9A82F8F4DC83} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} {BECF4F60-9741-49A6-BD79-D59664C2682E} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} - {197FBF65-C978-4FB4-BB6F-F7D76C320218} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} - {B7340A22-2989-45EE-B05D-0682B5C43897} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} + {907F4283-1EA9-41FE-B482-9BD2A72F0850} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} + {CE887906-33F1-4B47-8E8F-C6A7A60D1372} = {9F4D5A18-5A85-4031-A73A-472BEF405A18} + {10725A22-B22F-46AB-B5C4-7BC505A1E74A} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} + {12EFED5B-E168-401E-9BCB-4FBB928720AB} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} + {B4C6AD4A-DA91-4171-90D8-0F46378EAEBE} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {5466EA2B-2810-4E79-8DA4-BE580832B568} = {CC933D98-B002-4306-89C4-B1905658D9DE} {641367F9-5149-4E5D-9459-B19DAFC426A8} = {CC933D98-B002-4306-89C4-B1905658D9DE} + {7EFF9E5C-5E74-469B-8DB7-C25C9AF0444E} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {A9B5E8CA-E1B8-47E4-89D4-8A55327F4121} = {A25317DE-BB3A-47CC-8E65-F96C9B6AD984} + {D08C71CE-0F5B-4855-A77C-58062A5ECB78} = {50F058DF-2B41-403C-BB73-8B4180D1CF39} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BE5E0028-B74D-4BE1-B1DA-5FFCC8469C41} EndGlobalSection GlobalSection(SharedMSBuildProjectFiles) = preSolution + Realm\Realm.Weaver\Realm.Weaver.projitems*{2ac1da0e-2b6e-4dba-a73f-6784ba0a7db4}*SharedItemsImports = 5 Realm\Realm.Weaver\Realm.Weaver.projitems*{89fdb2a1-6fc0-4604-9aeb-8b8dd8a88dec}*SharedItemsImports = 13 Realm\Realm.Weaver\Realm.Weaver.projitems*{9322b1d0-b3f7-4d6a-9947-2fc11d3161a0}*SharedItemsImports = 5 - Realm\Realm.Weaver\Realm.Weaver.projitems*{cdab5fee-cc5d-4efa-807f-f1b974047be7}*SharedItemsImports = 5 EndGlobalSection EndGlobal From 4114fbc04ce9d4bd981ca36ee1053ec9f61cef29 Mon Sep 17 00:00:00 2001 From: nirinchev Date: Wed, 17 May 2023 18:41:42 +0200 Subject: [PATCH 05/33] Update Core --- Realm/Realm/Handles/AppHandle.cs | 4 ---- wrappers/realm-core | 2 +- wrappers/src/app_cs.cpp | 20 -------------------- 3 files changed, 1 insertion(+), 25 deletions(-) diff --git a/Realm/Realm/Handles/AppHandle.cs b/Realm/Realm/Handles/AppHandle.cs index 01929a23d2..b31e3bb20c 100644 --- a/Realm/Realm/Handles/AppHandle.cs +++ b/Realm/Realm/Handles/AppHandle.cs @@ -53,7 +53,6 @@ public static extern IntPtr initialize( [MarshalAs(UnmanagedType.LPWStr)] string framework_version, IntPtr framework_version_len, [MarshalAs(UnmanagedType.LPWStr)] string sdk_version, IntPtr sdk_version_len, [MarshalAs(UnmanagedType.LPWStr)] string platform_version, IntPtr platform_version_len, - [MarshalAs(UnmanagedType.LPWStr)] string cpu_arch, IntPtr cpu_arch_len, [MarshalAs(UnmanagedType.LPWStr)] string device_name, IntPtr device_name_len, [MarshalAs(UnmanagedType.LPWStr)] string device_version, IntPtr device_version_len, UserCallback user_callback, VoidTaskCallback void_callback, StringCallback string_callback, ApiKeysCallback api_keys_callback); @@ -172,8 +171,6 @@ public static void Initialize() platformVersion += $" {Environment.OSVersion.ServicePack}"; } - var cpuArch = RuntimeInformation.ProcessArchitecture.ToString(); - var deviceName = Platform.DeviceInfo.DeviceName; var deviceVersion = Platform.DeviceInfo.DeviceVersion; @@ -182,7 +179,6 @@ public static void Initialize() frameworkVersion, frameworkVersion.IntPtrLength(), sdkVersion, sdkVersion.IntPtrLength(), platformVersion, platformVersion.IntPtrLength(), - cpuArch, cpuArch.IntPtrLength(), deviceName, deviceName.IntPtrLength(), deviceVersion, deviceVersion.IntPtrLength(), userLogin, taskCallback, stringCallback, apiKeysCallback); diff --git a/wrappers/realm-core b/wrappers/realm-core index 3ceabb4134..df5d11ca0a 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit 3ceabb413494a3f6101463d9bcf4459451c24369 +Subproject commit df5d11ca0a5aa731a110813962ba1f731946fe26 diff --git a/wrappers/src/app_cs.cpp b/wrappers/src/app_cs.cpp index 5ef4493be4..207a25ad49 100644 --- a/wrappers/src/app_cs.cpp +++ b/wrappers/src/app_cs.cpp @@ -49,9 +49,7 @@ namespace realm { std::string s_framework; std::string s_framework_version; std::string s_sdk_version; - std::string s_platform; std::string s_platform_version; - std::string s_cpu_arch; std::string s_device_name; std::string s_device_version; @@ -103,7 +101,6 @@ extern "C" { uint16_t* framework_version, size_t framework_version_len, uint16_t* sdk_version, size_t sdk_version_len, uint16_t* platform_version, size_t platform_version_len, - uint16_t* cpu_arch, size_t cpu_arch_len, uint16_t* device_name, size_t device_name_len, uint16_t* device_version, size_t device_version_len, UserCallbackT* user_callback, @@ -115,24 +112,9 @@ extern "C" { s_framework_version = Utf16StringAccessor(framework_version, framework_version_len); s_sdk_version = Utf16StringAccessor(sdk_version, sdk_version_len); s_platform_version = Utf16StringAccessor(platform_version, platform_version_len); - s_cpu_arch = Utf16StringAccessor(cpu_arch, cpu_arch_len); s_device_name = Utf16StringAccessor(device_name, device_name_len); s_device_version = Utf16StringAccessor(device_version, device_version_len); -#if REALM_ANDROID - s_platform = "Android"; -#elif REALM_WINDOWS - s_platform = "Windows"; -#elif REALM_UWP - s_platform = "UWP"; -#elif REALM_IOS - s_platform = "iOS"; -#elif REALM_PLATFORM_APPLE - s_platform = "macOS"; -#else - s_platform = "Linux"; -#endif - s_user_callback = wrap_managed_callback(user_callback); s_void_callback = wrap_managed_callback(void_callback); s_string_callback = wrap_managed_callback(string_callback); @@ -151,9 +133,7 @@ extern "C" { config.device_info.framework_version = s_framework_version; config.device_info.sdk_version = s_sdk_version; config.device_info.sdk = "Dotnet"; - config.device_info.platform = s_platform; config.device_info.platform_version = s_platform_version; - config.device_info.cpu_arch = s_cpu_arch; config.device_info.device_name = s_device_name; config.device_info.device_version = s_device_version; From af5565ed8a3ef61b404c93aab7b6decc66b9f15c Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 00:49:53 +0200 Subject: [PATCH 06/33] Wire up most of the logic --- Realm - Windows.sln | 52 ++++++++++++++++++ Realm/AssemblyInfo.props | 2 +- .../{ => Android}/DeviceInfo.android.cs | 0 .../Apple/DeviceInfo.ios.cs | 29 ++++++++++ .../{ => Apple}/DeviceInfo.mac.cs | 7 +-- .../NativeHelpers.ios.mac.cs} | 53 ++++++++----------- ...AssemblyInfo.cs => AssemblyInfo.shared.cs} | 1 + .../Realm.PlatformHelpers.csproj | 41 +++++++------- .../UWP/DeviceInfo.uwp.cs | 31 +++++++++++ .../{ => fallback}/DeviceInfo.netstandard.cs | 2 +- Realm/Realm/Handles/SharedRealmHandle.cs | 13 +++++ Realm/Realm/Realm.csproj | 6 +-- Tests/Realm.Tests/Sync/AppTests.cs | 37 +++++++++++++ Tests/Tests.Android/Tests.Android.csproj | 10 ++-- Tests/Tests.UWP/Tests.UWP.csproj | 4 ++ .../Tests.XamarinMac/Tests.XamarinMac.csproj | 4 ++ .../Tests.XamarinTVOS.csproj | 4 ++ Tests/Tests.iOS/Tests.iOS.csproj | 2 - wrappers/README.md | 35 ++++++------ wrappers/realm-core | 2 +- wrappers/src/shared_realm_cs.cpp | 6 +++ 21 files changed, 258 insertions(+), 83 deletions(-) rename Realm/Realm.PlatformHelpers/{ => Android}/DeviceInfo.android.cs (100%) create mode 100644 Realm/Realm.PlatformHelpers/Apple/DeviceInfo.ios.cs rename Realm/Realm.PlatformHelpers/{ => Apple}/DeviceInfo.mac.cs (84%) rename Realm/Realm.PlatformHelpers/{DeviceInfo.ios.cs => Apple/NativeHelpers.ios.mac.cs} (54%) rename Realm/Realm.PlatformHelpers/{AssemblyInfo.cs => AssemblyInfo.shared.cs} (95%) create mode 100644 Realm/Realm.PlatformHelpers/UWP/DeviceInfo.uwp.cs rename Realm/Realm.PlatformHelpers/{ => fallback}/DeviceInfo.netstandard.cs (95%) diff --git a/Realm - Windows.sln b/Realm - Windows.sln index a07ecc6318..24110f6aac 100644 --- a/Realm - Windows.sln +++ b/Realm - Windows.sln @@ -91,6 +91,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DeployApps", "Tools\DeployA EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Realm.PlatformHelpers", "Realm\Realm.PlatformHelpers\Realm.PlatformHelpers.csproj", "{536C3309-F848-4485-ABF3-56DCD9C9F9E8}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tests.XamarinTVOS", "Tests\Tests.XamarinTVOS\Tests.XamarinTVOS.csproj", "{80B9697D-0C57-40E8-A71A-F5E81C7BF467}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -289,6 +291,7 @@ Global {CDAB5FEE-CC5D-4EFA-807F-F1B974047BE7}.RelWithDebInfo|x86.Build.0 = Release|Any CPU {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|Any CPU.Build.0 = Debug|Any CPU + {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|ARM.ActiveCfg = Debug|Any CPU {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|ARM.Build.0 = Debug|Any CPU {10725A22-B22F-46AB-B5C4-7BC505A1E74A}.Debug|iPhone.ActiveCfg = Debug|Any CPU @@ -1423,6 +1426,54 @@ Global {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x64.Build.0 = Release|Any CPU {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x86.ActiveCfg = Release|Any CPU {536C3309-F848-4485-ABF3-56DCD9C9F9E8}.RelWithDebInfo|x86.Build.0 = Release|Any CPU + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|ARM.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|ARM.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|iPhone.ActiveCfg = Debug|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|iPhone.Build.0 = Debug|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|x64.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|x64.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|x86.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Debug|x86.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|Any CPU.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|Any CPU.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|ARM.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|ARM.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|iPhone.ActiveCfg = Debug|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|iPhone.Build.0 = Debug|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|x64.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|x64.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|x86.ActiveCfg = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.MinSizeRel|x86.Build.0 = Debug|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|Any CPU.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|ARM.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|ARM.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|iPhone.ActiveCfg = Release|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|iPhone.Build.0 = Release|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|x64.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|x64.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|x86.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.Release|x86.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|Any CPU.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|Any CPU.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|ARM.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|ARM.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|iPhone.ActiveCfg = Release|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|iPhone.Build.0 = Release|iPhone + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|iPhoneSimulator.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|x64.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|x64.Build.0 = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|x86.ActiveCfg = Release|iPhoneSimulator + {80B9697D-0C57-40E8-A71A-F5E81C7BF467}.RelWithDebInfo|x86.Build.0 = Release|iPhoneSimulator EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1457,6 +1508,7 @@ Global {C84EBA8B-5F7F-4519-BB34-EDE93E275D66} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} {10026D09-FC37-48B3-AAEA-B322AA6D89CE} = {073F6C2D-FECB-41E3-BEA3-1685FAA580DB} {536C3309-F848-4485-ABF3-56DCD9C9F9E8} = {50F058DF-2B41-403C-BB73-8B4180D1CF39} + {80B9697D-0C57-40E8-A71A-F5E81C7BF467} = {D10BE048-9C20-4B8B-BE5B-48CC55F8BB07} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BE5E0028-B74D-4BE1-B1DA-5FFCC8469C41} diff --git a/Realm/AssemblyInfo.props b/Realm/AssemblyInfo.props index 61f9966f5c..e9033fe7f8 100644 --- a/Realm/AssemblyInfo.props +++ b/Realm/AssemblyInfo.props @@ -1,6 +1,6 @@ - Realm .NET + Realm .NET 11.0.0 Realm is a mobile database: a replacement for SQLite Realm Inc. diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.android.cs b/Realm/Realm.PlatformHelpers/Android/DeviceInfo.android.cs similarity index 100% rename from Realm/Realm.PlatformHelpers/DeviceInfo.android.cs rename to Realm/Realm.PlatformHelpers/Android/DeviceInfo.android.cs diff --git a/Realm/Realm.PlatformHelpers/Apple/DeviceInfo.ios.cs b/Realm/Realm.PlatformHelpers/Apple/DeviceInfo.ios.cs new file mode 100644 index 0000000000..265523dc90 --- /dev/null +++ b/Realm/Realm.PlatformHelpers/Apple/DeviceInfo.ios.cs @@ -0,0 +1,29 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using static Realms.PlatformHelpers.Platform; + +namespace Realms.PlatformHelpers +{ + internal class DeviceInfo : IDeviceInfo + { + public string DeviceName => UIKit.UIDevice.CurrentDevice.Model; + + public string DeviceVersion => NativeHelpers.GetSysctlProperty("hw.machine") ?? Unknown; + } +} diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs b/Realm/Realm.PlatformHelpers/Apple/DeviceInfo.mac.cs similarity index 84% rename from Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs rename to Realm/Realm.PlatformHelpers/Apple/DeviceInfo.mac.cs index 2a18bf88d8..61bbded0b3 100644 --- a/Realm/Realm.PlatformHelpers/DeviceInfo.mac.cs +++ b/Realm/Realm.PlatformHelpers/Apple/DeviceInfo.mac.cs @@ -16,17 +16,14 @@ // //////////////////////////////////////////////////////////////////////////// -using System; -using System.Runtime.InteropServices; -using ObjCRuntime; using static Realms.PlatformHelpers.Platform; namespace Realms.PlatformHelpers { internal class DeviceInfo : IDeviceInfo { - public string DeviceName => Unknown; + public string DeviceName => "Apple"; - public string DeviceVersion => Unknown; + public string DeviceVersion => NativeHelpers.GetSysctlProperty("hw.model") ?? Unknown; } } diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs b/Realm/Realm.PlatformHelpers/Apple/NativeHelpers.ios.mac.cs similarity index 54% rename from Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs rename to Realm/Realm.PlatformHelpers/Apple/NativeHelpers.ios.mac.cs index 89e5253254..da44c819c3 100644 --- a/Realm/Realm.PlatformHelpers/DeviceInfo.ios.cs +++ b/Realm/Realm.PlatformHelpers/Apple/NativeHelpers.ios.mac.cs @@ -19,56 +19,47 @@ using System; using System.Runtime.InteropServices; using ObjCRuntime; -using static Realms.PlatformHelpers.Platform; namespace Realms.PlatformHelpers { - internal class DeviceInfo : IDeviceInfo + internal static class NativeHelpers { [DllImport(Constants.SystemLibrary, EntryPoint = "sysctlbyname")] internal static extern int SysctlByName([MarshalAs(UnmanagedType.LPStr)] string property, IntPtr output, IntPtr oldLen, IntPtr newp, uint newlen); - internal static string GetSystemLibraryProperty(string property) + internal static string? GetSysctlProperty(string property) { var lengthPtr = Marshal.AllocHGlobal(sizeof(int)); - SysctlByName(property, IntPtr.Zero, lengthPtr, IntPtr.Zero, 0); - var propertyLength = Marshal.ReadInt32(lengthPtr); - - if (propertyLength == 0) + IntPtr? valuePtr = null; + try { - Marshal.FreeHGlobal(lengthPtr); - throw new InvalidOperationException("Unable to read length of property."); - } - - var valuePtr = Marshal.AllocHGlobal(propertyLength); - SysctlByName(property, valuePtr, lengthPtr, IntPtr.Zero, 0); + SysctlByName(property, IntPtr.Zero, lengthPtr, IntPtr.Zero, 0); - var returnValue = Marshal.PtrToStringAnsi(valuePtr); + var propertyLength = Marshal.ReadInt32(lengthPtr); - Marshal.FreeHGlobal(lengthPtr); - Marshal.FreeHGlobal(valuePtr); + if (propertyLength > 0) + { + valuePtr = Marshal.AllocHGlobal(propertyLength); + SysctlByName(property, valuePtr.Value, lengthPtr, IntPtr.Zero, 0); - return returnValue!; - } - - private static readonly Lazy _version = new(FindVersion); - - private static string FindVersion() - { - try - { - return GetSystemLibraryProperty("hw.machine")!; + return Marshal.PtrToStringAnsi(valuePtr.Value); + } } catch { } + finally + { + Marshal.FreeHGlobal(lengthPtr); - return Unknown; - } - - public string DeviceName => UIKit.UIDevice.CurrentDevice.Model; + if (valuePtr.HasValue) + { + Marshal.FreeHGlobal(valuePtr.Value); + } + } - public string DeviceVersion => _version.Value; + return null; + } } } diff --git a/Realm/Realm.PlatformHelpers/AssemblyInfo.cs b/Realm/Realm.PlatformHelpers/AssemblyInfo.shared.cs similarity index 95% rename from Realm/Realm.PlatformHelpers/AssemblyInfo.cs rename to Realm/Realm.PlatformHelpers/AssemblyInfo.shared.cs index 4be70d1b5b..d73a6b33aa 100644 --- a/Realm/Realm.PlatformHelpers/AssemblyInfo.cs +++ b/Realm/Realm.PlatformHelpers/AssemblyInfo.shared.cs @@ -19,4 +19,5 @@ using System.Runtime.CompilerServices; [assembly: InternalsVisibleTo("Realm")] +[assembly: InternalsVisibleTo("Realm.Tests")] [assembly: InternalsVisibleTo("Realm.UnityUtils")] diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj index acbae11453..2da59b30cc 100644 --- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -1,9 +1,23 @@  + Realm Platform Helpers + + A set of platform-specific helpers used in conjunction with Realm. This package is always referenced by the main Realm package + and should never be added directly to your project. + + netstandard2.0 - $(TargetFrameworks);net6.0-ios;net6.0-android - $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 + + + $(TargetFrameworks);net6.0-ios;net6.0-android + + + + + $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 + + $(TargetFrameworks);uap10.0.19041; false 9.0 enable @@ -18,37 +32,28 @@ - + Windows Desktop Extensions for the UWP - + Windows Mobile Extensions for the UWP - - - - - - + + + - - - - - - - - + + \ No newline at end of file diff --git a/Realm/Realm.PlatformHelpers/UWP/DeviceInfo.uwp.cs b/Realm/Realm.PlatformHelpers/UWP/DeviceInfo.uwp.cs new file mode 100644 index 0000000000..0a194bf3ee --- /dev/null +++ b/Realm/Realm.PlatformHelpers/UWP/DeviceInfo.uwp.cs @@ -0,0 +1,31 @@ +//////////////////////////////////////////////////////////////////////////// +// +// Copyright 2023 Realm Inc. +// +// Licensed under the Apache License, Version 2.0 (the "License") +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// +//////////////////////////////////////////////////////////////////////////// + +using Windows.Security.ExchangeActiveSyncProvisioning; + +namespace Realms.PlatformHelpers +{ + internal class DeviceInfo : IDeviceInfo + { + private static EasClientDeviceInformation deviceInfo = new(); + + public string DeviceName => deviceInfo.SystemManufacturer; + + public string DeviceVersion => deviceInfo.SystemProductName; + } +} diff --git a/Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs b/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs similarity index 95% rename from Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs rename to Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs index a16d01e16f..1d12701caa 100644 --- a/Realm/Realm.PlatformHelpers/DeviceInfo.netstandard.cs +++ b/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs @@ -18,7 +18,7 @@ namespace Realms.PlatformHelpers { - public class DeviceInfo : IDeviceInfo + internal class DeviceInfo : IDeviceInfo { public string DeviceName => "Unknown"; diff --git a/Realm/Realm/Handles/SharedRealmHandle.cs b/Realm/Realm/Handles/SharedRealmHandle.cs index cb5753c328..f12ba8e606 100644 --- a/Realm/Realm/Handles/SharedRealmHandle.cs +++ b/Realm/Realm/Handles/SharedRealmHandle.cs @@ -237,6 +237,9 @@ public static extern void rename_property(SharedRealmHandle sharedRealm, [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_set_log_level", CallingConvention = CallingConvention.Cdecl)] public static extern bool set_log_level(LogLevel level); + [DllImport(InteropConfig.DLL_NAME, EntryPoint = "shared_realm_get_operating_system", CallingConvention = CallingConvention.Cdecl)] + public static extern IntPtr get_operating_system(IntPtr buffer, IntPtr buffer_length); + #pragma warning restore SA1121 // Use built-in type alias #pragma warning restore IDE0049 // Use built-in type alias } @@ -754,6 +757,16 @@ public async Task RefreshAsync() } } + public static string GetNativeLibraryOS() + { + return MarshalHelpers.GetString((IntPtr buffer, IntPtr length, out bool isNull, out NativeException ex) => + { + isNull = false; + ex = default; + return NativeMethods.get_operating_system(buffer, length); + })!; + } + [MonoPInvokeCallback(typeof(NativeMethods.GetNativeSchemaCallback))] private static void GetNativeSchema(Native.Schema schema, IntPtr managedCallbackPtr) { diff --git a/Realm/Realm/Realm.csproj b/Realm/Realm/Realm.csproj index 22cf3b08ed..28af1fedf6 100644 --- a/Realm/Realm/Realm.csproj +++ b/Realm/Realm/Realm.csproj @@ -190,8 +190,8 @@ - - + + @@ -199,7 +199,7 @@ -Realm - {536c3309-f848-4485-abf3-56dcd9c9f9e8} + {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} Realm.PlatformHelpers - + lib\x86\librealm-wrappers.so PreserveNewest - + lib\x86_64\librealm-wrappers.so PreserveNewest - + lib\arm64-v8a\librealm-wrappers.so PreserveNewest - + lib\armeabi-v7a\librealm-wrappers.so PreserveNewest diff --git a/Tests/Tests.UWP/Tests.UWP.csproj b/Tests/Tests.UWP/Tests.UWP.csproj index 64b6d4260f..27654f0d2e 100644 --- a/Tests/Tests.UWP/Tests.UWP.csproj +++ b/Tests/Tests.UWP/Tests.UWP.csproj @@ -206,6 +206,10 @@ {C0DB0E07-4FBC-44D1-8E84-A074497385C6} Realm + + {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} + Realm.PlatformHelpers + diff --git a/Tests/Tests.XamarinMac/Tests.XamarinMac.csproj b/Tests/Tests.XamarinMac/Tests.XamarinMac.csproj index 6a4c5f7646..cd8a517c7f 100644 --- a/Tests/Tests.XamarinMac/Tests.XamarinMac.csproj +++ b/Tests/Tests.XamarinMac/Tests.XamarinMac.csproj @@ -94,6 +94,10 @@ + + {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} + Realm.PlatformHelpers + Dynamic False diff --git a/Tests/Tests.XamarinTVOS/Tests.XamarinTVOS.csproj b/Tests/Tests.XamarinTVOS/Tests.XamarinTVOS.csproj index a52ebc61be..abdc352085 100644 --- a/Tests/Tests.XamarinTVOS/Tests.XamarinTVOS.csproj +++ b/Tests/Tests.XamarinTVOS/Tests.XamarinTVOS.csproj @@ -173,6 +173,10 @@ + + {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} + Realm.PlatformHelpers + Framework False diff --git a/Tests/Tests.iOS/Tests.iOS.csproj b/Tests/Tests.iOS/Tests.iOS.csproj index 481bd5581b..d5b02bc101 100644 --- a/Tests/Tests.iOS/Tests.iOS.csproj +++ b/Tests/Tests.iOS/Tests.iOS.csproj @@ -166,8 +166,6 @@ {4C9BE4FA-9CB2-4091-B86A-4EC557A78991} Realm.PlatformHelpers - Xamarin.iOS10 - $(Platform) diff --git a/wrappers/README.md b/wrappers/README.md index 0b7c4ed211..aa03370655 100644 --- a/wrappers/README.md +++ b/wrappers/README.md @@ -1,5 +1,4 @@ -About Wrappers -============== +# About Wrappers Wrappers contains all our native code and its interfaces to C#. @@ -7,8 +6,7 @@ It has a reference to the [Realm Core](https://github.com/realm/realm-core) repo Wrappers also contains a small amount of C++ code which provides the mapping from C# to the Core logic. -Downloading Realm Core ------------------------ +## Downloading Realm Core ### Cloning @@ -27,22 +25,29 @@ If you downloaded a zip of the source, you need to go back to github to identify 1. Download a zip using the GitHub download button in that tree, eg `realm-core-fb2ed6aa0073be4cb0cd059cae407744ee883b77.zip` 1. Unpack its contents into `wrappers/src/realm-core` -Building iOS, tvOS, and macCatalyst wrappers on macOS ------------------------------------------- +## Building iOS, tvOS, and macCatalyst wrappers on macOS Building for iOS required cmake and zlib installed. In case you do not have them installed, you can do it with `brew install cmake zlib`. You can use `build-apple-platform.ps1` to build for iOS, tvOS, and macCatalyst, specifying one or more of the available platforms, `Device`, `Simulator` or `Catalayst`, and either `Debug` or `Release` configuration. -Building Android wrappers -------------- +## Building Android wrappers Building for Android uses CMake with a toolchain file. You can either configure CMake with an Android toolchain file manually, or build with `build-android.sh`. By default it will build for armeabi-v7a, arm64-v8a, x86, and x86_64. You can specify a single ABI to build by passing `--arch=$ABI`. You can also choose a build configuration by passing `--configuration=$CONFIG`. The script also accepts CMake arguments like `-GNinja`. You need to have the Android NDK installed, version r10e, and set an environment variable called `ANDROID_NDK_HOME` pointing to its location. -Building Windows wrappers -------------- +### Building in Docker + +If you don't have NDK setup or don't want to set up paths, you can build the wrappers in docker. You can use the [CircleCI android docker image](https://hub.docker.com/r/cimg/android) and build in it: + +```ps1 +docker pull cimg/android:2023.05.1-ndk +docker run --rm -it -v ${pwd}:/source cimg/android:2023.05.1-ndk /bin/bash +/source/build-android.sh -DCMAKE_TOOLCHAIN_FILE=$ANDROID_NDK_HOME/build/cmake/android.toolchain.cmake +``` + +## Building Windows wrappers You need Visual Studio 2017 (or later) with the `C++ Universal Windows Platform tools` and `Visual C++ tools for CMake` components as well as a version of the Windows SDK installed. @@ -54,15 +59,13 @@ Valid Windows platforms (architectures) are `Win32`, `x64`, and `ARM`. You can s You can find the CMake-generated Visual Studio project files in `cmake\$Target\$Configuration-$Platform` and use them for debugging. -Building macOS wrappers -------------- +## Building macOS wrappers You need Xcode 13 (or later) installed. * To build a universal (x64 and Arm64) binary, run `./build-macos.sh -c=Debug/Release`. -Building Linux wrappers -------------- +## Building Linux wrappers `build-linux.sh` automates configuring and building wrappers with CMake. It accepts CMake arguments like `-GNinja`. @@ -73,8 +76,8 @@ Building Linux wrappers * `docker build . -f debian-multiarch-arm.Dockerfile -t realm-dotnet/wrappers-arm` * `docker run --rm -v $(pwd):/source realm-dotnet/wrappers-arm -a=arm64/arm` -General Notes -------------- +## General Notes + All builds steps download the required realm components (core and sync) automatically. **Note** if you have changed the wrappers source and added, deleted or renamed files, you need to update `src/CMakeLists.txt` for builds to work. diff --git a/wrappers/realm-core b/wrappers/realm-core index df5d11ca0a..1b80764cb2 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit df5d11ca0a5aa731a110813962ba1f731946fe26 +Subproject commit 1b80764cb287ffe708d652e9eee188e9a4f73824 diff --git a/wrappers/src/shared_realm_cs.cpp b/wrappers/src/shared_realm_cs.cpp index 872b44d84d..de0b8ed86c 100644 --- a/wrappers/src/shared_realm_cs.cpp +++ b/wrappers/src/shared_realm_cs.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include @@ -839,5 +840,10 @@ REALM_EXPORT bool shared_realm_refresh_async(SharedRealm& realm, void* managed_t }); } +REALM_EXPORT size_t shared_realm_get_operating_system(uint16_t* buffer, size_t buffer_length) +{ + std::string platform = realm::util::get_library_platform(); + return stringdata_to_csharpstringbuffer(platform, buffer, buffer_length); } +} From 87e50ab26921bdb6762661623ac024ae679da2d0 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 00:58:11 +0200 Subject: [PATCH 07/33] Unity implementation --- Realm/Realm.PlatformHelpers/Platform.shared.cs | 2 +- Realm/Realm.UnityUtils/DeviceInfo.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Realm/Realm.PlatformHelpers/Platform.shared.cs b/Realm/Realm.PlatformHelpers/Platform.shared.cs index c6daa6b601..5220c6f2ee 100644 --- a/Realm/Realm.PlatformHelpers/Platform.shared.cs +++ b/Realm/Realm.PlatformHelpers/Platform.shared.cs @@ -22,7 +22,7 @@ namespace Realms.PlatformHelpers { internal static class Platform { - public const string Unknown = "unknown"; + public const string Unknown = ""; private static IDeviceInfo? _deviceInfo; diff --git a/Realm/Realm.UnityUtils/DeviceInfo.cs b/Realm/Realm.UnityUtils/DeviceInfo.cs index e36abbc78d..6692f3bf9d 100644 --- a/Realm/Realm.UnityUtils/DeviceInfo.cs +++ b/Realm/Realm.UnityUtils/DeviceInfo.cs @@ -23,6 +23,8 @@ namespace Realm.UnityUtils { internal class UnityDeviceInfo : IDeviceInfo { - public string DeviceName => SystemInfo.deviceName; + public string DeviceName => Platform.Unknown; + + public string DeviceVersion => SystemInfo.deviceModel; } } From 8464e393b41ea24b3ab8697cc777cb74f379f071 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 01:11:54 +0200 Subject: [PATCH 08/33] Setup CI --- .github/templates/build-unity.yml | 3 +-- .github/templates/common.lib.yml | 15 +++++++++++++-- .github/templates/main.yml | 17 ++++------------- .github/templates/publish-release.yml | 1 + .github/templates/test-android.yml | 4 ++-- .github/templates/test-ios.yml | 4 ++-- .github/templates/test-macos.yml | 4 ++-- .github/templates/test-tvos.yml | 2 +- .github/templates/test-woven-classes.yml | 4 ++-- .github/templates/test.lib.yml | 12 +----------- .github/workflows/build-packages.yml | 9 +++++++++ .github/workflows/build-unity.yml | 5 +++++ .github/workflows/codeql.yml | 2 ++ .github/workflows/main.yml | 17 +++++++++++++++++ .github/workflows/publish-prerelease.yml | 2 ++ .github/workflows/publish-release.yml | 2 ++ .github/workflows/test-android.yml | 10 ++++++++++ .github/workflows/test-ios.yml | 10 ++++++++++ .github/workflows/test-macos.yml | 10 ++++++++++ .github/workflows/test-net-core.yml | 5 +++++ .github/workflows/test-net-framework.yml | 5 +++++ .github/workflows/test-tvos.yml | 5 +++++ .github/workflows/test-uwp-managed.yml | 5 +++++ .github/workflows/test-woven-classes.yml | 5 +++++ 24 files changed, 121 insertions(+), 37 deletions(-) diff --git a/.github/templates/build-unity.yml b/.github/templates/build-unity.yml index 010eb61986..789932c070 100644 --- a/.github/templates/build-unity.yml +++ b/.github/templates/build-unity.yml @@ -1,6 +1,5 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "nugetPackages", "actionDownloadArtifact") -#@ load("test.lib.yml", "fetchPackageArtifacts") +#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "nugetPackages", "actionDownloadArtifact", "fetchPackageArtifacts") #@ unityPkgName = "io.realm.unity-${{ inputs.version }}.tgz" diff --git a/.github/templates/common.lib.yml b/.github/templates/common.lib.yml index d789125ab4..1cae5f11bc 100644 --- a/.github/templates/common.lib.yml +++ b/.github/templates/common.lib.yml @@ -1,7 +1,8 @@ #@ load("@ytt:template", "template") #@ configuration = "Release" -#@ nugetPackages = [ 'Realm', 'Realm.UnityUtils', 'Realm.UnityWeaver' ] +#@ publishedPackages = [ 'Realm', 'Realm.PlatformHelpers'] +#@ nugetPackages = publishedPackages + [ 'Realm.UnityUtils', 'Realm.UnityWeaver' ] #@ actionCheckout = "actions/checkout@v3" #@ actionCache = "nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8" #@ actionUploadArtifact = "actions/upload-artifact@v3" @@ -132,7 +133,7 @@ with: - name: Install sleet run: dotnet tool install -g sleet - #@ template.replace(configureAWSCredentials("NUGET_S3_ACCESS_KEY", "NUGET_S3_SECRET_KEY")) -#@ for pkg in [ "Realm" ]: +#@ for pkg in publishedPackages: #@ pkg = pkg + ".${{ " + versionExpression + " }}" #@ pkgPath = "" if expectShortPath else pkg + "/" - name: #@ "NuGet Publish " + pkg @@ -215,4 +216,14 @@ with: run: #@ "npm publish ${{ github.workspace }}/Realm/packages/" + pkgPath + package + " --tag " + tag env: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} +#@ end +--- +#@ def fetchPackageArtifacts(versionExpression = "inputs.version", packages = publishedPackages): +#@ for pkg in packages: + - name: #@ "Fetch " + pkg + uses: #@ actionDownloadArtifact + with: + name: #@ pkg + ".${{ " + versionExpression + " }}" + path: ${{ github.workspace }}/Realm/packages/ +#@ end #@ end \ No newline at end of file diff --git a/.github/templates/main.yml b/.github/templates/main.yml index f83aadb20e..485eb3bdae 100644 --- a/.github/templates/main.yml +++ b/.github/templates/main.yml @@ -1,17 +1,8 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "uploadPackagesToSleet", "cleanupWorkspace", "dotnetPublish", "actionDownloadArtifact") +#@ load("common.lib.yml", "checkoutCode", "uploadArtifacts", "uploadPackagesToSleet", "cleanupWorkspace", "dotnetPublish", "actionDownloadArtifact", "fetchPackageArtifacts") #@ load("test.lib.yml", "dotnetBuildTests") #@ load("build.lib.yml", "deployBaas", "cleanupBaas", "runTests", "runNetCoreTests", "ignoreSkippedJobsCondition", "buildUnity") -#@ def fetchPackageArtifacts(): -#@ for pkg in [ "Realm" ]: - - name: #@ "Fetch " + pkg - uses: #@ actionDownloadArtifact - with: - name: #@ pkg + ".${{ needs.build-packages.outputs.package_version }}" - path: ${{ github.workspace }}/Realm/packages/ -#@ end -#@ end --- name: main "on": @@ -49,7 +40,7 @@ jobs: if: #@ ignoreSkippedJobsCondition + " && (github.event_name == 'push' || github.event.inputs.publish-prerelease)" steps: - #@ template.replace(checkoutCode(False, False)) - - #@ template.replace(fetchPackageArtifacts()) + - #@ template.replace(fetchPackageArtifacts("needs.build-packages.outputs.package_version")) - #@ template.replace(uploadPackagesToSleet("needs.build-packages.outputs.package_version", True)) _: #@ template.replace(buildUnity()) _: #@ template.replace(runTests(".NET Framework")) @@ -68,7 +59,7 @@ jobs: if: #@ ignoreSkippedJobsCondition steps: - #@ template.replace(checkoutCode()) - - #@ template.replace(fetchPackageArtifacts()) + - #@ template.replace(fetchPackageArtifacts("needs.build-packages.outputs.package_version")) - #@ template.replace(dotnetPublish("Tests/Tests.XUnit", "net6.0", "win-x64", { "RestoreConfigFile": "Tests/Test.NuGet.Config", "UseRealmNupkgsWithVersion": "${{ needs.build-packages.outputs.package_version }}" })) - name: Run Tests run: dotnet test ${{ steps.dotnet-publish.outputs.executable-path }}/Tests.XUnit.dll --logger GitHubActions @@ -85,7 +76,7 @@ jobs: steps: - #@ template.replace(cleanupWorkspace()) - #@ template.replace(checkoutCode()) - - #@ template.replace(fetchPackageArtifacts()) + - #@ template.replace(fetchPackageArtifacts("needs.build-packages.outputs.package_version")) - #@ template.replace(dotnetBuildTests("Tests/Benchmarks/PerformanceTests", "net6.0", "linux-x64", "needs.build-packages.outputs.package_version")) - name: Run the tests run: #@ "${{ steps.dotnet-publish.outputs.executable-path }}/PerformanceTests -f \"*\" --join" diff --git a/.github/templates/publish-release.yml b/.github/templates/publish-release.yml index 2b896e0510..73c8551e61 100644 --- a/.github/templates/publish-release.yml +++ b/.github/templates/publish-release.yml @@ -94,6 +94,7 @@ jobs: - #@ template.replace(downloadAllArtifacts()) - #@ template.replace(readVersionFromPackage()) - #@ template.replace(uploadDocsToS3()) + - #@ template.replace(uploadToNuget("Realm.PlatformHelpers")) - #@ template.replace(uploadToNuget("Realm")) - #@ template.replace(uploadToNpm()) - #@ template.replace(mergeReleasePR()) diff --git a/.github/templates/test-android.yml b/.github/templates/test-android.yml index 2618ad93f9..a65ab321a0 100644 --- a/.github/templates/test-android.yml +++ b/.github/templates/test-android.yml @@ -1,6 +1,6 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "configureAWSCredentials") -#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") +#@ load("common.lib.yml", "checkoutCode", "configureAWSCredentials", "fetchPackageArtifacts") +#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") --- name: test-android diff --git a/.github/templates/test-ios.yml b/.github/templates/test-ios.yml index 3bd433fc64..cddaa2e247 100644 --- a/.github/templates/test-ios.yml +++ b/.github/templates/test-ios.yml @@ -1,6 +1,6 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator") -#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") +#@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator", "fetchPackageArtifacts") +#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") --- name: test-ios diff --git a/.github/templates/test-macos.yml b/.github/templates/test-macos.yml index 38c759e333..aa1172023d 100644 --- a/.github/templates/test-macos.yml +++ b/.github/templates/test-macos.yml @@ -1,6 +1,6 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "configuration") -#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") +#@ load("common.lib.yml", "checkoutCode", "configuration", "fetchPackageArtifacts") +#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") --- name: test-macos diff --git a/.github/templates/test-tvos.yml b/.github/templates/test-tvos.yml index 50faa8bff4..6a4aea1502 100644 --- a/.github/templates/test-tvos.yml +++ b/.github/templates/test-tvos.yml @@ -1,6 +1,6 @@ #@ load("@ytt:template", "template") #@ load("common.lib.yml", "checkoutCode", "configuration", "actionRuniOSSimulator") -#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") +#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "prepareTest") --- name: test-tvos diff --git a/.github/templates/test-woven-classes.yml b/.github/templates/test-woven-classes.yml index 0f70b6779f..ab33fb2a12 100644 --- a/.github/templates/test-woven-classes.yml +++ b/.github/templates/test-woven-classes.yml @@ -1,6 +1,6 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode") -#@ load("test.lib.yml", "fetchPackageArtifacts", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "wovenClassesBuildTests") +#@ load("common.lib.yml", "checkoutCode", "fetchPackageArtifacts") +#@ load("test.lib.yml", "baasTestArgs", "publishTestsResults", "testDefinition", "buildTests", "wovenClassesBuildTests") --- name: test-woven-classes diff --git a/.github/templates/test.lib.yml b/.github/templates/test.lib.yml index ec9fe86f9d..fde049e7ed 100644 --- a/.github/templates/test.lib.yml +++ b/.github/templates/test.lib.yml @@ -1,15 +1,5 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "actionDownloadArtifact", "msbuild", "dotnetPublish", "fetchWrapperBinaries", "checkoutCode") - -#@ def fetchPackageArtifacts(versionExpression = "inputs.version", packages = [ "Realm" ]): -#@ for pkg in packages: - - name: #@ "Fetch " + pkg - uses: #@ actionDownloadArtifact - with: - name: #@ pkg + ".${{ " + versionExpression + " }}" - path: ${{ github.workspace }}/Realm/packages/ -#@ end -#@ end +#@ load("common.lib.yml", "actionDownloadArtifact", "msbuild", "dotnetPublish", "fetchWrapperBinaries", "checkoutCode", "fetchPackageArtifacts") #@ def baasTestArgs(differentiator): #@ return " --baasurl=${{ inputs.realmUrl }} --baascluster=${{ inputs.clusterName }} --baasapikey=${{ secrets.AtlasPublicKey}} --baasprivateapikey=${{ secrets.AtlasPrivateKey}} --baasprojectid=${{ secrets.AtlasProjectId }} --baasdifferentiator=" + differentiator diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index fd4b995551..a028a1087b 100755 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -150,6 +150,8 @@ jobs: if: ${{ runner.os == 'Windows' }} - name: Build Realm/Realm run: msbuild Realm/Realm -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} + - name: Build Realm/Realm.PlatformHelpers + run: msbuild Realm/Realm.PlatformHelpers -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityUtils run: msbuild Realm/Realm.UnityUtils -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityWeaver @@ -168,6 +170,13 @@ jobs: path: ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}.*nupkg retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} if-no-files-found: error + - name: Store artifacts for Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + uses: actions/upload-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + path: ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.*nupkg + retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} + if-no-files-found: error - name: Store artifacts for Realm.UnityUtils.${{ steps.get-version.outputs.version }} uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/build-unity.yml b/.github/workflows/build-unity.yml index 62c08ceb2b..7ec3ed609f 100755 --- a/.github/workflows/build-unity.yml +++ b/.github/workflows/build-unity.yml @@ -28,6 +28,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Fetch Realm.UnityUtils uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ce37ddb2b7..ec09b05a34 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -42,6 +42,8 @@ jobs: uses: microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497 - name: Build Realm run: msbuild Realm/Realm -p:UseSharedCompilation=false -restore -p:Configuration=Release + - name: Build Realm.PlatformHelpers + run: msbuild Realm/Realm.PlatformHelpers -p:UseSharedCompilation=false -restore -p:Configuration=Release - name: Build Realm.UnityUtils run: msbuild Realm/Realm.UnityUtils -p:UseSharedCompilation=false -restore -p:Configuration=Release - name: Build Realm.UnityWeaver diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c6fe31ac3..c56d549934 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -52,6 +52,11 @@ jobs: with: name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Configure .NET uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a with: @@ -66,6 +71,8 @@ jobs: aws-region: us-east-1 - name: NuGet Publish Realm.${{ needs.build-packages.outputs.package_version }} run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource + - name: NuGet Publish Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + run: sleet push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource build-unity: uses: ./.github/workflows/build-unity.yml name: Package @@ -200,6 +207,11 @@ jobs: with: name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Tests.XUnit run: dotnet publish Tests/Tests.XUnit -c Release -f net6.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained - name: Output executable path @@ -250,6 +262,11 @@ jobs: with: name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Benchmarks/PerformanceTests run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path diff --git a/.github/workflows/publish-prerelease.yml b/.github/workflows/publish-prerelease.yml index 705855fcb1..81cd5fe4fd 100644 --- a/.github/workflows/publish-prerelease.yml +++ b/.github/workflows/publish-prerelease.yml @@ -38,6 +38,8 @@ jobs: aws-region: us-east-1 - name: NuGet Publish Realm.${{ steps.get-version.outputs.version }} run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}/Realm.${{ steps.get-version.outputs.version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource + - name: NuGet Publish Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + run: sleet push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource - uses: actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e with: node-version: 16.x diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 8826c99939..4d8c4db09d 100755 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -38,6 +38,8 @@ jobs: { aws s3 sync --acl public-read "${{ github.workspace }}\Realm\packages\_site" s3://realm-sdks/docs/realm-sdks/dotnet/$ver/ } + - name: NuGet Publish Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + run: dotnet nuget push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - name: NuGet Publish Realm.${{ steps.get-version.outputs.version }} run: dotnet nuget push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}/Realm.${{ steps.get-version.outputs.version }}.nupkg --skip-duplicate --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json - uses: actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 834331289c..66210928ee 100755 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -52,6 +52,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: @@ -111,6 +116,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Setup workloads run: | dotnet workload install maui diff --git a/.github/workflows/test-ios.yml b/.github/workflows/test-ios.yml index bc55442d54..0a1df0f52f 100755 --- a/.github/workflows/test-ios.yml +++ b/.github/workflows/test-ios.yml @@ -44,6 +44,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: @@ -95,6 +100,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Set XCode Version shell: bash run: | diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index a57b467dad..a633bfd638 100755 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -44,6 +44,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: @@ -90,6 +95,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Setup workloads run: | dotnet workload install maui diff --git a/.github/workflows/test-net-core.yml b/.github/workflows/test-net-core.yml index 1f84c8e847..6c32e1aecd 100755 --- a/.github/workflows/test-net-core.yml +++ b/.github/workflows/test-net-core.yml @@ -69,6 +69,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: diff --git a/.github/workflows/test-net-framework.yml b/.github/workflows/test-net-framework.yml index 7dfe305f7e..ae64118a29 100755 --- a/.github/workflows/test-net-framework.yml +++ b/.github/workflows/test-net-framework.yml @@ -44,6 +44,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: diff --git a/.github/workflows/test-tvos.yml b/.github/workflows/test-tvos.yml index 3f41f72d37..21fbab44d0 100755 --- a/.github/workflows/test-tvos.yml +++ b/.github/workflows/test-tvos.yml @@ -44,6 +44,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: diff --git a/.github/workflows/test-uwp-managed.yml b/.github/workflows/test-uwp-managed.yml index 908e9ae092..0c370e1f7c 100755 --- a/.github/workflows/test-uwp-managed.yml +++ b/.github/workflows/test-uwp-managed.yml @@ -48,6 +48,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} with: diff --git a/.github/workflows/test-woven-classes.yml b/.github/workflows/test-woven-classes.yml index 0ed301bdc6..a01b34937c 100644 --- a/.github/workflows/test-woven-classes.yml +++ b/.github/workflows/test-woven-classes.yml @@ -44,6 +44,11 @@ jobs: with: name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ + - name: Fetch Realm.PlatformHelpers + uses: actions/download-artifact@v3 + with: + name: Realm.PlatformHelpers.${{ inputs.version }} + path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Realm.Tests run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:TestWeavedClasses=true -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path From 8fb55e7c3254b4d88161b40381ccb1edf197d7cc Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 01:15:24 +0200 Subject: [PATCH 09/33] Fix AppTests on Unity --- Tests/Realm.Tests/Sync/AppTests.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Tests/Realm.Tests/Sync/AppTests.cs b/Tests/Realm.Tests/Sync/AppTests.cs index 4807969846..1ffae7ca4f 100644 --- a/Tests/Realm.Tests/Sync/AppTests.cs +++ b/Tests/Realm.Tests/Sync/AppTests.cs @@ -36,8 +36,14 @@ public class AppTests : SyncTestBase [Test] public void DeviceInfo_OutputsMeaningfulInfo() { - var os = SharedRealmHandle.GetNativeLibraryOS(); + if (TestHelpers.IsUnity) + { + Assert.That(Platform.DeviceInfo.DeviceName, Is.EqualTo(Platform.Unknown)); + Assert.That(Platform.DeviceInfo.DeviceVersion, Is.Not.EqualTo(Platform.Unknown)); + return; + } + var os = SharedRealmHandle.GetNativeLibraryOS(); switch (os) { case "Windows": From 48e3e5b9afeaa3f281d7177b3737628f1250fc06 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 01:25:42 +0200 Subject: [PATCH 10/33] Update Core --- wrappers/realm-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/realm-core b/wrappers/realm-core index 1b80764cb2..42638b2b87 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit 1b80764cb287ffe708d652e9eee188e9a4f73824 +Subproject commit 42638b2b876530383bce8e4c5769fcba9deae310 From 7c41c22618230f7f1a032af103847241070ce566 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 01:32:55 +0200 Subject: [PATCH 11/33] re-update Core --- wrappers/realm-core | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wrappers/realm-core b/wrappers/realm-core index 42638b2b87..2a14b98cea 160000 --- a/wrappers/realm-core +++ b/wrappers/realm-core @@ -1 +1 @@ -Subproject commit 42638b2b876530383bce8e4c5769fcba9deae310 +Subproject commit 2a14b98cea6e69877bc211591784cbb67a15623f From 714874abe824da4cf62cab49661b56461b5a4e63 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 01:43:27 +0200 Subject: [PATCH 12/33] Try to fix linux builds --- wrappers/build-linux.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/wrappers/build-linux.sh b/wrappers/build-linux.sh index 96b954eaad..dbc579195d 100755 --- a/wrappers/build-linux.sh +++ b/wrappers/build-linux.sh @@ -23,4 +23,17 @@ case $i in esac done -REALM_CMAKE_SUBPLATFORM="Linux-$libc/$ARCH" bash "$SCRIPT_DIRECTORY"/build.sh -c=$REALM_CMAKE_CONFIGURATION -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIRECTORY/realm-core/tools/cmake/$ARCH.toolchain.cmake" -GNinja $EXTRA_CMAKE_ARGS +TOOLCHAIN_FILE="" +case $ARCH in + "x86_64") + TOOLCHAIN_FILE="x86_64-linux-gnu.toolchain.cmake" + ;; + "armhf") + TOOLCHAIN_FILE="armv7-linux-gnueabihf.toolchain.cmake" + ;; + "aarch64") + TOOLCHAIN_FILE="aarch64-linux-gnu.toolchain.cmake" + ;; +esac + +REALM_CMAKE_SUBPLATFORM="Linux-$libc/$ARCH" bash "$SCRIPT_DIRECTORY"/build.sh -c=$REALM_CMAKE_CONFIGURATION -DCMAKE_TOOLCHAIN_FILE="$SCRIPT_DIRECTORY/realm-core/tools/cmake/$TOOLCHAIN_FILE" -GNinja $EXTRA_CMAKE_ARGS From 24c65ffc8a5c29929433c04a8796a584f8d63a88 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 02:21:29 +0200 Subject: [PATCH 13/33] Setup Android SDK before building --- .github/templates/build-packages.yml | 5 +++++ .github/templates/common.lib.yml | 2 +- .github/workflows/build-packages.yml | 16 +++++++------- .github/workflows/build-unity.yml | 8 +++---- .github/workflows/codeql.yml | 4 ++-- .github/workflows/main.yml | 28 ++++++++++++------------ .github/workflows/publish-prerelease.yml | 4 ++-- .github/workflows/test-android.yml | 16 +++++++------- .github/workflows/test-ios.yml | 16 +++++++------- .github/workflows/test-macos.yml | 16 +++++++------- .github/workflows/test-net-core.yml | 8 +++---- .github/workflows/test-net-framework.yml | 8 +++---- .github/workflows/test-tvos.yml | 8 +++---- .github/workflows/test-uwp-managed.yml | 8 +++---- .github/workflows/test-woven-classes.yml | 8 +++---- 15 files changed, 80 insertions(+), 75 deletions(-) diff --git a/.github/templates/build-packages.yml b/.github/templates/build-packages.yml index c2470842d4..84b8fb4210 100644 --- a/.github/templates/build-packages.yml +++ b/.github/templates/build-packages.yml @@ -42,6 +42,11 @@ #@ return result #@ end +#@ def setupAndroid(): + - name: Install SDK platform 21 + run: sdkmanager --install "platforms;android-21" +#@ end + --- name: build-packages "on": diff --git a/.github/templates/common.lib.yml b/.github/templates/common.lib.yml index 1cae5f11bc..9078bf3565 100644 --- a/.github/templates/common.lib.yml +++ b/.github/templates/common.lib.yml @@ -1,7 +1,7 @@ #@ load("@ytt:template", "template") #@ configuration = "Release" -#@ publishedPackages = [ 'Realm', 'Realm.PlatformHelpers'] +#@ publishedPackages = [ 'Realm.PlatformHelpers', 'Realm' ] #@ nugetPackages = publishedPackages + [ 'Realm.UnityUtils', 'Realm.UnityWeaver' ] #@ actionCheckout = "actions/checkout@v3" #@ actionCache = "nirinchev/cache@29e8e4dd9148ea81f9e188480132072cb6cc92d8" diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index a028a1087b..7d888de7e1 100755 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -148,10 +148,10 @@ jobs: - name: Add msbuild to PATH uses: microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497 if: ${{ runner.os == 'Windows' }} - - name: Build Realm/Realm - run: msbuild Realm/Realm -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.PlatformHelpers run: msbuild Realm/Realm.PlatformHelpers -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} + - name: Build Realm/Realm + run: msbuild Realm/Realm -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityUtils run: msbuild Realm/Realm.UnityUtils -t:Pack -p:Configuration=Release -restore -p:PackageOutputPath=${{ github.workspace }}/Realm/packages -p:VersionSuffix=${{ steps.set-version-suffix.outputs.build_suffix }} - name: Build Realm/Realm.UnityWeaver @@ -163,18 +163,18 @@ jobs: pkgVersion=$(find . -type f -regex ".*Realm.[1-9].*.nupkg" -exec basename {} \; | sed -n 's/Realm\.\(.*\)\.nupkg$/\1/p') echo "version=$pkgVersion" >> $GITHUB_OUTPUT shell: bash - - name: Store artifacts for Realm.${{ steps.get-version.outputs.version }} + - name: Store artifacts for Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} uses: actions/upload-artifact@v3 with: - name: Realm.${{ steps.get-version.outputs.version }} - path: ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}.*nupkg + name: Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + path: ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.*nupkg retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} if-no-files-found: error - - name: Store artifacts for Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} + - name: Store artifacts for Realm.${{ steps.get-version.outputs.version }} uses: actions/upload-artifact@v3 with: - name: Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} - path: ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.*nupkg + name: Realm.${{ steps.get-version.outputs.version }} + path: ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}.*nupkg retention-days: ${{ github.event_name != 'pull_request' && 30 || 1 }} if-no-files-found: error - name: Store artifacts for Realm.UnityUtils.${{ steps.get-version.outputs.version }} diff --git a/.github/workflows/build-unity.yml b/.github/workflows/build-unity.yml index 7ec3ed609f..178da4b8a0 100755 --- a/.github/workflows/build-unity.yml +++ b/.github/workflows/build-unity.yml @@ -23,15 +23,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - name: Fetch Realm.UnityUtils uses: actions/download-artifact@v3 diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index ec09b05a34..5ea124c474 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -40,10 +40,10 @@ jobs: - exclude: cs/unmanaged-code - name: Add msbuild to PATH uses: microsoft/setup-msbuild@0b44c6745b7e81956596964100aadb92d667c497 - - name: Build Realm - run: msbuild Realm/Realm -p:UseSharedCompilation=false -restore -p:Configuration=Release - name: Build Realm.PlatformHelpers run: msbuild Realm/Realm.PlatformHelpers -p:UseSharedCompilation=false -restore -p:Configuration=Release + - name: Build Realm + run: msbuild Realm/Realm -p:UseSharedCompilation=false -restore -p:Configuration=Release - name: Build Realm.UnityUtils run: msbuild Realm/Realm.UnityUtils -p:UseSharedCompilation=false -restore -p:Configuration=Release - name: Build Realm.UnityWeaver diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c56d549934..4f35d9d063 100755 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -47,15 +47,15 @@ jobs: with: submodules: false ref: ${{ github.event.pull_request.head.sha }} - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ needs.build-packages.outputs.package_version }} + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - name: Configure .NET uses: actions/setup-dotnet@607fce577a46308457984d59e4954e075820f10a @@ -69,10 +69,10 @@ jobs: aws-access-key-id: ${{ secrets.NUGET_S3_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.NUGET_S3_SECRET_KEY }} aws-region: us-east-1 - - name: NuGet Publish Realm.${{ needs.build-packages.outputs.package_version }} - run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource - name: NuGet Publish Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} run: sleet push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource + - name: NuGet Publish Realm.${{ needs.build-packages.outputs.package_version }} + run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ needs.build-packages.outputs.package_version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource build-unity: uses: ./.github/workflows/build-unity.yml name: Package @@ -202,15 +202,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ needs.build-packages.outputs.package_version }} + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Tests.XUnit run: dotnet publish Tests/Tests.XUnit -c Release -f net6.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} --no-self-contained @@ -257,15 +257,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ needs.build-packages.outputs.package_version }} + name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ needs.build-packages.outputs.package_version }} + name: Realm.${{ needs.build-packages.outputs.package_version }} path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Benchmarks/PerformanceTests run: dotnet publish Tests/Benchmarks/PerformanceTests -c Release -f net6.0 -r linux-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ needs.build-packages.outputs.package_version }} -p:RealmTestsStandaloneExe=true --no-self-contained diff --git a/.github/workflows/publish-prerelease.yml b/.github/workflows/publish-prerelease.yml index 81cd5fe4fd..98b3abf6f8 100644 --- a/.github/workflows/publish-prerelease.yml +++ b/.github/workflows/publish-prerelease.yml @@ -36,10 +36,10 @@ jobs: aws-access-key-id: ${{ secrets.NUGET_S3_ACCESS_KEY }} aws-secret-access-key: ${{ secrets.NUGET_S3_SECRET_KEY }} aws-region: us-east-1 - - name: NuGet Publish Realm.${{ steps.get-version.outputs.version }} - run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}/Realm.${{ steps.get-version.outputs.version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource - name: NuGet Publish Realm.PlatformHelpers.${{ steps.get-version.outputs.version }} run: sleet push ${{ github.workspace }}/Realm/packages/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}/Realm.PlatformHelpers.${{ steps.get-version.outputs.version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource + - name: NuGet Publish Realm.${{ steps.get-version.outputs.version }} + run: sleet push ${{ github.workspace }}/Realm/packages/Realm.${{ steps.get-version.outputs.version }}/Realm.${{ steps.get-version.outputs.version }}.nupkg --config ${{ github.workspace }}/.github/sleet.json --source NugetSource - uses: actions/setup-node@16352bb09bc672a073e326c2cc1d3d7d2a3e577e with: node-version: 16.x diff --git a/.github/workflows/test-android.yml b/.github/workflows/test-android.yml index 66210928ee..f836295029 100755 --- a/.github/workflows/test-android.yml +++ b/.github/workflows/test-android.yml @@ -47,15 +47,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} @@ -111,15 +111,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - name: Setup workloads run: | diff --git a/.github/workflows/test-ios.yml b/.github/workflows/test-ios.yml index 0a1df0f52f..8fc0e880b4 100755 --- a/.github/workflows/test-ios.yml +++ b/.github/workflows/test-ios.yml @@ -39,15 +39,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} @@ -95,15 +95,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - name: Set XCode Version shell: bash diff --git a/.github/workflows/test-macos.yml b/.github/workflows/test-macos.yml index a633bfd638..ef25a7a8cb 100755 --- a/.github/workflows/test-macos.yml +++ b/.github/workflows/test-macos.yml @@ -39,15 +39,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} @@ -90,15 +90,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - name: Setup workloads run: | diff --git a/.github/workflows/test-net-core.yml b/.github/workflows/test-net-core.yml index 6c32e1aecd..7c8e704b7d 100755 --- a/.github/workflows/test-net-core.yml +++ b/.github/workflows/test-net-core.yml @@ -64,15 +64,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/msvc.json" - name: Cleanup Workspace run: git clean -fdx - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} diff --git a/.github/workflows/test-net-framework.yml b/.github/workflows/test-net-framework.yml index ae64118a29..dd358438d3 100755 --- a/.github/workflows/test-net-framework.yml +++ b/.github/workflows/test-net-framework.yml @@ -39,15 +39,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} diff --git a/.github/workflows/test-tvos.yml b/.github/workflows/test-tvos.yml index 21fbab44d0..0702c89d38 100755 --- a/.github/workflows/test-tvos.yml +++ b/.github/workflows/test-tvos.yml @@ -39,15 +39,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} diff --git a/.github/workflows/test-uwp-managed.yml b/.github/workflows/test-uwp-managed.yml index 0c370e1f7c..0559637d6a 100755 --- a/.github/workflows/test-uwp-managed.yml +++ b/.github/workflows/test-uwp-managed.yml @@ -43,15 +43,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - uses: realm/ci-actions/mdb-realm/deploy@729a80d203351eab7df4eca564daa275e76ec52f if: ${{ inputs.realmUrl }} diff --git a/.github/workflows/test-woven-classes.yml b/.github/workflows/test-woven-classes.yml index a01b34937c..b9670c41c9 100644 --- a/.github/workflows/test-woven-classes.yml +++ b/.github/workflows/test-woven-classes.yml @@ -39,15 +39,15 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" - - name: Fetch Realm + - name: Fetch Realm.PlatformHelpers uses: actions/download-artifact@v3 with: - name: Realm.${{ inputs.version }} + name: Realm.PlatformHelpers.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - - name: Fetch Realm.PlatformHelpers + - name: Fetch Realm uses: actions/download-artifact@v3 with: - name: Realm.PlatformHelpers.${{ inputs.version }} + name: Realm.${{ inputs.version }} path: ${{ github.workspace }}/Realm/packages/ - name: Publish Tests/Realm.Tests run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r win-x64 -p:RestoreConfigFile=Tests/Test.NuGet.Config -p:UseRealmNupkgsWithVersion=${{ inputs.version }} -p:TestWeavedClasses=true -p:RealmTestsStandaloneExe=true --no-self-contained From 0f01eef3d7f2385adc96a727dc064e496da59385 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 02:32:32 +0200 Subject: [PATCH 14/33] Actually setup android 21 --- .github/templates/build-packages.yml | 1 + .github/workflows/build-packages.yml | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.github/templates/build-packages.yml b/.github/templates/build-packages.yml index 84b8fb4210..e3186fea8c 100644 --- a/.github/templates/build-packages.yml +++ b/.github/templates/build-packages.yml @@ -71,6 +71,7 @@ jobs: timeout-minutes: 30 steps: - #@ template.replace(checkoutCode()) + - #@ template.replace(setupAndroid()) - name: Set version suffix id: set-version-suffix #! Build suffix is pr-1234.5 for pr builds or alpha.123 for branch builds. diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 7d888de7e1..3ed5a16aaf 100755 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -29,6 +29,8 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Install SDK platform 21 + run: sdkmanager --install "platforms;android-21" - name: Set version suffix id: set-version-suffix run: | From 74a3934c3a61bde4a23c87c47e17db1b70f780f0 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 02:38:39 +0200 Subject: [PATCH 15/33] Add SetupAndroid action --- .github/templates/build-packages.yml | 4 +++- .github/templates/common.lib.yml | 1 + .github/workflows/build-packages.yml | 2 ++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/templates/build-packages.yml b/.github/templates/build-packages.yml index e3186fea8c..87163b2b88 100644 --- a/.github/templates/build-packages.yml +++ b/.github/templates/build-packages.yml @@ -1,5 +1,5 @@ #@ load("@ytt:template", "template") -#@ load("common.lib.yml", "checkoutCode", "fetchWrapperBinaries", "msBuildMultiple", "readVersionFromPackage", "uploadArtifacts", "actionCache", "nugetPackages", "setupDotnet") +#@ load("common.lib.yml", "checkoutCode", "fetchWrapperBinaries", "msBuildMultiple", "readVersionFromPackage", "uploadArtifacts", "actionCache", "nugetPackages", "setupDotnet", "actionSetupAndroid") #@ def buildDocs(): - name: Check Docfx cache @@ -43,6 +43,8 @@ #@ end #@ def setupAndroid(): + - name: Setup Android + uses: #@ actionSetupAndroid - name: Install SDK platform 21 run: sdkmanager --install "platforms;android-21" #@ end diff --git a/.github/templates/common.lib.yml b/.github/templates/common.lib.yml index 9078bf3565..629b77eba6 100644 --- a/.github/templates/common.lib.yml +++ b/.github/templates/common.lib.yml @@ -16,6 +16,7 @@ #@ actionAWSConfigureCredentials = "aws-actions/configure-aws-credentials@v1-node16" #@ actionReleaseToSlack = "realm/ci-actions/release-to-slack@729a80d203351eab7df4eca564daa275e76ec52f" #@ actionSetupXcode = "maxim-lobanov/setup-xcode@9a697e2b393340c3cacd97468baa318e4c883d98" +#@ actionSetupAndroid = "android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc" #@ androidABIs = [ 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64' ] #@ windowsArchs = [ 'Win32', 'x64', 'ARM64' ] diff --git a/.github/workflows/build-packages.yml b/.github/workflows/build-packages.yml index 3ed5a16aaf..bc12d13901 100755 --- a/.github/workflows/build-packages.yml +++ b/.github/workflows/build-packages.yml @@ -29,6 +29,8 @@ jobs: run: echo "::add-matcher::.github/problem-matchers/csc.json" - name: Register msvc problem matcher run: echo "::add-matcher::.github/problem-matchers/msvc.json" + - name: Setup Android + uses: android-actions/setup-android@7c5672355aaa8fde5f97a91aa9a99616d1ace6bc - name: Install SDK platform 21 run: sdkmanager --install "platforms;android-21" - name: Set version suffix From f48612d1cbbeebcf76f43b4ea0c90522ffc6fe15 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 02:58:09 +0200 Subject: [PATCH 16/33] Fix unity packaging --- .../fallback/DeviceInfo.netstandard.cs | 6 ++++-- Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs | 4 ++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs b/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs index 1d12701caa..f2c0568836 100644 --- a/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs +++ b/Realm/Realm.PlatformHelpers/fallback/DeviceInfo.netstandard.cs @@ -16,12 +16,14 @@ // //////////////////////////////////////////////////////////////////////////// +using static Realms.PlatformHelpers.Platform; + namespace Realms.PlatformHelpers { internal class DeviceInfo : IDeviceInfo { - public string DeviceName => "Unknown"; + public string DeviceName => Unknown; - public string DeviceVersion => "Unknown"; + public string DeviceVersion => Unknown; } } diff --git a/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs b/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs index 4aa732b721..614ba900ab 100644 --- a/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs +++ b/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs @@ -86,6 +86,10 @@ internal class RealmOptions : OptionsBase { "runtimes/win10-x86/nativeassets/uap10.0/realm-wrappers.dll", "Runtime/UWP/x86/realm-wrappers.dll" }, { "analyzers/dotnet/cs/Realm.SourceGenerator.dll", "Editor/Realm.SourceGenerator.dll" }, }, _realmDependencies), + new PackageInfo("Realm.PlatformHelpers", new Dictionary + { + { "lib/netstandard2.0/Realm.PlatformHelpers.dll", "Runtime/Realm.PlatformHelpers.dll" }, + }), new PackageInfo("Realm.UnityUtils", new Dictionary { { "lib/netstandard2.0/Realm.UnityUtils.dll", "Runtime/Realm.UnityUtils.dll" }, From 9d1f1f5efb006d66e777751643ba5d25a8a3885f Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 03:01:44 +0200 Subject: [PATCH 17/33] Install maui for coverage job --- .github/templates/test-code-coverage.yml | 3 +++ .github/workflows/test-code-coverage.yml | 3 +++ 2 files changed, 6 insertions(+) diff --git a/.github/templates/test-code-coverage.yml b/.github/templates/test-code-coverage.yml index fb9ce22bda..e700936bd3 100644 --- a/.github/templates/test-code-coverage.yml +++ b/.github/templates/test-code-coverage.yml @@ -17,6 +17,9 @@ jobs: dotnet tool install coverlet.console --tool-path tools dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools echo "${{ github.workspace }}/tools" >> $GITHUB_PATH + - name: Setup workloads + run: | + dotnet workload install maui - #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net7.0", "linux-x64", { "RealmTestsStandaloneExe": "true" })) - name: Run the tests run: #@ "./tools/coverlet ${{ steps.dotnet-publish.outputs.executable-path }} -t ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests -a '--result=TestResults.Linux.xml --labels=After" + baasTestArgs("code-coverage") + "' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*'" diff --git a/.github/workflows/test-code-coverage.yml b/.github/workflows/test-code-coverage.yml index 1975cadd9a..df2ed027fd 100755 --- a/.github/workflows/test-code-coverage.yml +++ b/.github/workflows/test-code-coverage.yml @@ -153,6 +153,9 @@ jobs: dotnet tool install coverlet.console --tool-path tools dotnet tool install dotnet-reportgenerator-globaltool --tool-path tools echo "${{ github.workspace }}/tools" >> $GITHUB_PATH + - name: Setup workloads + run: | + dotnet workload install maui - name: Publish Tests/Realm.Tests run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r linux-x64 -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path From 0c656959b802bd0c84eaf05e663ccad4d4bb2b63 Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 03:21:32 +0200 Subject: [PATCH 18/33] . --- .github/templates/test-code-coverage.yml | 2 +- .github/workflows/test-code-coverage.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/templates/test-code-coverage.yml b/.github/templates/test-code-coverage.yml index e700936bd3..3d36f6d607 100644 --- a/.github/templates/test-code-coverage.yml +++ b/.github/templates/test-code-coverage.yml @@ -19,7 +19,7 @@ jobs: echo "${{ github.workspace }}/tools" >> $GITHUB_PATH - name: Setup workloads run: | - dotnet workload install maui + dotnet workload restore - #@ template.replace(dotnetPublish("Tests/Realm.Tests", "net7.0", "linux-x64", { "RealmTestsStandaloneExe": "true" })) - name: Run the tests run: #@ "./tools/coverlet ${{ steps.dotnet-publish.outputs.executable-path }} -t ${{ steps.dotnet-publish.outputs.executable-path }}/Realm.Tests -a '--result=TestResults.Linux.xml --labels=After" + baasTestArgs("code-coverage") + "' -f lcov -o ./report.lcov --exclude '[Realm.Tests]*' --exclude '[Realm.Fody]*'" diff --git a/.github/workflows/test-code-coverage.yml b/.github/workflows/test-code-coverage.yml index df2ed027fd..58ffaf1280 100755 --- a/.github/workflows/test-code-coverage.yml +++ b/.github/workflows/test-code-coverage.yml @@ -155,7 +155,7 @@ jobs: echo "${{ github.workspace }}/tools" >> $GITHUB_PATH - name: Setup workloads run: | - dotnet workload install maui + dotnet workload restore - name: Publish Tests/Realm.Tests run: dotnet publish Tests/Realm.Tests -c Release -f net7.0 -r linux-x64 -p:RealmTestsStandaloneExe=true --no-self-contained - name: Output executable path From e0432e8c0717a23b67ea50892e16703cf74f0a5d Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 04:12:08 +0200 Subject: [PATCH 19/33] ... --- Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj | 2 +- Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj index 2da59b30cc..53605ec7bc 100644 --- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -9,7 +9,7 @@ netstandard2.0 - + $(TargetFrameworks);net6.0-ios;net6.0-android diff --git a/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs b/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs index 614ba900ab..0533a5ab5f 100644 --- a/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs +++ b/Tools/SetupUnityPackage/CommandLineOptions/RealmOptions.cs @@ -41,6 +41,7 @@ internal class RealmOptions : OptionsBase "Microsoft.CSharp", "Fody", "System.Dynamic.Runtime", + "Realm.PlatformHelpers" }; private static readonly IEnumerable _realmDependencies = new[] From a1aaaee280c92a3c97115600dd83b69841fc042b Mon Sep 17 00:00:00 2001 From: Nikola Irinchev Date: Thu, 18 May 2023 12:19:25 +0200 Subject: [PATCH 20/33] Try to fix CI builds --- .../Realm.PlatformHelpers/Realm.PlatformHelpers.csproj | 4 ++-- Tests/Realm.Tests/Realm.Tests.csproj | 10 +++++++--- Tools/SetupUnityPackage/Program.cs | 6 +++--- 3 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj index 53605ec7bc..ca5f3f5cce 100644 --- a/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj +++ b/Realm/Realm.PlatformHelpers/Realm.PlatformHelpers.csproj @@ -10,11 +10,11 @@ netstandard2.0 - $(TargetFrameworks);net6.0-ios;net6.0-android + $(TargetFrameworks);net6.0-ios;net6.0-android;net6.0-maccatalyst;net6.0-tvos - + $(TargetFrameworks);MonoAndroid5;Xamarin.iOS10;Xamarin.TVOS10;Xamarin.Mac20 $(TargetFrameworks);uap10.0.19041; diff --git a/Tests/Realm.Tests/Realm.Tests.csproj b/Tests/Realm.Tests/Realm.Tests.csproj index a4ecdb0ed3..63be19f2b3 100644 --- a/Tests/Realm.Tests/Realm.Tests.csproj +++ b/Tests/Realm.Tests/Realm.Tests.csproj @@ -28,7 +28,7 @@ Realm.Tests true $(DefineConstants);UNITY - ..\..\Realm\Realm.Unity\Runtime\Realm.dll + ..\..\Realm\Realm.Unity\Runtime @@ -53,7 +53,11 @@ the same dll here, otherwise when we try to ilrepack the test dependencies, we won't find MongoDB.Bson and friends. --> - $(RealmDllPath) + $(RealmDllsPath)Realm.dll + + + + $(RealmDllsPath)Realm.PlatformHelpers.dll - $(RealmDllsPath)Realm.dll + $(RealmDllsPath)\Realm.dll - $(RealmDllsPath)Realm.PlatformHelpers.dll + $(RealmDllsPath)\Realm.PlatformHelpers.dll