-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[BackgroundAssets] Add new framework from Xcode1 4 beta 4. (#15649)
Co-authored-by: Alex Soto <alex@alexsoto.me>
- Loading branch information
1 parent
f35cc9b
commit d9cd069
Showing
9 changed files
with
194 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
// | ||
// BackgroundAssets C# bindings | ||
// | ||
// Authors: | ||
// Manuel de la Pena Saenz <mandel@microsoft.com> | ||
// | ||
// Copyright 2022 Microsoft Corporation All rights reserved. | ||
// | ||
|
||
using System; | ||
|
||
using CoreFoundation; | ||
using Foundation; | ||
using ObjCRuntime; | ||
|
||
#if !NET | ||
using NativeHandle = System.IntPtr; | ||
#endif | ||
|
||
namespace BackgroundAssets { | ||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[Native] | ||
public enum BADownloadState : long { | ||
Failed = -1, | ||
Created = 0, | ||
Waiting, | ||
Downloading, | ||
Finished, | ||
} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface BADownload : NSCoding, NSSecureCoding, NSCopying | ||
{ | ||
[Export ("state")] | ||
BADownloadState State { get; } | ||
|
||
[Export ("identifier")] | ||
string Identifier { get; } | ||
|
||
[Export ("uniqueIdentifier")] | ||
string UniqueIdentifier { get; } | ||
|
||
[Export ("priority")] | ||
nint Priority { get; } | ||
|
||
[NullAllowed, Export ("error")] | ||
NSError Error { get; } | ||
} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface BAApplicationExtensionInfo : NSSecureCoding | ||
{ | ||
[Export ("applicationIdentifier")] | ||
string ApplicationIdentifier { get; } | ||
|
||
[NullAllowed, Export ("lastPeriodicCheckTime")] | ||
NSDate LastPeriodicCheckTime { get; } | ||
|
||
[NullAllowed, Export ("lastApplicationLaunchTime")] | ||
NSDate LastApplicationLaunchTime { get; } | ||
|
||
[Export ("downloadSizeRestricted")] | ||
bool DownloadSizeRestricted { get; } | ||
} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[Protocol] | ||
interface BADownloaderExtension { | ||
|
||
[Export ("applicationDidInstallWithMetadata:")] | ||
void DidInstallWithMetadata (BAApplicationExtensionInfo metadata); | ||
|
||
[Export ("applicationDidUpdateWithMetadata:")] | ||
void DidUpdateWithMetadata (BAApplicationExtensionInfo metadata); | ||
|
||
[Export ("checkForUpdatesWithMetadata:")] | ||
void CheckForUpdates (BAApplicationExtensionInfo metadata); | ||
|
||
[Export ("receivedAuthenticationChallenge:download:completionHandler:")] | ||
void ReceivedAuthenticationChallenge (NSUrlAuthenticationChallenge challenge, BADownload download, Action<NSUrlSessionAuthChallengeDisposition, NSUrlCredential> completionHandler); | ||
|
||
[Export ("backgroundDownloadDidFail:")] | ||
void BackgroundDownloadDidFail (BADownload failedDownload); | ||
|
||
[Export ("backgroundDownloadDidFinish:fileURL:")] | ||
void BackgroundDownloadDidFinish (BADownload finishedDownload, NSUrl fileUrl); | ||
|
||
[Export ("extensionWillTerminate")] | ||
void ExtensionWillTerminate (); | ||
} | ||
|
||
interface IBADownloadManagerDelegate {} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
#if NET | ||
[Protocol][Model] | ||
#else | ||
[Protocol][Model (AutoGeneratedName = true)] | ||
#endif | ||
[BaseType (typeof (NSObject))] | ||
interface BADownloadManagerDelegate | ||
{ | ||
[Export ("downloadDidBegin:")] | ||
void DidBegin (BADownload download); | ||
|
||
[Export ("downloadDidPause:")] | ||
void DidPause (BADownload download); | ||
|
||
[Export ("download:didWriteBytes:totalBytesWritten:totalBytesExpectedToWrite:")] | ||
void DidWriteBytes (BADownload download, long bytesWritten, long totalBytesWritten, long totalExpectedBytes); | ||
|
||
[Export ("download:didReceiveChallenge:completionHandler:")] | ||
void DidReceiveChallenge (BADownload download, NSUrlAuthenticationChallenge challenge, Action<NSUrlSessionAuthChallengeDisposition, NSUrlCredential> completionHandler); | ||
|
||
[Export ("download:failedWithError:")] | ||
void Failed (BADownload download, NSError error); | ||
|
||
[Export ("download:finishedWithFileURL:")] | ||
void Finished (BADownload download, NSUrl fileUrl); | ||
} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (NSObject))] | ||
[DisableDefaultCtor] | ||
interface BADownloadManager | ||
{ | ||
[Static] | ||
[Export ("sharedManager", ArgumentSemantic.Strong)] | ||
BADownloadManager SharedManager { get; } | ||
|
||
[Wrap ("WeakDelegate")] | ||
[NullAllowed] | ||
IBADownloadManagerDelegate Delegate { get; set; } | ||
|
||
[NullAllowed, Export ("delegate", ArgumentSemantic.Weak)] | ||
NSObject WeakDelegate { get; set; } | ||
|
||
[Async] | ||
[Export ("fetchCurrentDownloadsWithCompletionHandler:")] | ||
void FetchCurrentDownloads (Action<NSArray<BADownload>, NSError> completionHandler); | ||
|
||
[Export ("scheduleDownload:error:")] | ||
bool ScheduleDownload (BADownload download, [NullAllowed] out NSError outError); | ||
|
||
[Export ("performWithExclusiveControl:")] | ||
void PerformWithExclusiveControl (Action<NSError> performHandler); | ||
|
||
[Export ("performWithExclusiveControlBeforeDate:completion:")] | ||
void PerformWithExclusiveControl (NSDate date, Action<bool, NSError> performHandler); | ||
|
||
[Export ("startForegroundDownload:error:")] | ||
bool StartForegroundDownload (BADownload download, [NullAllowed] out NSError outError); | ||
|
||
[Export ("cancelDownload:error:")] | ||
bool CancelDownload (BADownload download, [NullAllowed] out NSError error); | ||
} | ||
|
||
[NoWatch, NoTV, Mac (13,0), iOS (16,0), MacCatalyst (16,0)] | ||
[BaseType (typeof (BADownload), Name = "BAURLDownload")] | ||
[DisableDefaultCtor] | ||
interface BAUrlDownload | ||
{ | ||
|
||
[Field ("BADownloaderPriorityMin")] | ||
nint MinPriority { get; } | ||
|
||
[Field ("BADownloaderPriorityDefault")] | ||
nint DefaultPriority { get; } | ||
|
||
[Field ("BADownloaderPriorityMax")] | ||
nint MaxPriority { get; } | ||
|
||
[Export ("initWithIdentifier:request:applicationGroupIdentifier:")] | ||
NativeHandle Constructor (string identifier, NSUrlRequest request, string applicationGroupIdentifier); | ||
|
||
[Export ("initWithIdentifier:request:applicationGroupIdentifier:priority:")] | ||
[DesignatedInitializer] | ||
NativeHandle Constructor (string identifier, NSUrlRequest request, string applicationGroupIdentifier, nint priority); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 0 additions & 30 deletions
30
tests/xtro-sharpie/api-annotations-dotnet/iOS-BackgroundAssets.todo
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
tests/xtro-sharpie/api-annotations-dotnet/macOS-BackgroundAssets.todo
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d9cd069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💻 [CI Build] Tests on macOS Mac Catalina (10.15) passed 💻
✅ All tests on macOS Mac Catalina (10.15) passed.
Pipeline on Agent
Hash: d9cd069f07bab1f1a3d2bbdef8f5e8e7c9ce8eba [CI build]
d9cd069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
✅ API diff for current PR / commit
Legacy Xamarin (No breaking changes)
tvOS(no change detected)watchOS(no change detected).NET (No breaking changes)
tvOS: (empty diff detected)❗ API diff vs stable (Breaking changes)
Legacy Xamarin (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
.NET (:heavy_exclamation_mark: Breaking changes :heavy_exclamation_mark:)
Legacy Xamarin (stable) vs .NET
ℹ️ Generator diff
Generator Diff: vsdrops (html) vsdrops (raw diff) gist (raw diff) - Please review changes)
Pipeline on Agent
Hash: d9cd069f07bab1f1a3d2bbdef8f5e8e7c9ce8eba [CI build]
d9cd069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❌ [CI Build] Tests on macOS M1 - Mac Big Sur (11.5) failed ❌
Tests timed out
Pipeline on Agent
Hash: d9cd069f07bab1f1a3d2bbdef8f5e8e7c9ce8eba [CI build]
d9cd069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📚 [CI Build] Artifacts 📚
Packages generated
View packages
Pipeline on Agent XAMMINI-068.Monterey'
Hash: d9cd069f07bab1f1a3d2bbdef8f5e8e7c9ce8eba [CI build]
d9cd069
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🔥 [CI Build] Test results 🔥
Test results
❌ Tests failed on VSTS: simulator tests
0 tests crashed, 3 tests failed, 225 tests passed.
Failures
❌ introspection tests
Html Report (VSDrops) Download
❌ monotouch tests
Test run crashed)
Html Report (VSDrops) Download
Successes
✅ bcl: All 69 tests passed. Html Report (VSDrops) Download
✅ cecil: All 1 tests passed. Html Report (VSDrops) Download
✅ dotnettests: All 1 tests passed. Html Report (VSDrops) Download
✅ fsharp: All 7 tests passed. Html Report (VSDrops) Download
✅ framework: All 8 tests passed. Html Report (VSDrops) Download
✅ generator: All 2 tests passed. Html Report (VSDrops) Download
✅ interdependent_binding_projects: All 7 tests passed. Html Report (VSDrops) Download
✅ install_source: All 1 tests passed. Html Report (VSDrops) Download
✅ linker: All 65 tests passed. Html Report (VSDrops) Download
✅ mac_binding_project: All 1 tests passed. Html Report (VSDrops) Download
✅ mmp: All 2 tests passed. Html Report (VSDrops) Download
✅ mononative: All 12 tests passed. Html Report (VSDrops) Download
✅ msbuild: All 2 tests passed. Html Report (VSDrops) Download
✅ mtouch: All 1 tests passed. Html Report (VSDrops) Download
✅ xammac: All 3 tests passed. Html Report (VSDrops) Download
✅ xcframework: All 8 tests passed. Html Report (VSDrops) Download
✅ xtro: All 2 tests passed. Html Report (VSDrops) Download
Pipeline on Agent
Hash: [CI build]