Skip to content
Open
Show file tree
Hide file tree
Changes from 25 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
e8831fe
[ECO-4567] Created implementation plan to support msgpack encoding
sacOO7 Oct 20, 2025
86d5060
[ECO-5624] Refactored/Simplified DLL merging implementation in cake s…
sacOO7 Oct 25, 2025
e6da13c
[ECO-5624] Updated unity project with FAT Ably DLL
sacOO7 Oct 26, 2025
3b2765c
Merge branch 'fix/upgrade-newtonsoft-dep' into fix/newtonsoft-unity
sacOO7 Oct 27, 2025
de00d64
[ECO-5624] Removed fluentassertions dependency from tests
sacOO7 Oct 27, 2025
2838467
Merge branch 'fix/upgrade-newtonsoft-dep' into fix/newtonsoft-unity
sacOO7 Oct 27, 2025
4a04264
Merge branch 'fix/newtonsoft-unity' into feature/support-msgpack
sacOO7 Oct 27, 2025
14423cd
[ECO-4567] Updated msgpack to use latest version, removed conditional
sacOO7 Oct 27, 2025
73d7fce
[ECO-4567] Added cake script to format the code
sacOO7 Oct 29, 2025
b7b7995
[ECO-4567] Created implementation plan to support MsgPack exactly sim…
sacOO7 Oct 29, 2025
da42072
[ECO-4567] Implemented msgpack support
sacOO7 Oct 30, 2025
dd138de
[ECO-4567] Upgraded msgpack dep from msgpack-cli to msgpack-csharp
sacOO7 Oct 31, 2025
c49d355
[ECO-5624] Migrated messagepack integration from index to keyName
sacOO7 Nov 3, 2025
a241793
[ECO-4567] Updated NetFramwork, Xamarin-Android and Xamarin-iOS with …
sacOO7 Nov 4, 2025
b3002d4
[ECO-4567] Fixed Default.Protocol references across the codebase
sacOO7 Nov 4, 2025
8068059
[ECO-4567] Removed Defaults.Protocol references across the codebase
sacOO7 Nov 4, 2025
585ee7d
[ECO-4567] Refactored MsgPackHelper
sacOO7 Nov 5, 2025
f19dee1
[ECO-4567] Updated MsgPackHelper and fixed PaginatedResponse
sacOO7 Nov 6, 2025
a1592b2
[ECO-4567] Refactored MessageHandler with IsMsgPack() flag
sacOO7 Nov 7, 2025
8b0cced
[ECO-4567] Fixed parsing logic for errorResponse for msgpack encoding
sacOO7 Nov 10, 2025
85f0040
[ECO-4567] Updated MessageHandler with MsgPack specific encoders
sacOO7 Nov 11, 2025
0e9b10d
[ECO-4567] Added custom JObjectMessagePackSerializer
sacOO7 Nov 12, 2025
e9c9a04
[ECO-4567] Removed intermediate generated markdown files for msgpack
sacOO7 Nov 12, 2025
0532d66
Merge branch 'main' into feature/support-msgpack
sacOO7 Nov 12, 2025
e2aac5e
[ECO-4567] Removed unncessary EnumMember attribute from DataRequestQuery
sacOO7 Nov 12, 2025
477e4d9
[ECO-4567] Fixed test.cake script to throw exception when retry tests…
sacOO7 Nov 13, 2025
3d56db4
[ECO-4567] Fixed MsgPackSerializer tests with proper logging
sacOO7 Nov 13, 2025
4fdf426
[ECO-4567] Added explicit test for TestMsgpackDecoding based on msgpa…
sacOO7 Nov 13, 2025
39a2c58
[ECO-4567] Reverted all formatting based changes for all files
sacOO7 Nov 14, 2025
5d7a02f
[ECO-4567] Updated tests to use JAssert.DeepEquals instead of JToken.…
sacOO7 Nov 14, 2025
a1ceae7
[ECO-4567] Updated DateTimeOffset/TimeSpan MsgPackSerializer similar …
sacOO7 Nov 17, 2025
3246e3e
[ECO-4567] Moved separate msgpack project to core shared project
sacOO7 Nov 17, 2025
e0b038c
[ECO-4567] Added MessagePack dependency to every platform in the nuspec
sacOO7 Nov 18, 2025
9385d46
[ECO-4567] Fixed unity editmode and playmode tests
sacOO7 Nov 18, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ root = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = false
insert_final_newline = true

# SA1200: Using directives should be placed correctly
dotnet_diagnostic.SA1200.severity = none

[*.cake]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.{xaml,xml,config,manifest}]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = false
insert_final_newline = false
85 changes: 57 additions & 28 deletions cake-build/tasks/build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ Task("_Clean")
.Does(() =>
{
Information("Cleaning build directories...");

// Clean the main solution which includes all core projects (NetFramework, NetStandard, iOS, Android, Tests, etc.)
CleanSolution();

// Clean custom output directories that are not part of standard project outputs
CleanDirectory(paths.TestResults);
CleanDirectory(paths.TestResults);
});

Task("_Restore_Main")
Expand All @@ -25,9 +25,9 @@ Task("_Version")
.Does(() =>
{
Information($"Setting version to {version}");

var assemblyInfoPath = paths.Src.CombineWithFilePath("CommonAssemblyInfo.cs");

CreateAssemblyInfo(assemblyInfoPath, new AssemblyInfoSettings
{
Company = "Ably",
Expand All @@ -43,37 +43,37 @@ Task("_NetFramework_Build")
.Does(() =>
{
Information("Building .NET Framework solution...");

var settings = buildConfig.ApplyStandardSettings(
new MSBuildSettings(),
configuration
);

settings = settings.WithTarget("Build");

MSBuild(paths.NetFrameworkSolution, settings);
});

Task("_NetStandard_Build")
.Does(() =>
{
Information("Building .NET Standard solution...");

var settings = new DotNetBuildSettings
{
Configuration = configuration,
NoRestore = true
};
var msbuildSettings = new DotNetMSBuildSettings();


if (!string.IsNullOrEmpty(defineConstants))
{
msbuildSettings = msbuildSettings.WithProperty("DefineConstants", defineConstants);
}

settings.MSBuildSettings = msbuildSettings;

DotNetBuild(paths.NetStandardSolution.FullPath, settings);
});

Expand All @@ -87,20 +87,20 @@ Task("_Xamarin_Build")
.Does(() =>
{
Information("Building Xamarin solution...");

if (!FileExists(paths.XamarinSolution))
{
Warning("Xamarin solution not found, skipping build");
return;
}

var settings = buildConfig.ApplyStandardSettings(
new MSBuildSettings(),
configuration
);

settings = settings.WithTarget("Build");

MSBuild(paths.XamarinSolution, settings);
});

Expand All @@ -109,32 +109,32 @@ Task("_Build_Ably_Unity_Dll")
.Does(() =>
{
Information("Merging Unity dependencies into IO.Ably.dll...");

var netStandard20BinPath = paths.Src
.Combine("IO.Ably.NETStandard20")
.Combine("bin/Release/netstandard2.0");

if (!DirectoryExists(netStandard20BinPath))
{
throw new Exception($"NETStandard2.0 bin directory not found: {netStandard20BinPath}. Please build the project first.");
}

var primaryDll = netStandard20BinPath.CombineWithFilePath("IO.Ably.dll");

if (!FileExists(primaryDll))
{
throw new Exception($"Primary DLL not found: {primaryDll}. Please build the IO.Ably.NETStandard20 project first.");
}

var newtonsoftDll = paths.Root
.Combine("lib/unity/AOT")
.CombineWithFilePath("Newtonsoft.Json.dll");

if (!FileExists(newtonsoftDll))
{
throw new Exception($"Newtonsoft.Json.dll not found at: {newtonsoftDll}");
}

var dllsToMerge = new[]
{
netStandard20BinPath.CombineWithFilePath("IO.Ably.DeltaCodec.dll"),
Expand All @@ -143,23 +143,47 @@ Task("_Build_Ably_Unity_Dll")
netStandard20BinPath.CombineWithFilePath("System.Threading.Tasks.Extensions.dll"),
newtonsoftDll
};

var unityOutputPath = paths.Root.Combine("unity/Assets/Ably/Plugins");
var outputDll = unityOutputPath.CombineWithFilePath("IO.Ably.dll");

// Delete existing output DLL if it exists
if (FileExists(outputDll))
{
DeleteFile(outputDll);
Information($"Deleted existing DLL: {outputDll}");
}

// Merge all dependencies into primary DLL in one go
ilRepackHelper.MergeDLLs(primaryDll, dllsToMerge, outputDll);

Information($"✓ Unity DLL created at: {outputDll}");
});

Task("_Format_Code")
.Description("Format C#, XML and other files")
.Does(() =>
{
Information("Formatting code with dotnet-format...");

// Using 'whitespace' mode for fast formatting without building the project
// This applies .editorconfig rules for whitespace, indentation, etc. without semantic analysis
// Much faster than default mode which requires compilation
var exitCode = StartProcess("dotnet", new ProcessSettings
{
Arguments = $"format {paths.MainSolution.FullPath} whitespace --no-restore"
});

if (exitCode == 0)
{
Information("✓ Code formatted successfully");
}
else
{
throw new Exception($"dotnet format failed with exit code {exitCode}");
}
});

///////////////////////////////////////////////////////////////////////////////
// PUBLIC TARGETS
///////////////////////////////////////////////////////////////////////////////
Expand Down Expand Up @@ -190,3 +214,8 @@ Task("Build.Xamarin")
Task("Update.AblyUnity")
.Description("Update Ably DLLs inside unity project")
.IsDependentOn("_Build_Ably_Unity_Dll");

// Public task: Format code using dotnet-format
Task("Format.Code")
.Description("Format code using dotnet-format")
.IsDependentOn("_Format_Code");
10 changes: 5 additions & 5 deletions examples/AndroidSample/AblyService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,14 @@ public void Init()
_ably = new AblyRealtime(new ClientOptions("lNj80Q.iGyVcQ:2QKX7FFASfX-7H9H")
{
LogHandler = this,
LogLevel = LogLevel.Debug,
LogLevel = LogLevel.Debug,
AutoConnect = false,
UseBinaryProtocol = false
});
_ably.Connection.On(change =>
{
if(change.Current == ConnectionState.Connected)
foreach(var channel in _ably.Channels)
if (change.Current == ConnectionState.Connected)
foreach (var channel in _ably.Channels)
channel.Attach();

_connectionSubject.OnNext(change.Current.ToString());
Expand All @@ -48,7 +48,7 @@ public IObservable<Message> SubsrcibeToChannel(string channelName)
_ably.Channels.Get(channelName).Subscribe(subject.OnNext);
return subject;
}

public void LogEvent(LogLevel level, string message)
{
Android.Util.Log.Debug("ably", $"[{level}] {message}");
Expand All @@ -66,6 +66,6 @@ public IDisposable Subscribe(IObserver<string> observer)
}
}



}
2 changes: 1 addition & 1 deletion examples/AndroidSample/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public App(AblyService ably)

protected override void OnStart()
{

// Handle when your app starts
}

Expand Down
1 change: 1 addition & 0 deletions format-code.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet cake cake-build/build.cake -- --target=Format.Code
1 change: 1 addition & 0 deletions format-code.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
dotnet cake cake-build/build.cake -- --target=Format.Code
25 changes: 18 additions & 7 deletions src/IO.Ably.Android/IO.Ably.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
<TargetFrameworkVersion>v11.0</TargetFrameworkVersion>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<EmitCompilerGeneratedFiles>true</EmitCompilerGeneratedFiles>
<CompilerGeneratedFilesOutputPath>obj/Generated</CompilerGeneratedFilesOutputPath>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -51,9 +53,16 @@
<!-- Fix for DeterministicSourcePaths in CI environments -->
<!-- See: https://github.com/dotnet/sourcelink/issues/572 -->
<ItemGroup>
<SourceRoot Include="$(MSBuildThisFileDirectory)..\..\"/>
<SourceRoot Include="$(MSBuildThisFileDirectory)..\..\" />
</ItemGroup>
<ItemGroup>
<Reference Include="MessagePack, Version=3.1.4.0, Culture=neutral, PublicKeyToken=b4a0369545f0a1be">
<HintPath>..\packages\MessagePack.3.1.4\lib\netstandard2.0\MessagePack.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MessagePack.Annotations, Version=3.1.4.0, Culture=neutral, PublicKeyToken=b4a0369545f0a1be, processorArchitecture=MSIL">
<HintPath>..\packages\MessagePack.Annotations.3.1.4\lib\netstandard2.0\MessagePack.Annotations.dll</HintPath>
</Reference>
<Reference Include="Microsoft.CSharp" />
<Reference Include="Microsoft.Threading.Tasks, Version=1.0.12.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Bcl.Async.1.0.168\lib\portable-net45+win8+wpa81\Microsoft.Threading.Tasks.dll</HintPath>
Expand All @@ -65,9 +74,6 @@
</Reference>
<Reference Include="Mono.Android" />
<Reference Include="mscorlib" />
<Reference Include="MsgPack, Version=0.9.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\MsgPack.Cli.0.9.2\lib\MonoAndroid10\MsgPack.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
<HintPath>..\packages\Newtonsoft.Json.13.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
</Reference>
Expand All @@ -87,8 +93,8 @@
<HintPath>..\packages\System.Threading.Channels.4.5.0\lib\netstandard2.0\System.Threading.Channels.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.0\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51">
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\netstandard2.0\System.Threading.Tasks.Extensions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Xml.Linq" />
Expand All @@ -107,14 +113,19 @@
<SubType>Designer</SubType>
</None>
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\packages\MessagePackAnalyzer.3.1.4\analyzers\roslyn4.3\cs\MessagePack.SourceGenerator.dll" />
<Analyzer Include="..\packages\MessagePackAnalyzer.3.1.4\analyzers\roslyn4.3\cs\MessagePack.Analyzers.CodeFixes.dll" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\lib\delta-codec\IO.Ably.DeltaCodec\IO.Ably.DeltaCodec.csproj">
<Project>{412deb5f-7936-4027-8bf8-977f23d465ed}</Project>
<Name>IO.Ably.DeltaCodec</Name>
</ProjectReference>
</ItemGroup>
<Import Project="..\IO.Ably.Shared\IO.Ably.Shared.projitems" Label="Shared" />
<Import Project="..\IO.Ably.Shared.MsgPack\IO.Ably.Shared.MsgPack.projitems" Label="Shared" Condition="$(DefineConstants.Contains(MSGPACK))" />
<!-- Always include MsgPack project - no conditional compilation -->
<Import Project="..\IO.Ably.Shared.MsgPack\IO.Ably.Shared.MsgPack.projitems" Label="Shared" />
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" Condition="Exists('$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets')" />
<Import Project="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets" Condition="Exists('C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Xamarin\Android\Xamarin.Android.CSharp.targets')" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Expand Down
8 changes: 5 additions & 3 deletions src/IO.Ably.Android/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="monoandroid403" />
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="monoandroid403" />
<package id="Microsoft.CSharp" version="4.4.0" targetFramework="monoandroid71" />
<package id="MessagePack" version="3.1.4" targetFramework="monoandroid71" />
<package id="MessagePack.Annotations" version="3.1.4" targetFramework="monoandroid71" />
<package id="MessagePackAnalyzer" version="3.1.4" targetFramework="monoandroid71" developmentDependency="true" />
<package id="Microsoft.NETCore.Platforms" version="2.0.1" targetFramework="monoandroid71" />
<package id="Microsoft.Win32.Primitives" version="4.3.0" targetFramework="monoandroid403" />
<package id="MsgPack.Cli" version="0.9.2" targetFramework="monoandroid403" />
<package id="NETStandard.Library" version="2.0.3" targetFramework="monoandroid71" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="monoandroid71" />
<package id="System.AppContext" version="4.3.0" targetFramework="monoandroid403" />
Expand Down Expand Up @@ -57,10 +59,10 @@
<package id="System.Threading" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Threading.Channels" version="4.5.0" targetFramework="monoandroid71" />
<package id="System.Threading.Tasks" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Threading.Tasks.Extensions" version="4.5.0" targetFramework="monoandroid71" />
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="monoandroid71" />
<package id="System.Threading.ThreadPool" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Threading.Timer" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Xml.ReaderWriter" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Xml.XDocument" version="4.3.0" targetFramework="monoandroid403" />
<package id="System.Xml.XmlDocument" version="4.3.0" targetFramework="monoandroid403" />
</packages>
</packages>
Loading
Loading