Skip to content

Commit

Permalink
Merge pull request #2151 from microsoft/develop
Browse files Browse the repository at this point in the history
Merge develop to master for release 3.3.3
  • Loading branch information
MatkovIvan authored Aug 20, 2020
2 parents f2d162d + add1ecf commit ab06868
Show file tree
Hide file tree
Showing 40 changed files with 598 additions and 30 deletions.
61 changes: 61 additions & 0 deletions .azure-pipelines/analyze-and-test-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
parameters:
- name: platform
type: string

- name: modules
type: object

jobs:
- ${{ each module in parameters.modules }}:
- job:
displayName: ${{ format('{0} {1}', parameters.platform, module) }}
pool:
vmImage: internal-macos-10.15
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: Analyze
inputs:
actions: analyze
xcWorkspacePath: AppCenter.xcworkspace
${{ if eq(parameters.platform, 'MacCatalyst') }}:
scheme: '${{ module }} iOS Framework'
destinationPlatformOption: macOS
${{ if ne(parameters.platform, 'MacCatalyst') }}:
scheme: '${{ module }} ${{ parameters.platform }} Framework'
destinationPlatformOption: ${{ parameters.platform }}
${{ if eq(parameters.platform, 'iOS') }}:
destinationSimulators: 'iPhone 11'
${{ if eq(parameters.platform, 'tvOS') }}:
destinationSimulators: 'Apple TV'

- task: Xcode@5
displayName: Test
inputs:
actions: test
xcWorkspacePath: AppCenter.xcworkspace
${{ if eq(parameters.platform, 'MacCatalyst') }}:
scheme: '${{ module }} iOS Framework'
destinationPlatformOption: macOS
${{ if ne(parameters.platform, 'MacCatalyst') }}:
scheme: '${{ module }} ${{ parameters.platform }} Framework'
destinationPlatformOption: ${{ parameters.platform }}
${{ if eq(parameters.platform, 'iOS') }}:
destinationSimulators: 'iPhone 11'
${{ if eq(parameters.platform, 'tvOS') }}:
destinationSimulators: 'Apple TV'
publishJUnitResults: true
timeoutInMinutes: 10

- task: PublishBuildArtifacts@1
displayName: 'Publish Diagnostic Reports'
inputs:
PathtoPublish: /Users/runner/Library/Logs/DiagnosticReports
ArtifactName: 'Test Diagnostic Reports'
condition: failed()

- bash: 'bash <(curl -s https://codecov.io/bash) -X gcov -cF ${{ parameters.platform }}'
displayName: 'Upload Coverage Report to Codecov'

29 changes: 29 additions & 0 deletions .azure-pipelines/analyze-and-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pr:
- master
- develop
- feature/*

variables:
Configuration: Debug
SDK:

jobs:
- template: analyze-and-test-template.yml
parameters:
platform: iOS
modules: [ AppCenter, AppCenterAnalytics, AppCenterCrashes, AppCenterDistribute, AppCenterPush ]

- template: analyze-and-test-template.yml
parameters:
platform: macOS
modules: [ AppCenter, AppCenterAnalytics, AppCenterCrashes, AppCenterPush ]

- template: analyze-and-test-template.yml
parameters:
platform: tvOS
modules: [ AppCenter, AppCenterAnalytics, AppCenterCrashes ]

- template: analyze-and-test-template.yml
parameters:
platform: MacCatalyst
modules: [ AppCenter, AppCenterAnalytics, AppCenterCrashes ]
89 changes: 89 additions & 0 deletions .azure-pipelines/build-frameworks-and-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
trigger:
- master
- develop

pr:
- master
- develop
- feature/*

pool:
vmImage: internal-macos-10.15

variables:
Configuration: Release
SDK:

# Xcode 11.3.1 version is the last one that has compatible bitcode with Xcode 11.0 (minimal supported).
XCODE_PATH: '/Applications/Xcode_11.3.1.app/Contents/Developer'

jobs:
- job:
displayName: Build SDK for All Platforms
steps:
- checkout: self
submodules: recursive

- bash: |
version="$(Scripts/framework-version.sh)+$(git rev-parse --short $BUILD_SOURCEVERSION)"
echo "Change version to $version"
Scripts/framework-version.sh "$version"
displayName: 'Update Version'
condition: ne(variables['Build.SourceBranch'], 'refs/heads/master')
- bash: 'sudo gem install jazzy --no-document'
displayName: 'Install Jazzy'

- task: Xcode@5
displayName: Build
inputs:
xcWorkspacePath: AppCenter.xcworkspace
scheme: 'All Frameworks+Documentation'
xcodeVersion: specifyPath
xcodeDeveloperDir: '$(XCODE_PATH)'
timeoutInMinutes: 15

- task: Bash@3
displayName: Archive
inputs:
targetType: filePath
filePath: './Scripts/build-archive.sh'

- task: CopyFiles@2
displayName: 'Copy Archives to Staging Directory'
inputs:
SourceFolder: './AppCenter-SDK-Apple'
Contents: '**/AppCenter-SDK-Apple*.zip'
TargetFolder: '$(Build.ArtifactStagingDirectory)'

- task: PublishBuildArtifacts@1
displayName: 'Publish Artifacts'
inputs:
ArtifactName: Release

- job:
displayName: Version Information
steps:
- bash: |
swift --version
swift package describe
displayName: 'Print Swift Package Information'
- task: ms.vss-governance-buildtask.governance-build-task-component-detection.ComponentGovernanceComponentDetection@0
displayName: 'Component Detection'
inputs:
failOnAlert: true

- bash: |
VERSION=$(Scripts/framework-version.sh)
mkdir -p $(Build.ArtifactStagingDirectory)/Info
echo $VERSION > $(Build.ArtifactStagingDirectory)/Info/VERSION
echo $BUILD_SOURCEVERSION > $(Build.ArtifactStagingDirectory)/Info/COMMIT
Scripts/get-release-notes.sh $VERSION > $(Build.ArtifactStagingDirectory)/Info/RELEASE.md
displayName: 'Collect Version Information'
- task: PublishBuildArtifacts@1
displayName: 'Publish Version Information'
inputs:
PathtoPublish: '$(Build.ArtifactStagingDirectory)/Info'
ArtifactName: Info
99 changes: 99 additions & 0 deletions .azure-pipelines/build-test-apps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
pr:
- master
- develop
- feature/*

pool:
vmImage: internal-macos-10.15

variables:
Configuration: Release
SDK:

jobs:
- job:
displayName: Puppet iOS
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: 'Sasquatch iOS Puppet Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchPuppet

- job:
displayName: Puppet Mac Catalyst
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: 'Sasquatch Mac Catalyst Puppet Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchPuppet
destinationPlatformOption: macOS

- job:
displayName: Sasquatch iOS
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: 'Sasquatch iOS Objective-C Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchObjC

- task: Xcode@5
displayName: 'Sasquatch iOS Swift Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchSwift

- job:
displayName: Sasquatch macOS
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: 'Sasquatch macOS Objective-C Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchMacObjC

- task: Xcode@5
displayName: 'Sasquatch macOS Swift Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchMacSwift

- job:
displayName: Sasquatch tvOS
steps:
- checkout: self
submodules: recursive

- task: Xcode@5
displayName: 'Sasquatch tvOS Objective-C Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchTVObjC

- task: Xcode@5
displayName: 'Sasquatch tvOS Swift Archive'
inputs:
actions: archive
xcWorkspacePath: AppCenter.xcworkspace
scheme: SasquatchTVSwift
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 = '3.3.2'
s.version = '3.3.3'

s.summary = 'Visual Studio App Center is your continuous integration, delivery and learning solution for iOS and macOS apps.'
s.description = <<-DESC
Expand Down
23 changes: 23 additions & 0 deletions AppCenter/AppCenter/Internals/Channel/MSChannelGroupDefault.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#import "MSChannelGroupDefaultPrivate.h"
#import "MSChannelUnitConfiguration.h"
#import "MSChannelUnitDefault.h"
#import "MSDispatcherUtil.h"
#import "MSLogDBStorage.h"

static char *const kMSLogsDispatchQueue = "com.microsoft.appcenter.ChannelGroupQueue";
Expand Down Expand Up @@ -177,6 +178,17 @@ - (void)channel:(id<MSChannelProtocol>)channel didResumeWithIdentifyingObject:(i

- (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData {

#if !TARGET_OS_OSX
if (isEnabled) {
[MS_NOTIFICATION_CENTER addObserver:self
selector:@selector(applicationWillTerminate:)
name:UIApplicationWillTerminateNotification
object:nil];
} else {
[MS_NOTIFICATION_CENTER removeObserver:self];
}
#endif

// Propagate to ingestion.
[self.ingestion setEnabled:isEnabled andDeleteDataOnDisabled:deleteData];

Expand All @@ -199,6 +211,17 @@ - (void)setEnabled:(BOOL)isEnabled andDeleteDataOnDisabled:(BOOL)deleteData {
*/
}

#if !TARGET_OS_OSX
- (void)applicationWillTerminate:(__unused UIApplication *)application {

// Block logs queue so that it isn't killed before app termination.
[MSDispatcherUtil dispatchSyncWithTimeout:1
onQueue:self.logsDispatchQueue
withBlock:^{
}];
}
#endif

#pragma mark - Pause / Resume

- (void)pauseWithIdentifyingObject:(id<NSObject>)identifyingObject {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
NS_ASSUME_NONNULL_BEGIN

@class MSAppCenterIngestion;
@class UIApplication;

@interface MSChannelGroupDefault () <MSChannelDelegate>

Expand All @@ -18,6 +19,15 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (instancetype)initWithIngestion:(nullable MSAppCenterIngestion *)ingestion;

#if !TARGET_OS_OSX

/**
* Called when applciation is terminating.
*/
- (void)applicationWillTerminate:(UIApplication *)application;

#endif

@end

NS_ASSUME_NONNULL_END
8 changes: 8 additions & 0 deletions AppCenter/AppCenter/Internals/Util/MSDispatcherUtil.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,12 @@

+ (void)performBlockOnMainThread:(void (^)(void))block;

/**
* Adds a dispatch_async block to the provided queue and waits for its execution.
* @param timeout Timeout for waiting in seconds.
* @param dispatchQueue The queue to perform a block on.
* @param block The block to be executed.
*/
+ (void)dispatchSyncWithTimeout:(NSTimeInterval)timeout onQueue:(dispatch_queue_t)dispatchQueue withBlock:(dispatch_block_t)block;

@end
8 changes: 8 additions & 0 deletions AppCenter/AppCenter/Internals/Util/MSDispatcherUtil.m
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,12 @@ + (void)runBlock:(void (^)(void))block {
block();
}

+ (void)dispatchSyncWithTimeout:(NSTimeInterval)timeout onQueue:(dispatch_queue_t)dispatchQueue withBlock:(dispatch_block_t)block {
dispatch_semaphore_t delayedProcessingSemaphore = dispatch_semaphore_create(0);
dispatch_async(dispatchQueue, ^{
block();
dispatch_semaphore_signal(delayedProcessingSemaphore);
});
dispatch_semaphore_wait(delayedProcessingSemaphore, dispatch_time(DISPATCH_TIME_NOW, (int64_t)(timeout * NSEC_PER_SEC)));
}
@end
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ - (BOOL)connectionRequired {
SCNetworkReachabilityFlags flags;

if (SCNetworkReachabilityGetFlags(self.reachabilityRef, &flags)) {
return (flags & kSCNetworkReachabilityFlagsConnectionRequired);
return (flags & kSCNetworkReachabilityFlagsConnectionRequired) != 0;
}

return NO;
Expand Down
Loading

0 comments on commit ab06868

Please sign in to comment.