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 b15d19e + 03bf0ca commit 2190066
Show file tree
Hide file tree
Showing 24 changed files with 357 additions and 227 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
11 changes: 11 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
language: objective-c
osx_image: xcode11.2
cache:
bundler: true
directories:
- Carthage
before_install:
- brew update
- brew outdated carthage || brew upgrade carthage
script:
- bundle exec fastlane ios tests
6 changes: 3 additions & 3 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "SRGSSR/libextobjc" "0.6_srg1"
github "SRGSSR/MAKVONotificationCenter" "1.0_srg3"
github "SRGSSR/srglogger-ios" "1.1"
github "SRGSSR/libextobjc" "0.6_srg2"
github "SRGSSR/MAKVONotificationCenter" "1.0_srg4"
github "SRGSSR/srglogger-apple" "2.0.0"
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "SRGSSR/MAKVONotificationCenter" "1.0_srg3"
github "SRGSSR/libextobjc" "0.6_srg1"
github "SRGSSR/srglogger-ios" "1.1"
github "SRGSSR/MAKVONotificationCenter" "1.0_srg4"
github "SRGSSR/libextobjc" "0.6_srg2"
github "SRGSSR/srglogger-apple" "2.0.0"
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"
10 changes: 6 additions & 4 deletions Framework/Sources/SRGBaseRequest.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@

#import "NSBundle+SRGNetwork.h"
#import "NSHTTPURLResponse+SRGNetwork.h"
#import "SRGNetworkActivityManagement+Private.h"
#import "SRGBaseRequest+Subclassing.h"
#import "SRGNetworkActivityManagement+Private.h"
#import "SRGNetworkError.h"

@interface SRGBaseRequest ()
Expand Down Expand Up @@ -72,20 +72,22 @@ - (void)setRunning:(BOOL)running
if (running != _running) {
_running = running;

#if TARGET_OS_IOS
if (running) {
[SRGNetworkActivityManagement increaseNumberOfRunningRequests];
}
else {
[SRGNetworkActivityManagement decreaseNumberOfRunningRequests];
}
#endif
}
}

#pragma mark Options

- (SRGBaseRequest *)requestWithOptions:(SRGRequestOptions)options
{
SRGBaseRequest *request = [self copy];
SRGBaseRequest *request = self.copy;
request.options = options;
return request;
}
Expand Down Expand Up @@ -125,12 +127,12 @@ - (void)resume
}
else if ([error.domain isEqualToString:NSURLErrorDomain] && error.code == NSURLErrorServerCertificateUntrusted) {
if ((self.options & SRGRequestOptionFriendlyWiFiMessagesDisabled) == 0) {
NSMutableDictionary *userInfo = [error.userInfo mutableCopy];
NSMutableDictionary *userInfo = error.userInfo.mutableCopy;
userInfo[NSLocalizedDescriptionKey] = SRGNetworkLocalizedString(@"You are likely connected to a public WiFi network with no Internet access", @"The error message when request a media or a media list on a public network with no Internet access (e.g. SBB)");

NSError *publicWiFiError = [NSError errorWithDomain:error.domain
code:error.code
userInfo:[userInfo copy]];
userInfo:userInfo.copy];
completionBlock(nil, response, publicWiFiError);
return;
}
Expand Down
1 change: 1 addition & 0 deletions Framework/Sources/SRGNetworkActivityManagement.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
/**
* Automatic network activity management for requests (opt-in).
*/
__TVOS_PROHIBITED __WATCHOS_PROHIBITED
@interface SRGNetworkActivityManagement : NSObject

/**
Expand Down
4 changes: 4 additions & 0 deletions Framework/Sources/SRGNetworkActivityManagement.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

#import <UIKit/UIKit.h>

#if TARGET_OS_IOS

static NSInteger s_numberOfRunningRequests = 0;
static void (^s_networkActivityManagementHandler)(BOOL) = nil;

Expand Down Expand Up @@ -69,3 +71,5 @@ + (void)decreaseNumberOfRunningRequests
}

@end

#endif
2 changes: 1 addition & 1 deletion Framework/Sources/SRGRequestQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ - (void)dealloc

- (NSArray<SRGBaseRequest *> *)requests
{
return [[s_relationshipTable objectForKey:self] copy];
return [s_relationshipTable objectForKey:self].copy;
}

#pragma mark Options
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
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/xcrun make -f

CARTHAGE_FOLDER=Carthage
CARTHAGE_FLAGS=--platform iOS --cache-builds --new-resolver
CARTHAGE_FLAGS=--platform iOS,tvOS,watchOS --cache-builds --new-resolver

.PHONY: all
all: bootstrap
Expand Down
Loading

0 comments on commit 2190066

Please sign in to comment.