Skip to content

Commit

Permalink
[sensorkit] Update for Xcode 12 beta 2 (#9142)
Browse files Browse the repository at this point in the history
  • Loading branch information
spouliot authored Jul 21, 2020
1 parent 819acda commit f36b2ae
Show file tree
Hide file tree
Showing 11 changed files with 898 additions and 201 deletions.
1 change: 1 addition & 0 deletions src/Constants.iOS.cs.in
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ namespace ObjCRuntime {
public const string AccessibilityLibrary = "/System/Library/Frameworks/Accessibility.framework/Accessibility";
public const string AppClipLibrary = "/System/Library/Frameworks/AppClip.framework/AppClip";
public const string MediaSetupLibrary = "/System/Library/Frameworks/MediaSetup.framework/MediaSetup";
public const string SensorKitLibrary = "/System/Library/Frameworks/SensorKit.framework/SensorKit";
public const string UniformTypeIdentifiersLibrary = "/System/Library/Frameworks/UniformTypeIdentifiers.framework/UniformTypeIdentifiers";
}
}
25 changes: 25 additions & 0 deletions src/SensorKit/SRAbsoluteTime.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Runtime.InteropServices;
using ObjCRuntime;

#nullable enable

namespace SensorKit {

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
public static class SRAbsoluteTime {

[DllImport (Constants.SensorKitLibrary, EntryPoint = "SRAbsoluteTimeGetCurrent")]
public static extern /* SRAbsoluteTime */ double GetCurrent ();

[DllImport (Constants.SensorKitLibrary, EntryPoint = "SRAbsoluteTimeFromCFAbsoluteTime")]
public static extern /* SRAbsoluteTime */ double FromCFAbsoluteTime (/* CFAbsoluteTime */ double cfAbsoluteTime);

[DllImport (Constants.SensorKitLibrary, EntryPoint = "SRAbsoluteTimeToCFAbsoluteTime")]
public static extern /* CFAbsoluteTime */ double ToCFAbsoluteTime (double srAbsoluteTime);

[DllImport (Constants.SensorKitLibrary, EntryPoint = "SRAbsoluteTimeFromContinuousTime")]
public static extern /* SRAbsoluteTime */ double FromContinuousTime (ulong continuousTime);
}
}
16 changes: 16 additions & 0 deletions src/SensorKit/SRAmbientLightChromaticity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System;
using System.Runtime.InteropServices;
using ObjCRuntime;

#nullable enable

namespace SensorKit {

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[StructLayout (LayoutKind.Sequential)]
public struct SRAmbientLightChromaticity {
public float X;
public float Y;
}
}
21 changes: 21 additions & 0 deletions src/SensorKit/SRSensor.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using System;
using System.Runtime.InteropServices;
using ObjCRuntime;

#nullable enable

namespace SensorKit {

public partial class SRSensorExtensions {

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
public static SRSensor GetSensorForDeletionRecords (this SRSensor self)
{
var constant = self.GetConstant ();
if (constant == null)
return SRSensor.Invalid;
return GetValue (constant._GetSensorForDeletionRecordsFromSensor ());
}
}
}
18 changes: 18 additions & 0 deletions src/foundation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3746,6 +3746,24 @@ interface NSDate : NSSecureCoding, NSCopying, CKRecordValue {

[Export ("isEqualToDate:")]
bool IsEqualToDate (NSDate other);

// NSDate_SensorKit

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Static]
[Export ("dateWithSRAbsoluteTime:")]
NSDate CreateFromSRAbsoluteTime (double time);

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Export ("initWithSRAbsoluteTime:")]
IntPtr Constructor (double srAbsoluteTime);

[NoWatch, NoTV, NoMac]
[iOS (14,0)]
[Export ("srAbsoluteTime")]
double SrAbsoluteTime { get; }
}

[BaseType (typeof (NSObject))]
Expand Down
10 changes: 10 additions & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1430,6 +1430,15 @@ SECURITY_SOURCES = \
Security/SslConnection.cs \
Security/SslContext.cs \

# SensorKit

SENSORKIT_CORE_SOURCES = \
SensorKit/SRAmbientLightChromaticity.cs \

SENSORKIT_SOURCES = \
SensorKit/SRAbsoluteTime.cs \
SensorKit/SRSensor.cs \

# Social

SOCIAL_CORE_SOURCES = \
Expand Down Expand Up @@ -1973,6 +1982,7 @@ IOS_FRAMEWORKS = \
ReplayKit \
SafariServices \
Security \
SensorKit \
Social \
Speech \
SystemConfiguration \
Expand Down
Loading

1 comment on commit f36b2ae

@xamarin-release-manager
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build was (probably) aborted

🔥 Jenkins job (on internal Jenkins) failed in stage(s) 'Running XM tests on '10.16', Running XM tests on '10.14', Running XM tests on '10.14'' 🔥

Build succeeded
✅ Packages:

API Diff (from stable)
ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)
🔥 Xamarin.Mac tests on 10.16 failed: Xamarin.Mac tests on macOS 10.16 failed (dontlink, apitest, introspection, linksdk, linkall, xammac_tests, dontlink (system)) 🔥
🔥 Xamarin.Mac tests on 10.14 failed: Xamarin.Mac tests on macOS 10.14 failed (xammac_tests) 🔥
🔥 Test run failed 🔥

Test results

2 tests failed, 183 tests passed.

Failed tests

  • Generator tests/NUnit: Failed (Execution failed with exit code 1)
  • Generator tests/.NET: Failed (Execution failed with exit code 1)

Please sign in to comment.