Skip to content

Commit

Permalink
Merge branch 'master' into cd-master
Browse files Browse the repository at this point in the history
* master: (71 commits)
  Specify Xcode 9.4 in Travis file.
  Update AFImageDownloader.m
  Safely get mergedTasks On responseQueue
  Update HTTPBin certificates.
  Update block usage requirements.
  Fixed tests.
  Update AFAutoPurgingImageCache.m
  Preparing for the 3.2.1 release
  Fix issues with AFCompatibilityMacros.h
  Add AFCompatibilityMacros.h to podspec.
  Add new .env files for iOS 11.x
  Update SDK settings in Travis config.
  Use old SDKs to test earlier versions of iOS 11.
  Update default SDK for iOS and tvOS
  Update umbrella header.
  Update HTTPBin certificates for April 2018.
  Remove beta from 9.3 image
  Update asset catalog JSON.
  Tweak tests to send expressions directly.
  Add tests and also prohibit +new from working.
  ...

# Conflicts:
#	AFNetworking/AFNetworkReachabilityManager.h
#	AFNetworking/AFURLSessionManager.m
  • Loading branch information
Kaspik committed Jul 23, 2018
2 parents c976cf3 + 7642bcf commit 5544ef0
Show file tree
Hide file tree
Showing 76 changed files with 1,092 additions and 222 deletions.
30 changes: 20 additions & 10 deletions .travis.yml
@@ -1,5 +1,5 @@
language: objective-c
osx_image: xcode7.1
osx_image: xcode9.4
sudo: false
env:
global:
Expand All @@ -9,21 +9,31 @@ env:
- FASTLANE_LANE=ci_commit
matrix:
include:
- osx_image: xcode8
- osx_image: xcode9.4
env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default
- osx_image: xcode8
env: FASTLANE_ENV=ios10_xcode8
- osx_image: xcode8
env: FASTLANE_ENV=tvos10_xcode8
- osx_image: xcode8
- osx_image: xcode9.4
env: FASTLANE_ENV=ios11_xcode94
- osx_image: xcode9.4
env: FASTLANE_ENV=tvos11_xcode9
- osx_image: xcode9.4
env: FASTLANE_ENV=osx
- osx_image: xcode9.3
env: FASTLANE_ENV=ios11_xcode93
- osx_image: xcode9.2
env: FASTLANE_ENV=ios11_xcode92
- osx_image: xcode9.1
env: FASTLANE_ENV=ios11_xcode91
- osx_image: xcode9
env: FASTLANE_ENV=ios11_xcode9
- osx_image: xcode8.3
env: FASTLANE_ENV=ios10_xcode8
- osx_image: xcode7.3
env: FASTLANE_ENV=ios93_xcode73
env: FASTLANE_ENV=ios9_xcode7
- osx_image: xcode7.3
env: FASTLANE_ENV=ios81_xcode73
env: FASTLANE_ENV=ios8_xcode7
before_install:
# Force bundler 1.12.5 because version 1.13 has issues, see https://github.com/fastlane/fastlane/issues/6065#issuecomment-246044617
- gem uninstall bundler -v '>1.12.5' --force || echo "bundler >1.12.5 is not installed"
- gem uninstall bundler -v '>1.12.5' --force --executables || echo "bundler >1.12.5 is not installed"
- gem install bundler -v 1.12.5 --no-rdoc --no-ri --no-document --quiet
- gem install fastlane --no-rdoc --no-ri --no-document --quiet
- gem install cocoapods --no-rdoc --no-ri --no-document --quiet
Expand Down
6 changes: 3 additions & 3 deletions AFNetworking.podspec
@@ -1,6 +1,6 @@
Pod::Spec.new do |s|
s.name = 'AFNetworking'
s.version = '3.1.0'
s.version = '3.2.1'
s.license = 'MIT'
s.summary = 'A delightful iOS and OS X networking framework.'
s.homepage = 'https://github.com/AFNetworking/AFNetworking'
Expand Down Expand Up @@ -64,8 +64,8 @@ EOS
ss.tvos.dependency 'AFNetworking/Reachability'
ss.dependency 'AFNetworking/Security'

ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}'
ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h'
ss.source_files = 'AFNetworking/AF{URL,HTTP}SessionManager.{h,m}', 'AFNetworking/AFCompatibilityMacros.h'
ss.public_header_files = 'AFNetworking/AF{URL,HTTP}SessionManager.h', 'AFNetworking/AFCompatibilityMacros.h'
end

s.subspec 'UIKit' do |ss|
Expand Down
106 changes: 79 additions & 27 deletions AFNetworking.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down Expand Up @@ -40,9 +40,9 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO"
enableAddressSanitizer = "YES"
codeCoverageEnabled = "YES"
enableAddressSanitizer = "YES">
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -16,7 +16,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</BuildActionEntry>
Expand All @@ -26,16 +26,16 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO"
codeCoverageEnabled = "YES">
codeCoverageEnabled = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "298D7C491BC2C7B200FD3B3E"
BuildableName = "AFNetworking Mac OS X Tests.xctest"
BlueprintName = "AFNetworking Mac OS X Tests"
BuildableName = "AFNetworking macOS Tests.xctest"
BlueprintName = "AFNetworking macOS Tests"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
<SkippedTests>
Expand All @@ -50,7 +50,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand Down Expand Up @@ -79,7 +79,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand All @@ -97,7 +97,7 @@
BuildableIdentifier = "primary"
BlueprintIdentifier = "299522761BBF136400859F49"
BuildableName = "AFNetworking.framework"
BlueprintName = "AFNetworking OS X"
BlueprintName = "AFNetworking macOS"
ReferencedContainer = "container:AFNetworking.xcodeproj">
</BuildableReference>
</MacroExpansion>
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand All @@ -26,8 +26,8 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "NO"
enableAddressSanitizer = "YES">
enableAddressSanitizer = "YES"
shouldUseLaunchSchemeArgsEnv = "NO">
<Testables>
<TestableReference
skipped = "NO">
Expand Down Expand Up @@ -78,11 +78,11 @@
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
enableThreadSanitizer = "YES"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
enableThreadSanitizer = "YES"
stopOnEveryThreadSanitizerIssue = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
Expand Down
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "0800"
LastUpgradeVersion = "0930"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
37 changes: 37 additions & 0 deletions AFNetworking/AFCompatibilityMacros.h
@@ -0,0 +1,37 @@
// AFCompatibilityMacros.h
// Copyright (c) 2011–2016 Alamofire Software Foundation ( http://alamofire.org/ )
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

#ifndef AFCompatibilityMacros_h
#define AFCompatibilityMacros_h

#ifdef API_UNAVAILABLE
#define AF_API_UNAVAILABLE(x) API_UNAVAILABLE(x)
#else
#define AF_API_UNAVAILABLE(x)
#endif // API_UNAVAILABLE

#if __has_warning("-Wunguarded-availability-new")
#define AF_CAN_USE_AT_AVAILABLE 1
#else
#define AF_CAN_USE_AT_AVAILABLE 0
#endif

#endif /* AFCompatibilityMacros_h */
11 changes: 7 additions & 4 deletions AFNetworking/AFNetworkReachabilityManager.h
Expand Up @@ -108,11 +108,14 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability NS_DESIGNATED_INITIALIZER;

/**
* Initializes an instance of a network reachability manager
*
* @return nil as this method is unavailable
* Unavailable initializer
*/
- (nonnull instancetype)init NS_UNAVAILABLE;
+ (instancetype)new NS_UNAVAILABLE;

/**
* Unavailable initializer
*/
- (instancetype)init NS_UNAVAILABLE;

///--------------------------------------------------
/// @name Starting & Stopping Reachability Monitoring
Expand Down
5 changes: 4 additions & 1 deletion AFNetworking/AFNetworkReachabilityManager.m
Expand Up @@ -170,8 +170,11 @@ - (instancetype)initWithReachability:(SCNetworkReachabilityRef)reachability {
return self;
}

- (instancetype)init NS_UNAVAILABLE
- (instancetype)init
{
@throw [NSException exceptionWithName:NSGenericException
reason:@"`-init` unavailable. Use `-initWithReachability:` instead"
userInfo:nil];
return nil;
}

Expand Down
5 changes: 5 additions & 0 deletions AFNetworking/AFURLRequestSerialization.m
Expand Up @@ -679,6 +679,11 @@ - (instancetype)initWithURLRequest:(NSMutableURLRequest *)urlRequest
return self;
}

- (void)setRequest:(NSMutableURLRequest *)request
{
_request = [request mutableCopy];
}

- (BOOL)appendPartWithFileURL:(NSURL *)fileURL
name:(NSString *)name
error:(NSError * __autoreleasing *)error
Expand Down
9 changes: 8 additions & 1 deletion AFNetworking/AFURLResponseSerialization.h
Expand Up @@ -24,6 +24,11 @@

NS_ASSUME_NONNULL_BEGIN

/**
Recursively removes `NSNull` values from a JSON object.
*/
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions);

/**
The `AFURLResponseSerialization` protocol is adopted by an object that decodes data into a more useful object representation, according to details in the server response. Response serializers may additionally perform validation on the incoming response and data.
Expand Down Expand Up @@ -108,6 +113,8 @@ NS_ASSUME_NONNULL_BEGIN
- `application/json`
- `text/json`
- `text/javascript`
In RFC 7159 - Section 8.1, it states that JSON text is required to be encoded in UTF-8, UTF-16, or UTF-32, and the default encoding is UTF-8. NSJSONSerialization provides support for all the encodings listed in the specification, and recommends UTF-8 for efficiency. Using an unsupported encoding will result in serialization error. See the `NSJSONSerialization` documentation for more details.
*/
@interface AFJSONResponseSerializer : AFHTTPResponseSerializer

Expand Down Expand Up @@ -163,7 +170,7 @@ NS_ASSUME_NONNULL_BEGIN
- (instancetype)init;

/**
Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSJSONSerialization` documentation section "NSJSONReadingOptions". `0` by default.
Input and output options specifically intended for `NSXMLDocument` objects. For possible values, see the `NSXMLDocument` documentation section "Input and Output Options". `0` by default.
*/
@property (nonatomic, assign) NSUInteger options;

Expand Down
6 changes: 4 additions & 2 deletions AFNetworking/AFURLResponseSerialization.m
Expand Up @@ -60,11 +60,13 @@ static BOOL AFErrorOrUnderlyingErrorHasCodeInDomain(NSError *error, NSInteger co
return NO;
}

static id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions readingOptions) {
if ([JSONObject isKindOfClass:[NSArray class]]) {
NSMutableArray *mutableArray = [NSMutableArray arrayWithCapacity:[(NSArray *)JSONObject count]];
for (id value in (NSArray *)JSONObject) {
[mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
if (![value isEqual:[NSNull null]]) {
[mutableArray addObject:AFJSONObjectByRemovingKeysWithNullValues(value, readingOptions)];
}
}

return (readingOptions & NSJSONReadingMutableContainers) ? mutableArray : [NSArray arrayWithArray:mutableArray];
Expand Down
3 changes: 2 additions & 1 deletion AFNetworking/AFURLSessionManager.h
Expand Up @@ -25,6 +25,7 @@
#import "AFURLResponseSerialization.h"
#import "AFURLRequestSerialization.h"
#import "AFSecurityPolicy.h"
#import "AFCompatibilityMacros.h"
#if !TARGET_OS_WATCH
#import "AFNetworkReachabilityManager.h"
#endif
Expand Down Expand Up @@ -414,7 +415,7 @@ NS_ASSUME_NONNULL_BEGIN
@param block A block object to be executed once all messages enqueued for a session have been delivered. The block has no return value and takes a single argument: the session.
*/
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block;
- (void)setDidFinishEventsForBackgroundURLSessionBlock:(nullable void (^)(NSURLSession *session))block AF_API_UNAVAILABLE(macos);

///-----------------------------------------------
/// @name Setting Download Task Delegate Callbacks
Expand Down

0 comments on commit 5544ef0

Please sign in to comment.