Skip to content

Commit

Permalink
Add support Maccatalyst for MAUI
Browse files Browse the repository at this point in the history
  • Loading branch information
DmitriyKirakosyan committed Feb 21, 2024
1 parent 43de906 commit 284cbcf
Show file tree
Hide file tree
Showing 10 changed files with 58 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-macos</TargetFrameworks>
<TargetFrameworks>net6.0-ios;net6.0-macos;net6.0-maccatalyst</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<NoBindingEmbedding>false</NoBindingEmbedding>
</PropertyGroup>
Expand All @@ -10,7 +10,7 @@
<MtouchLink>SdkOnly</MtouchLink>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos'))">
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos')) Or $(TargetFramework.EndsWith('-maccatalyst'))">
<LinkMode>SdkOnly</LinkMode>
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
</PropertyGroup>
Expand Down Expand Up @@ -38,4 +38,12 @@
<Frameworks>CoreTelephony Security SystemConfiguration</Frameworks>
</NativeReference>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.EndsWith('-maccatalyst'))">
<NativeReference Include="..\..\..\externals\apple\maccatalyst\AppCenter.a">
<Kind>Static</Kind>
<ForceLoad>True</ForceLoad>
<LinkerFlags>-lsqlite3</LinkerFlags>
<Frameworks>CoreTelephony Security SystemConfiguration</Frameworks>
</NativeReference>
</ItemGroup>
</Project>
5 changes: 5 additions & 0 deletions SDK/AppCenter/Microsoft.AppCenter.Apple/global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "6.0.402"
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-macos</TargetFrameworks>
<TargetFrameworks>net6.0-ios;net6.0-macos;net6.0-maccatalyst</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<NoBindingEmbedding>false</NoBindingEmbedding>
</PropertyGroup>
Expand All @@ -10,7 +10,7 @@
<MtouchLink>SdkOnly</MtouchLink>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos'))">
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos')) Or $(TargetFramework.EndsWith('-maccatalyst'))">
<LinkMode>SdkOnly</LinkMode>
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
</PropertyGroup>
Expand All @@ -34,6 +34,13 @@
<Frameworks>IOKit</Frameworks>
</NativeReference>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.EndsWith('-maccatalyst'))">
<NativeReference Include="..\..\..\externals\apple\maccatalyst\AppCenterAnalytics.a">
<Kind>Static</Kind>
<ForceLoad>True</ForceLoad>
<Frameworks>IOKit</Frameworks>
</NativeReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.Apple\Microsoft.AppCenter.Apple.csproj" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net6.0-ios;net6.0-macos</TargetFrameworks>
<TargetFrameworks>net6.0-ios;net6.0-macos;net6.0-maccatalyst</TargetFrameworks>
<IsBindingProject>true</IsBindingProject>
<NoBindingEmbedding>false</NoBindingEmbedding>
</PropertyGroup>
Expand All @@ -10,7 +10,7 @@
<MtouchLink>SdkOnly</MtouchLink>
<MtouchHttpClientHandler>HttpClientHandler</MtouchHttpClientHandler>
</PropertyGroup>
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos'))">
<PropertyGroup Condition="$(TargetFramework.EndsWith('-macos')) Or $(TargetFramework.EndsWith('-maccatalyst'))">
<LinkMode>SdkOnly</LinkMode>
<SupportedOSPlatformVersion>10.14</SupportedOSPlatformVersion>
</PropertyGroup>
Expand Down Expand Up @@ -38,6 +38,14 @@
<IsCxx>True</IsCxx>
</NativeReference>
</ItemGroup>
<ItemGroup Condition="$(TargetFramework.EndsWith('-maccatalyst'))">
<NativeReference Include="..\..\..\externals\apple\maccatalyst\AppCenterCrashes.a">
<Kind>Static</Kind>
<ForceLoad>True</ForceLoad>
<LinkerFlags>-lc++</LinkerFlags>
<IsCxx>True</IsCxx>
</NativeReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\AppCenter\Microsoft.AppCenter.Apple\Microsoft.AppCenter.Apple.csproj" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion SDK/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Copyright>Microsoft Corp. All rights reserved.</Copyright>
<Company>Microsoft Corporation</Company>
<!-- Pin C# version. C# 8 features might have issues on Mono runtime. -->
<LangVersion>7.0</LangVersion>
<LangVersion>8.0</LangVersion>
<!-- Current version. -->
<Version>5.0.4-SNAPSHOT</Version>
<FileVersion>5.0.4.0</FileVersion>
Expand Down
5 changes: 5 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"sdk": {
"version": "6.0.402"
}
}
4 changes: 4 additions & 0 deletions nuget/MacAppCenter.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@
</group>
<group targetFramework="net6.0-macos10.10">
</group>
<group targetFramework="net6.0-maccatalyst10.10">
</group>
</dependencies>
</metadata>
<files>
Expand All @@ -56,6 +58,8 @@
<file src="$macos_dir$/Microsoft.AppCenter.xml" target="lib/Xamarin.Mac20" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.dll" target="lib/net6.0-macos10.10" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.xml" target="lib/net6.0-macos10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.dll" target="lib/net6.0-maccatalyst10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.xml" target="lib/net6.0-maccatalyst10.10" />

</files>
</package>
2 changes: 2 additions & 0 deletions nuget/MacAppCenterAnalytics.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<file src="$macos_dir$/Microsoft.AppCenter.Analytics.xml" target="lib/Xamarin.Mac20" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.Analytics.dll" target="lib/net6.0-macos10.10" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.Analytics.xml" target="lib/net6.0-macos10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.Analytics.dll" target="lib/net6.0-maccatalyst10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.Analytics.xml" target="lib/net6.0-maccatalyst10.10" />

</files>
</package>
2 changes: 2 additions & 0 deletions nuget/MacAppCenterCrashes.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<file src="$macos_dir$/Microsoft.AppCenter.Crashes.xml" target="lib/Xamarin.Mac20" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.Crashes.dll" target="lib/net6.0-macos10.10" />
<file src="$macos_net6_dir$/Microsoft.AppCenter.Crashes.xml" target="lib/net6.0-macos10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.Crashes.dll" target="lib/net6.0-maccatalyst10.10" />
<file src="$maccatalyst_net6_dir$/Microsoft.AppCenter.Crashes.xml" target="lib/net6.0-maccatalyst10.10" />

</files>
</package>
15 changes: 10 additions & 5 deletions scripts/configuration/ac-build-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,27 @@
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/xamarin.ios/Microsoft.AppCenter.Crashes.dll"/>
<assembly path="SDK/AppCenterDistribute/Microsoft.AppCenter.Distribute.Apple/bin/Release/xamarin.ios/Microsoft.AppCenter.Distribute.dll"/>
</group>
<group id="macos" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.Analytics.dll"/>
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.Crashes.dll"/>
</group>
<group id="ios_net6" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Apple/bin/Release/net6.0-ios/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Apple/bin/Release/net6.0-ios/Microsoft.AppCenter.Analytics.dll"/>
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/net6.0-ios/Microsoft.AppCenter.Crashes.dll"/>
<assembly path="SDK/AppCenterDistribute/Microsoft.AppCenter.Distribute.Apple/bin/Release/net6.0-ios/Microsoft.AppCenter.Distribute.dll"/>
</group>
<group id="macos" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.Analytics.dll"/>
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/xamarin.mac/Microsoft.AppCenter.Crashes.dll"/>
</group>
<group id="macos_net6" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Apple/bin/Release/net6.0-macos/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Apple/bin/Release/net6.0-macos/Microsoft.AppCenter.Analytics.dll"/>
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/net6.0-macos/Microsoft.AppCenter.Crashes.dll"/>
</group>
<group id="maccatalyst_net6" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Apple/bin/Release/net6.0-maccatalyst/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Apple/bin/Release/net6.0-maccatalyst/Microsoft.AppCenter.Analytics.dll"/>
<assembly path="SDK/AppCenterCrashes/Microsoft.AppCenter.Crashes.Apple/bin/Release/net6.0-maccatalyst/Microsoft.AppCenter.Crashes.dll"/>
</group>
<group id="android" buildGroup="mac">
<assembly path="SDK/AppCenter/Microsoft.AppCenter.Android/bin/Release/monoandroid10.0/Microsoft.AppCenter.dll"/>
<assembly path="SDK/AppCenterAnalytics/Microsoft.AppCenter.Analytics.Android/bin/Release/monoandroid10.0/Microsoft.AppCenter.Analytics.dll"/>
Expand Down

0 comments on commit 284cbcf

Please sign in to comment.