Skip to content

Commit

Permalink
Merge branch 'release/2.0.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
pyby committed Dec 17, 2019
2 parents 7317982 + 5193770 commit ff63e31
Show file tree
Hide file tree
Showing 21 changed files with 305 additions and 151 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ xcuserdata

/Carthage

/fastlane/*.xcresult
/fastlane/*.xml

/vendor
Expand Down
4 changes: 4 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
language: objective-c
osx_image: xcode11.2
script:
- bundle exec fastlane ios tests
29 changes: 29 additions & 0 deletions Common.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// Version information
MARKETING_VERSION = 2.0.0

// Deployment targets
IPHONEOS_DEPLOYMENT_TARGET = 9.0
TVOS_DEPLOYMENT_TARGET = 12.0
WATCHOS_DEPLOYMENT_TARGET = 5.0

// Configuration to have a single target built for all platforms
// See https://davedelong.com/blog/2018/11/15/building-a-crossplatform-framework/
SUPPORTED_PLATFORMS = iphoneos iphonesimulator watchos watchsimulator appletvos appletvsimulator
TARGETED_DEVICE_FAMILY = 1,2,3,4

CARTHAGE_PLATFORM[sdk=iphone*] = iOS
CARTHAGE_PLATFORM[sdk=appletv*] = tvOS
CARTHAGE_PLATFORM[sdk=watch*] = watchOS

// Setup to enable plaform suffixes to enable sources or resources for a specific platform only
// See https://davedelong.com/blog/2018/07/25/conditional-compilation-in-swift-part-2/
IOS_FILES = *~ios.*
TVOS_FILES = *~tvos.*
WATCHOS_FILES = *~watchos.*

EXCLUDED_SOURCE_FILE_NAMES = $(IOS_FILES) $(TVOS_FILES) $(WATCHOS_FILES)

INCLUDED_SOURCE_FILE_NAMES =
INCLUDED_SOURCE_FILE_NAMES[sdk=iphone*] = $(IOS_FILES)
INCLUDED_SOURCE_FILE_NAMES[sdk=appletv*] = $(TVOS_FILES)
INCLUDED_SOURCE_FILE_NAMES[sdk=watch*] = $(WATCHOS_FILES)
1 change: 1 addition & 0 deletions Framework/Framework.xcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
#include "../Common.xcconfig"
2 changes: 1 addition & 1 deletion Framework/Sources/Helpers/NSTimer+SRGDiagnostics.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ + (NSTimer *)srgdiagnostics_timerWithTimeInterval:(NSTimeInterval)interval repea
{
NSTimer *timer = nil;

if (@available(iOS 10, *)) {
if (@available(iOS 10, tvOS 10, *)) {
timer = [self timerWithTimeInterval:interval repeats:repeats block:block];
}
else {
Expand Down
10 changes: 5 additions & 5 deletions Framework/Sources/SRGDiagnosticInformation.m
Original file line number Diff line number Diff line change
Expand Up @@ -136,12 +136,12 @@ - (NSDictionary *)timeMeasurementsDictionary
- (NSDictionary<NSString *,id> *)JSONDictionary
{
@synchronized(self) {
NSMutableDictionary *dictionary = [self.values mutableCopy];
NSMutableDictionary *dictionary = self.values.mutableCopy;
[dictionary addEntriesFromDictionary:[self timeMeasurementsDictionary]];
[self.informationEntries enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, SRGDiagnosticInformation * _Nonnull information, BOOL * _Nonnull stop) {
dictionary[key] = [information JSONDictionary];
}];
return [dictionary copy];
return dictionary.copy;
}
}

Expand All @@ -151,12 +151,12 @@ - (id)copyWithZone:(NSZone *)zone
{
@synchronized(self) {
SRGDiagnosticInformation *information = [[SRGDiagnosticInformation alloc] init];
information.values = [self.values mutableCopy];
information.timeMeasurements = [self.timeMeasurements mutableCopy];
information.values = self.values.mutableCopy;
information.timeMeasurements = self.timeMeasurements.mutableCopy;

NSMutableDictionary<NSString *, SRGDiagnosticInformation *> *informationEntries = [NSMutableDictionary dictionary];
[self.informationEntries enumerateKeysAndObjectsUsingBlock:^(NSString * _Nonnull key, SRGDiagnosticInformation * _Nonnull information, BOOL * _Nonnull stop) {
informationEntries[key] = [information copy];
informationEntries[key] = information.copy;
}];
information.informationEntries = informationEntries;
return information;
Expand Down
7 changes: 7 additions & 0 deletions Framework/Sources/SRGDiagnosticReport.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,13 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)finish;

/**
* Discard the report.
*
* @discussion Finished reports cannot be discarded. Finishing discarded reports does nothing.
*/
- (void)discard;

@end

NS_ASSUME_NONNULL_END
7 changes: 6 additions & 1 deletion Framework/Sources/SRGDiagnosticReport.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,16 @@ - (instancetype)init

#pragma clang diagnostic pop

#pragma mark Submission
#pragma mark Operations

- (void)finish
{
[self.diagnosticsService prepareToSubmitReport:self];
}

- (void)discard
{
[self.diagnosticsService discardReport:self];
}

@end
5 changes: 5 additions & 0 deletions Framework/Sources/SRGDiagnosticsService+Private.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ NS_ASSUME_NONNULL_BEGIN
*/
- (void)prepareToSubmitReport:(SRGDiagnosticReport *)report;

/**
* Discard the specified report.
*/
- (void)discardReport:(SRGDiagnosticReport *)report;

@end

NS_ASSUME_NONNULL_END
14 changes: 12 additions & 2 deletions Framework/Sources/SRGDiagnosticsService.m
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,17 @@ - (void)prepareToSubmitReport:(SRGDiagnosticReport *)report
NSString *identifier = [self.reports allKeysForObject:report].firstObject;
if (identifier) {
[self.reports removeObjectForKey:identifier];
[self.finishedReports addObject:[report copy]];
[self.finishedReports addObject:report.copy];
}
}
}

- (void)discardReport:(SRGDiagnosticReport *)report
{
@synchronized (self) {
NSString *identifier = [self.reports allKeysForObject:report].firstObject;
if (identifier) {
[self.reports removeObjectForKey:identifier];
}
}
}
Expand All @@ -124,7 +134,7 @@ - (void)submitFinishedReports
self.submitting = YES;

__block NSUInteger processedReports = 0;
NSArray<SRGDiagnosticReport *> *finishedReports = [self.finishedReports copy];
NSArray<SRGDiagnosticReport *> *finishedReports = self.finishedReports.copy;
for (SRGDiagnosticReport *report in finishedReports) {
void (^completionBlock)(BOOL) = ^(BOOL success) {
@synchronized(self) {
Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# frozen_string_literal: true

# Autogenerated by fastlane
#
# Ensure this file is checked in to source control!

source "https://rubygems.org"
source 'https://rubygems.org'

gem 'fastlane'

Expand Down
94 changes: 51 additions & 43 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,33 +1,44 @@
GIT
remote: https://github.com/SRGSSR/trainer
revision: b39b3a996a18d87b8f19ce3e31a607198ce34581
tag: 0.9.1.1
specs:
fastlane-plugin-trainer (0.4.1)
trainer (>= 0.7.0)
trainer (0.9.1.1)
fastlane (>= 2.25.0)
plist (>= 3.1.0, < 4.0.0)

GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.0)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
CFPropertyList (3.0.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
atomos (0.1.3)
babosa (1.0.2)
claide (1.0.2)
babosa (1.0.3)
claide (1.0.3)
colored (1.2)
colored2 (3.1.2)
commander-fastlane (4.4.6)
highline (~> 1.7.2)
declarative (0.0.10)
declarative-option (0.1.0)
digest-crc (0.4.1)
domain_name (0.5.20180417)
domain_name (0.5.20190701)
unf (>= 0.0.5, < 1.0.0)
dotenv (2.6.0)
dotenv (2.7.5)
emoji_regex (1.0.1)
excon (0.62.0)
faraday (0.15.4)
excon (0.71.0)
faraday (0.17.1)
multipart-post (>= 1.2, < 3)
faraday-cookie_jar (0.0.6)
faraday (>= 0.7.4)
http-cookie (~> 1.0.0)
faraday_middleware (0.13.1)
faraday (>= 0.7.4, < 1.0)
fastimage (2.1.5)
fastlane (2.116.0)
fastimage (2.1.7)
fastlane (2.137.0)
CFPropertyList (>= 2.3, < 4.0.0)
addressable (>= 2.3, < 3.0.0)
babosa (>= 1.0.2, < 2.0.0)
Expand All @@ -37,35 +48,34 @@ GEM
dotenv (>= 2.1.1, < 3.0.0)
emoji_regex (>= 0.1, < 2.0)
excon (>= 0.45.0, < 1.0.0)
faraday (~> 0.9)
faraday (~> 0.17)
faraday-cookie_jar (~> 0.0.6)
faraday_middleware (~> 0.9)
faraday_middleware (~> 0.13.1)
fastimage (>= 2.1.0, < 3.0.0)
gh_inspector (>= 1.1.2, < 2.0.0)
google-api-client (>= 0.21.2, < 0.24.0)
google-cloud-storage (>= 1.15.0, < 2.0.0)
highline (>= 1.7.2, < 2.0.0)
json (< 3.0.0)
mini_magick (~> 4.5.1)
multi_json
jwt (~> 2.1.0)
mini_magick (>= 4.9.4, < 5.0.0)
multi_xml (~> 0.5)
multipart-post (~> 2.0.0)
plist (>= 3.1.0, < 4.0.0)
public_suffix (~> 2.0.0)
rubyzip (>= 1.2.2, < 2.0.0)
rubyzip (>= 1.3.0, < 2.0.0)
security (= 0.1.3)
simctl (~> 1.6.3)
slack-notifier (>= 2.0.0, < 3.0.0)
terminal-notifier (>= 1.6.2, < 2.0.0)
terminal-notifier (>= 2.0.0, < 3.0.0)
terminal-table (>= 1.4.5, < 2.0.0)
tty-screen (>= 0.6.3, < 1.0.0)
tty-spinner (>= 0.8.0, < 1.0.0)
word_wrap (~> 1.0.0)
xcodeproj (>= 1.6.0, < 2.0.0)
xcodeproj (>= 1.8.1, < 2.0.0)
xcpretty (~> 0.3.0)
xcpretty-travis-formatter (>= 0.0.3)
fastlane-plugin-trainer (0.4.1)
trainer (>= 0.7.0)
fastlane-plugin-xcconfig (2.0.0)
gh_inspector (1.1.3)
google-api-client (0.23.9)
addressable (~> 2.5, >= 2.5.1)
Expand All @@ -75,9 +85,9 @@ GEM
representable (~> 3.0)
retriable (>= 2.0, < 4.0)
signet (~> 0.9)
google-cloud-core (1.3.0)
google-cloud-core (1.3.2)
google-cloud-env (~> 1.0)
google-cloud-env (1.0.5)
google-cloud-env (1.2.1)
faraday (~> 0.11)
google-cloud-storage (1.16.0)
digest-crc (~> 0.4)
Expand All @@ -95,19 +105,19 @@ GEM
http-cookie (1.0.3)
domain_name (~> 0.5)
httpclient (2.8.3)
json (2.1.0)
json (2.3.0)
jwt (2.1.0)
memoist (0.16.0)
mime-types (3.2.2)
memoist (0.16.2)
mime-types (3.3)
mime-types-data (~> 3.2015)
mime-types-data (3.2018.0812)
mini_magick (4.5.1)
multi_json (1.13.1)
mime-types-data (3.2019.1009)
mini_magick (4.9.5)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.0.0)
nanaimo (0.2.6)
naturally (2.2.0)
os (1.0.0)
os (1.0.1)
plist (3.5.0)
public_suffix (2.0.5)
representable (3.0.4)
Expand All @@ -116,34 +126,31 @@ GEM
uber (< 0.2.0)
retriable (3.1.2)
rouge (2.0.7)
rubyzip (1.2.2)
rubyzip (1.3.0)
security (0.1.3)
signet (0.11.0)
addressable (~> 2.3)
faraday (~> 0.9)
jwt (>= 1.5, < 3.0)
multi_json (~> 1.10)
simctl (1.6.5)
simctl (1.6.6)
CFPropertyList
naturally
slack-notifier (2.3.2)
terminal-notifier (1.8.0)
terminal-notifier (2.0.0)
terminal-table (1.8.0)
unicode-display_width (~> 1.1, >= 1.1.1)
trainer (0.8.1)
fastlane (>= 2.25.0)
plist (>= 3.1.0, < 4.0.0)
tty-cursor (0.6.0)
tty-screen (0.6.5)
tty-spinner (0.9.0)
tty-cursor (~> 0.6.0)
tty-cursor (0.7.0)
tty-screen (0.7.0)
tty-spinner (0.9.2)
tty-cursor (~> 0.7)
uber (0.1.0)
unf (0.1.4)
unf_ext
unf_ext (0.0.7.5)
unicode-display_width (1.4.1)
unf_ext (0.0.7.6)
unicode-display_width (1.6.0)
word_wrap (1.0.0)
xcodeproj (1.8.0)
xcodeproj (1.14.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
Expand All @@ -159,7 +166,8 @@ PLATFORMS

DEPENDENCIES
fastlane
fastlane-plugin-trainer
fastlane-plugin-trainer!
fastlane-plugin-xcconfig

BUNDLED WITH
1.16.5
Loading

0 comments on commit ff63e31

Please sign in to comment.