Skip to content

Commit

Permalink
[ThreadNetwork] Added support for Xcode 14.1 b3 (#16196)
Browse files Browse the repository at this point in the history
This PR adds support for Mac and MacCatalyst. Apple says that these
platforms are now supported; framework's headers does not specify them
but do not deny them either, so let's see what intro says about this.

I'm just creating this PR to test it against intro once we can build the
branch.

Co-authored-by: Manuel de la Pena <mandel@microsoft.com>
  • Loading branch information
Israel Soto and mandel-macaque authored Oct 10, 2022
1 parent b97e797 commit 11b1d1e
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 44 deletions.
1 change: 1 addition & 0 deletions src/Foundation/NSObject.mac.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ public partial class NSObject {
static IntPtr un = Dlfcn.dlopen (Constants.UserNotificationsLibrary, 1);
static IntPtr il = Dlfcn.dlopen (Constants.iTunesLibraryLibrary, 1);
static IntPtr exl = Dlfcn.dlopen (Constants.ExtensionKitLibrary, 1);
static IntPtr th = Dlfcn.dlopen (Constants.ThreadNetworkLibrary, 1);

#if !NET
[Obsolete ("Use PlatformAssembly for easier code sharing across platforms.")]
Expand Down
2 changes: 2 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -2099,6 +2099,7 @@ MACOS_FRAMEWORKS = \
Social \
Speech \
SystemConfiguration \
ThreadNetwork \
UserNotifications \
UserNotificationsUI \
VideoSubscriberAccount \
Expand Down Expand Up @@ -2398,6 +2399,7 @@ MACCATALYST_FRAMEWORKS = \
Social \
Speech \
SystemConfiguration \
ThreadNetwork \
UIKit XKit \
UserNotifications \
UserNotificationsUI \
Expand Down
4 changes: 2 additions & 2 deletions src/threadnetwork.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace ThreadNetwork {

[iOS (15,0), NoMac, NoMacCatalyst]
[iOS (15,0), Mac (13,0), MacCatalyst (16,1), NoWatch, NoTV]
[BaseType (typeof (NSObject))]
interface THClient
{
Expand Down Expand Up @@ -40,7 +40,7 @@ interface THClient
void CheckPreferredNetwork (NSData activeOperationalDataSet, Action<bool> completion);
}

[iOS (15,0), NoMac, NoMacCatalyst]
[iOS (15,0), Mac (13,0), MacCatalyst (16,1), NoWatch, NoTV]
[BaseType (typeof (NSObject))]
[DisableDefaultCtor]
interface THCredentials : NSSecureCoding
Expand Down
21 changes: 0 additions & 21 deletions tests/xtro-sharpie/api-annotations-dotnet/macOS-ThreadNetwork.todo

This file was deleted.

21 changes: 0 additions & 21 deletions tests/xtro-sharpie/macOS-ThreadNetwork.todo

This file was deleted.

5 changes: 5 additions & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,7 @@ public static Frameworks MacFrameworks {
{ "HealthKit", "HealthKit", 13,0 },
{ "SharedWithYouCore", "SharedWithYouCore", 13, 0 },
{ "ExtensionKit", "ExtensionKit", 13,0 },
{ "ThreadNetwork", "ThreadNetwork", 13,0 },
};
}
return mac_frameworks;
Expand Down Expand Up @@ -645,6 +646,7 @@ public static Frameworks GetMacCatalystFrameworks ()
var min = new Version (13, 0);
var v14_0 = new Version (14, 0);
var v14_2 = new Version (14, 2);
var v16_1 = new Version (16, 1);
foreach (var f in catalyst_frameworks.Values) {
switch (f.Name) {
// These frameworks were added to Catalyst after they were added to iOS, so we have to adjust the Versions fields
Expand All @@ -660,6 +662,9 @@ public static Frameworks GetMacCatalystFrameworks ()
f.Version = v14_2;
f.VersionAvailableInSimulator = v14_2;
break;
case "ThreadNetwork":
f.Version = v16_1;
break;
// These frameworks are not available on Mac Catalyst
case "OpenGLES":
case "NewsstandKit":
Expand Down

4 comments on commit 11b1d1e

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.