Skip to content

Commit

Permalink
[MetricKit] Add support for Xcode 13 beta4. (#12326)
Browse files Browse the repository at this point in the history
Co-authored-by: Rolf Bjarne Kvinge <rolf@xamarin.com>
  • Loading branch information
mandel-macaque and rolfbjarne authored Aug 4, 2021
1 parent 68a5091 commit 62eec28
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 79 deletions.
6 changes: 2 additions & 4 deletions src/MetricKit/MXMetricManager.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if IOS
using System;

using CoreFoundation;
Expand All @@ -9,11 +8,10 @@ namespace MetricKit {

public partial class MXMetricManager {

public static OSLog MakeLogHandle (NSString category)
public static CoreFoundation.OSLog MakeLogHandle (NSString category)
{
var ptr = _MakeLogHandle (category);
return new OSLog (ptr, owns: true);
return new CoreFoundation.OSLog (ptr, owns: true);
}
}
}
#endif
1 change: 1 addition & 0 deletions src/frameworks.sources
Original file line number Diff line number Diff line change
Expand Up @@ -1980,6 +1980,7 @@ MAC_FRAMEWORKS = \
Metal \
MetalKit \
MetalPerformanceShaders \
MetricKit \
MLCompute \
MobileCoreServices \
ModelIO \
Expand Down
42 changes: 28 additions & 14 deletions src/metrickit.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ interface MXUnitAveragePixelLuminance : NSUnit {
MXUnitAveragePixelLuminance Apl { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[BaseType (typeof(NSObject))]
interface MXHistogramBucket<UnitType> : NSSecureCoding
where UnitType : NSUnit {
Expand All @@ -101,7 +101,7 @@ interface MXHistogramBucket<UnitType> : NSSecureCoding
nuint BucketCount { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[BaseType (typeof(NSObject))]
interface MXHistogram<UnitType> : NSSecureCoding
where UnitType : NSUnit {
Expand All @@ -119,7 +119,7 @@ interface MXCellularConditionMetric {
MXHistogram<MXUnitSignalBars> HistogrammedCellularConditionTime { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[BaseType (typeof(NSObject))]
interface MXMetaData : NSSecureCoding {
[Export ("regionFormat", ArgumentSemantic.Strong)]
Expand All @@ -137,6 +137,7 @@ interface MXMetaData : NSSecureCoding {
[Export ("JSONRepresentation")]
NSData JsonRepresentation { get; }

#if !MONOMAC
[Internal]
[Deprecated (PlatformName.iOS, 14,0)]
[Export ("DictionaryRepresentation")]
Expand All @@ -147,6 +148,10 @@ interface MXMetaData : NSSecureCoding {
[MacCatalyst (14,0)]
[Export ("dictionaryRepresentation")]
NSDictionary _DictionaryRepresentation14 { get; }
#else
[Export ("dictionaryRepresentation")]
NSDictionary DictionaryRepresentation { get; }
#endif

[iOS (14,0)]
[MacCatalyst (14,0)]
Expand Down Expand Up @@ -232,7 +237,7 @@ interface MXDiskIOMetric {
NSMeasurement<NSUnitInformationStorage> CumulativeLogicalWrites { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface MXAverage<UnitType> : NSSecureCoding
Expand Down Expand Up @@ -278,6 +283,11 @@ interface MXSignpostIntervalData : NSSecureCoding {

[NullAllowed, Export ("cumulativeLogicalWrites", ArgumentSemantic.Strong)]
NSMeasurement<NSUnitInformationStorage> CumulativeLogicalWrites { get; }

[NullAllowed]
[NoWatch, NoTV, NoMac, iOS (15,0), MacCatalyst (15,0)]
[Export ("cumulativeHitchTimeRatio", ArgumentSemantic.Strong)]
NSMeasurement<NSUnit> CumulativeHitchTimeRatio { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
Expand Down Expand Up @@ -377,10 +387,11 @@ interface MXMetricPayload : NSSecureCoding {
MXAppExitMetric ApplicationExitMetrics { get; }
}

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[BaseType (typeof(NSObject))]
[DisableDefaultCtor]
interface MXMetricManager {
[NoMac]
[Export ("pastPayloads", ArgumentSemantic.Strong)]
MXMetricPayload[] PastPayloads { get; }

Expand All @@ -407,10 +418,13 @@ interface MXMetricManager {

interface IMXMetricManagerSubscriber { }

[NoWatch, NoTV, NoMac, iOS (13,0)]
[NoWatch, NoTV, Mac (12,0), iOS (13,0)]
[Protocol]
interface MXMetricManagerSubscriber {
#if !XAMCORE_4_0
[Abstract]
#endif
[NoMac]
[Export ("didReceiveMetricPayloads:")]
void DidReceiveMetricPayloads (MXMetricPayload[] payloads);

Expand Down Expand Up @@ -508,7 +522,7 @@ interface MXForegroundExitData : NSSecureCoding {
nuint CumulativeAppWatchdogExitCount { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
Expand All @@ -519,7 +533,7 @@ interface MXCallStackTree : NSSecureCoding {
NSData JsonRepresentation { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (MXDiagnostic), Name = "MXCPUExceptionDiagnostic")]
Expand All @@ -536,7 +550,7 @@ interface MXCpuExceptionDiagnostic {
NSMeasurement<NSUnitDuration> TotalSampledTime { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (MXDiagnostic))]
Expand Down Expand Up @@ -568,7 +582,7 @@ interface MXCrashDiagnostic {
NSNumber Signal { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
Expand All @@ -588,7 +602,7 @@ interface MXDiagnostic : NSSecureCoding {
NSDictionary DictionaryRepresentation { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (NSObject))]
Expand Down Expand Up @@ -620,7 +634,7 @@ interface MXDiagnosticPayload : NSSecureCoding {
NSDictionary DictionaryRepresentation { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (MXDiagnostic))]
Expand All @@ -634,7 +648,7 @@ interface MXDiskWriteExceptionDiagnostic {
NSMeasurement<NSUnitInformationStorage> TotalWritesCaused { get; }
}

[NoWatch, NoTV, NoMac]
[NoWatch, NoTV, Mac (12,0)]
[iOS (14,0)]
[MacCatalyst (14,0)]
[BaseType (typeof (MXDiagnostic))]
Expand All @@ -647,4 +661,4 @@ interface MXHangDiagnostic {
[Export ("hangDuration", ArgumentSemantic.Strong)]
NSMeasurement<NSUnitDuration> HangDuration { get; }
}
}
}
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Added for xamcore 4.0
!incorrect-protocol-member! MXMetricManagerSubscriber::didReceiveMetricPayloads: is OPTIONAL and should NOT be abstract
!missing-selector! MXSignpostIntervalData::cumulativeHitchTimeRatio not bound
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Added for xamcore 4.0
!incorrect-protocol-member! MXMetricManagerSubscriber::didReceiveMetricPayloads: is OPTIONAL and should NOT be abstract
!missing-selector! MXSignpostIntervalData::cumulativeHitchTimeRatio not bound
59 changes: 0 additions & 59 deletions tests/xtro-sharpie/macOS-MetricKit.todo

This file was deleted.

1 change: 1 addition & 0 deletions tools/common/Frameworks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ public static Frameworks MacFrameworks {
{ "AdServices", "AdServices", 11,1 },

{ "Chip", "CHIP", 12, 0 },
{ "MetricKit", 12, 0 },
};
}
return mac_frameworks;
Expand Down

5 comments on commit 62eec28

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ [CI Build] Tests failed on Build ❌

Tests failed on Build.

API diff

✅ API Diff from stable

View API diff

API & Generator diff

ℹ️ API Diff (from PR only) (please review changes)
ℹ️ Generator Diff (please review changes)

Packages generated

View packages

Test results

4 tests failed, 221 tests passed.

Failed tests

  • introspection/Mac Catalyst/Debug [dotnet]: TimedOut (Execution timed out after 1200 seconds.
    No test log file was produced)
  • monotouch-test/Mac Catalyst/Debug [dotnet]: Failed (Tests run: 2630 Passed: 2489 Inconclusive: 35 Failed: 2 Ignored: 139)
  • monotouch-test/iOS Unified 64-bits - simulator/Debug (all optimizations): Failed
  • Documentation/All: Failed

Pipeline on Agent XAMBOT-1017.BigSur
[MetricKit] Add support for Xcode 13 beta4. (#12326)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests iOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[MetricKit] Add support for Xcode 13 beta4. (#12326)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

⚠️ Tests were not ran (VSTS: device tests tvOS). ⚠️

Results were skipped for this run due to provisioning problems Azure Devops. Please contact the bot administrator.

Pipeline on Agent
[MetricKit] Add support for Xcode 13 beta4. (#12326)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

❌ Tests failed on macOS M1 - Mac Big Sur (11.5) ❌

Tests failed on M1 - Mac Big Sur (11.5).

Failed tests are:

  • xammac_tests

Pipeline on Agent
[MetricKit] Add support for Xcode 13 beta4. (#12326)

@vs-mobiletools-engineering-service2
Copy link
Collaborator

Choose a reason for hiding this comment

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

✅ Tests passed on macOS Mac Mojave (10.14) ✅

Tests passed

All tests on macOS X Mac Mojave (10.14) passed.

Pipeline on Agent
[MetricKit] Add support for Xcode 13 beta4. (#12326)

Please sign in to comment.