Skip to content

Commit

Permalink
Merge pull request #1168 from Microsoft/develop
Browse files Browse the repository at this point in the history
Merge to master for release
  • Loading branch information
Murat Baysangurov authored Oct 16, 2018
2 parents f9adec7 + b2ddc1c commit d883d04
Show file tree
Hide file tree
Showing 414 changed files with 13,185 additions and 13,108 deletions.
3 changes: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
BasedOnStyle: LLVM
ColumnLimit: 140
UseTab: Never
2 changes: 1 addition & 1 deletion AppCenter.podspec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AppCenter'
s.version = '1.9.0'
s.version = '1.10.0'

s.summary = 'Visual Studio App Center is your continuous integration, delivery and learning solution for iOS and macOS apps.'
s.description = <<-DESC
Expand Down
237 changes: 219 additions & 18 deletions AppCenter/AppCenter.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,8 @@ typedef NS_OPTIONS(NSUInteger, MSCompletionExecutor) {
*
* @param selector An app delegate selector to swizzle.
*
* @discussion Due to the early registration of swizzling on the original app
* delegate each custom delegate must sign up for selectors to swizzle within
* the `load` method of a category over the @see MSAppDelegateForwarder class.
* @discussion Due to the early registration of swizzling on the original app delegate each custom delegate must sign up for selectors to
* swizzle within the `load` method of a category over the @see MSAppDelegateForwarder class.
*/
+ (void)addAppDelegateSelectorToSwizzle:(SEL)selector;

Expand Down
170 changes: 56 additions & 114 deletions AppCenter/AppCenter/Internals/AppDelegate/MSAppDelegateForwarder.m

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -7,26 +7,22 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Hash table containing all the delegates as weak references.
*/
@property(nonatomic, class)
NSHashTable<id<MSCustomApplicationDelegate>> *delegates;
@property(nonatomic, class) NSHashTable<id<MSCustomApplicationDelegate>> *delegates;

/**
* Keep track of original selectors to swizzle.
*/
@property(nonatomic, class, readonly)
NSMutableSet<NSString *> *selectorsToSwizzle;
@property(nonatomic, class, readonly) NSMutableSet<NSString *> *selectorsToSwizzle;

/**
* Dictionary of deprecated original selectors indexed by their new equivalent.
*/
@property(nonatomic, class, readonly)
NSDictionary<NSString *, NSString *> *deprecatedSelectors;
@property(nonatomic, class, readonly) NSDictionary<NSString *, NSString *> *deprecatedSelectors;

/**
* Keep track of the original delegate's method implementations.
*/
@property(nonatomic, class, readonly)
NSMutableDictionary<NSString *, NSValue *> *originalImplementations;
@property(nonatomic, class, readonly) NSMutableDictionary<NSString *, NSValue *> *originalImplementations;

#if TARGET_OS_OSX
/**
Expand Down
6 changes: 6 additions & 0 deletions AppCenter/AppCenter/Internals/AppDelegate/MSAppDelegateUtil.h
Original file line number Diff line number Diff line change
@@ -1,18 +1,24 @@
#import <Foundation/Foundation.h>

#if TARGET_OS_OSX
#import <AppKit/AppKit.h>

#ifndef MSApplicationDelegate
#define MSApplicationDelegate NSApplicationDelegate
#endif

#ifndef MSApplication
#define MSApplication NSApplication
#endif
#else
#import <UIKit/UIKit.h>

#ifndef MSApplicationDelegate
#define MSApplicationDelegate UIApplicationDelegate
#endif

#ifndef MSApplication
#define MSApplication UIApplication
#endif

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,9 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Custom delegate matching `UIApplicationDelegate`.
*
* @discussion Delegates here are using swizzling. Any delegate that can be
* registered through the notification center should not be registered through
* swizzling. Due to the early registration of swizzling on the original app
* delegate each custom delegate must sign up for selectors to swizzle within
* the `load` method of a category over the @see MSAppDelegateForwarder class.
* @discussion Delegates here are using swizzling. Any delegate that can be registered through the notification center should not be
* registered through swizzling. Due to the early registration of swizzling on the original app delegate each custom delegate must sign up
* for selectors to swizzle within the `load` method of a category over the @see MSAppDelegateForwarder class.
*/
@protocol MSCustomApplicationDelegate <NSObject>

Expand All @@ -18,20 +16,15 @@ NS_ASSUME_NONNULL_BEGIN
#if !TARGET_OS_OSX

/**
* Asks the delegate to open a resource specified by a URL, and provides a
* dictionary of launch options.
* Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options.
*
* @param application The singleton app object.
* @param url The URL resource to open. This resource can be a network resource
* or a file.
* @param sourceApplication The bundle ID of the app that is requesting your app
* to open the URL (url).
* @param annotation A Property list supplied by the source app to communicate
* information to the receiving app.
* @param url The URL resource to open. This resource can be a network resource or a file.
* @param sourceApplication The bundle ID of the app that is requesting your app to open the URL (url).
* @param annotation A Property list supplied by the source app to communicate information to the receiving app.
* @param returnedValue Value returned by the original delegate implementation.
*
* @return `YES` if the delegate successfully handled the request or `NO` if the
* attempt to open the URL resource failed.
* @return `YES` if the delegate successfully handled the request or `NO` if the attempt to open the URL resource failed.
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
Expand All @@ -40,20 +33,15 @@ NS_ASSUME_NONNULL_BEGIN
returnedValue:(BOOL)returnedValue;

/**
* Asks the delegate to open a resource specified by a URL, and provides a
* dictionary of launch options.
* Asks the delegate to open a resource specified by a URL, and provides a dictionary of launch options.
*
* @param application The singleton app object.
* @param url The URL resource to open. This resource can be a network resource
* or a file.
* @param options A dictionary of URL handling options.
* For information about the possible keys in this dictionary and how to handle
* them, @see UIApplicationOpenURLOptionsKey. By default, the value of this
* parameter is an empty dictionary.
* @param url The URL resource to open. This resource can be a network resource or a file.
* @param options A dictionary of URL handling options. For information about the possible keys in this dictionary and how to handle them,
* @see UIApplicationOpenURLOptionsKey. By default, the value of this parameter is an empty dictionary.
* @param returnedValue Value returned by the original delegate implementation.
*
* @return `YES` if the delegate successfully handled the request or `NO` if the
* attempt to open the URL resource failed.
* @return `YES` if the delegate successfully handled the request or `NO` if the attempt to open the URL resource failed.
*/
- (BOOL)application:(UIApplication *)application
openURL:(NSURL *)url
Expand Down
1 change: 1 addition & 0 deletions AppCenter/AppCenter/Internals/Channel/MSCSEpochAndSeq.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ - (instancetype)initWithEpoch:(NSString *)epoch {
}
return self;
}

@end
56 changes: 29 additions & 27 deletions AppCenter/AppCenter/Internals/Channel/MSChannelDelegate.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#import <Foundation/Foundation.h>

@protocol MSLog;
@protocol MSChannelUnitProtocol;
@protocol MSChannelGroupProtocol;
@protocol MSChannelProtocol;
@protocol MSLog;

@protocol MSChannelDelegate <NSObject>

Expand All @@ -15,12 +15,10 @@
* @param channelGroup The channel group.
* @param channel The newly added channel.
*/
- (void)channelGroup:(id<MSChannelGroupProtocol>)channelGroup
didAddChannelUnit:(id<MSChannelUnitProtocol>)channel;
- (void)channelGroup:(id<MSChannelGroupProtocol>)channelGroup didAddChannelUnit:(id<MSChannelUnitProtocol>)channel;

/**
* A callback that is called when a log is just enqueued. Delegates may want to
* prepare the log a little more before further processing.
* A callback that is called when a log is just enqueued. Delegates may want to prepare the log a little more before further processing.
*
* @param log The log to prepare.
*/
Expand All @@ -32,24 +30,18 @@
* @param log The log.
* @param internalId An internal Id to keep track of logs.
*/
- (void)channel:(id<MSChannelProtocol>)channel
didPrepareLog:(id<MSLog>)log
withInternalId:(NSString *)internalId;
- (void)channel:(id<MSChannelProtocol>)channel didPrepareLog:(id<MSLog>)log withInternalId:(NSString *)internalId;

/**
* A callback that is called after a log completed the enqueueing process
* weither it was successfull or not.
* A callback that is called after a log completed the enqueueing process weither it was successfull or not.
*
* @param log The log.
* @param internalId An internal Id to keep track of logs.
*/
- (void)channel:(id<MSChannelProtocol>)channel
didCompleteEnqueueingLog:(id<MSLog>)log
withInternalId:(NSString *)internalId;
- (void)channel:(id<MSChannelProtocol>)channel didCompleteEnqueueingLog:(id<MSLog>)log withInternalId:(NSString *)internalId;

/**
* Callback method that will be called before each log will be send to the
* server.
* Callback method that will be called before each log will be send to the server.
*
* @param channel The channel object.
* @param log The log to be sent.
Expand All @@ -62,8 +54,7 @@
* @param channel The channel object.
* @param log The log to be sent.
*/
- (void)channel:(id<MSChannelProtocol>)channel
didSucceedSendingLog:(id<MSLog>)log;
- (void)channel:(id<MSChannelProtocol>)channel didSucceedSendingLog:(id<MSLog>)log;

/**
* Callback method that will be called in case the SDK was unable to send a log.
Expand All @@ -72,9 +63,7 @@
* @param log The log to be sent.
* @param error The error that occured.
*/
- (void)channel:(id<MSChannelProtocol>)channel
didFailSendingLog:(id<MSLog>)log
withError:(NSError *)error;
- (void)channel:(id<MSChannelProtocol>)channel didFailSendingLog:(id<MSLog>)log withError:(NSError *)error;

/**
* A callback that is called when setEnabled has been invoked.
Expand All @@ -83,20 +72,33 @@
* @param isEnabled The boolean that indicates enabled.
* @param deletedData The boolean that indicates deleting data on disabled.
*/
- (void)channel:(id<MSChannelProtocol>)channel
didSetEnabled:(BOOL)isEnabled
andDeleteDataOnDisabled:(BOOL)deletedData;
- (void)channel:(id<MSChannelProtocol>)channel didSetEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deletedData;

/**
* A callback that is called when pause has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to pause the channel.
*/
- (void)channel:(id<MSChannelProtocol>)channel didPauseWithIdentifyingObject:(id<NSObject>)identifyingObject;

/**
* A callback that is called when resume has been invoked.
*
* @param channel The channel.
* @param identifyingObject The identifying object used to resume the channel.
*/
- (void)channel:(id<MSChannelProtocol>)channel didResumeWithIdentifyingObject:(id<NSObject>)identifyingObject;

/**
* Callback method that will determine if a log should be filtered out from the
* usual processing pipeline. If any delegate returns true, the log is filtered.
* Callback method that will determine if a log should be filtered out from the usual processing pipeline. If any delegate returns true, the
* log is filtered.
*
* @param channelUnit The channel unit that is going to send the log.
* @param log The log to be filtered or not.
*
* @return `true` if the log should be filtered out.
*/
- (BOOL)channelUnit:(id<MSChannelUnitProtocol>)channelUnit
shouldFilterLog:(id<MSLog>)log;
- (BOOL)channelUnit:(id<MSChannelUnitProtocol>)channelUnit shouldFilterLog:(id<MSLog>)log;

@end
19 changes: 8 additions & 11 deletions AppCenter/AppCenter/Internals/Channel/MSChannelGroupDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,15 @@

NS_ASSUME_NONNULL_BEGIN

@class MSHttpIngestion;
@class MSAppCenterIngestion;

@protocol MSStorage;

/**
* A channel group which triggers and manages the processing of log items on
* different channels. All items will be immediately passed to the persistence
* layer in order to make the queue crash safe. Once a maximum number of items
* have been enqueued or the internal timer finished running, events will be
* forwarded to the ingestion. Furthermore, its responsibility is to tell the
* persistence layer what to do with a pending batch based on the status code
* returned by the ingestion
* A channel group which triggers and manages the processing of log items on different channels. All items will be immediately passed to the
* persistence layer in order to make the queue crash safe. Once a maximum number of items have been enqueued or the internal timer finished
* running, events will be forwarded to the ingestion. Furthermore, its responsibility is to tell the persistence layer what to do with a
* pending batch based on the status code returned by the ingestion
*/
@interface MSChannelGroupDefault : NSObject <MSChannelGroupProtocol>

Expand All @@ -35,10 +33,9 @@ NS_ASSUME_NONNULL_BEGIN
@property(nonatomic) NSHashTable<id<MSChannelDelegate>> *delegates;

/**
* An ingestion instance that is used to send batches of log items to the
* backend.
* An ingestion instance that is used to send batches of log items to the backend.
*/
@property(nonatomic, strong, nullable) MSHttpIngestion *ingestion;
@property(nonatomic, strong, nullable) MSAppCenterIngestion *ingestion;

/**
* A storage instance to store and read enqueued log items.
Expand Down
Loading

0 comments on commit d883d04

Please sign in to comment.