Skip to content

Commit

Permalink
Fix the Mac Catalyst Build
Browse files Browse the repository at this point in the history
  • Loading branch information
hydratim committed Aug 6, 2024
1 parent d658bdf commit 8151755
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 16 deletions.
6 changes: 6 additions & 0 deletions OpenOTDR/OpenOTDR-MacIOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@
<ApplicationId>com.baldrai.openotdr</ApplicationId>
</PropertyGroup>

<PropertyGroup Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) == 'maccatalyst'">
<MtouchInterpreter>all</MtouchInterpreter>
<PublishAot>false</PublishAot>
<UseInterpreter>True</UseInterpreter>
</PropertyGroup>

<ItemGroup>
<!-- App Icon -->
<MauiIcon Include="Resources\AppIcon\appicon.svg" />
Expand Down
10 changes: 8 additions & 2 deletions OpenOTDR/OpenOTDR.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,20 @@
</ItemGroup>

<ItemGroup>
<MauiXaml Update="App.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="AppShell.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\ProjectTracePage.xaml">
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\ProjectOverviewPage.xaml">
<Generator></Generator>
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Pages\ProjectsPage.xaml">
<Generator></Generator>
<Generator>MSBuild:Compile</Generator>
</MauiXaml>
<MauiXaml Update="Resources\Styles\ControlTemplates.xaml">
<Generator>MSBuild:Compile</Generator>
Expand Down
8 changes: 5 additions & 3 deletions OpenOTDR/Pages/ProjectOverviewPage.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using fio = Microsoft.VisualBasic.FileIO;
using Microsoft.EntityFrameworkCore;
using fio = Microsoft.VisualBasic.FileIO;

Check warning on line 2 in OpenOTDR/Pages/ProjectOverviewPage.xaml.cs

View workflow job for this annotation

GitHub Actions / build

The type name 'fio' only contains lower-cased ascii characters. Such names may become reserved for the language.
using OpenOTDR.Models;
using OpenOTDR.Services;
using Microsoft.EntityFrameworkCore;

namespace OpenOTDR.Pages;

Expand Down Expand Up @@ -57,7 +57,8 @@ private async void OnFileAdd(object sender, EventArgs eventArgs)
{
{ DevicePlatform.Android, new[] { "application/octet-stream", "application/kml" } }, // MIME type
{ DevicePlatform.WinUI, new[] { ".sor", ".sod", "kml" } }, // file extension
{ DevicePlatform.macOS, new[] { "sor", "sod", "kml" } } // UTType values
{ DevicePlatform.MacCatalyst, new[] { "public.data" } },
{ DevicePlatform.macOS, new[] { "public.data" } } // UTType values
});

PickOptions options = new()
Expand Down Expand Up @@ -101,6 +102,7 @@ private async void OnFileAdd(object sender, EventArgs eventArgs)
}
catch (Exception ex)
{

// The user canceled or something went wrong
}
}
Expand Down
20 changes: 9 additions & 11 deletions OpenOTDR/Platforms/MacCatalyst/Entitlements.plist
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<!-- See https://aka.ms/maui-publish-app-store#add-entitlements for more information about adding entitlements.-->
<dict>
<!-- App Sandbox must be enabled to distribute a MacCatalyst app through the Mac App Store. -->
<key>com.apple.security.app-sandbox</key>
<true/>
<!-- When App Sandbox is enabled, this value is required to open outgoing network connections. -->
<key>com.apple.security.network.client</key>
<true/>
</dict>
<dict>
<key>com.apple.security.app-sandbox</key>
<true/>
<key>com.apple.security.network.client</key>
<true/>
<key>com.apple.security.files.user-selected.read-write</key>
<true/>
</dict>
</plist>

0 comments on commit 8151755

Please sign in to comment.