diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..ec939bbbbd --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,68 @@ +name: "AFNetworking CI" + +on: + push: + branches: + - master + pull_request: + branches: + - '*' + +jobs: + macOS: + name: Test macOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: macOS + run: fastlane ci_commit configuration:Debug --env macos + iOS: + name: Test iOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: iOS + run: fastlane ci_commit configuration:Debug --env ios13_xcode11 + Catalyst: + name: Test Catalyst + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: Catalyst + run: fastlane ci_commit configuration:Debug --env catalyst + tvOS: + name: Test tvOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: tvOS + run: fastlane ci_commit configuration:Debug --env tvos13_xcode11 + watchOS: + name: Build watchOS + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + strategy: + matrix: + destination: ["OS=6.1.1,name=Apple Watch Series 5 - 44mm"] #, "OS=4.2,name=Apple Watch Series 3 - 42mm", "OS=3.2,name=Apple Watch Series 2 - 42mm"] + steps: + - uses: actions/checkout@v2 + - name: watchOS - ${{ matrix.destination }} + run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "AFNetworking.xcodeproj" -scheme "AFNetworking watchOS" -destination "${{ matrix.destination }}" clean build | xcpretty + SPM: + name: Build with SPM + runs-on: macOS-latest + env: + DEVELOPER_DIR: /Applications/Xcode_11.3.1.app/Contents/Developer + steps: + - uses: actions/checkout@v2 + - name: SPM Build + run: swift build diff --git a/.gitignore b/.gitignore index f33bce3b46..cddadc3052 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,4 @@ fastlane/test-output/* Carthage/Build fastlane/README.md +.build diff --git a/.ruby-gemset b/.ruby-gemset new file mode 100644 index 0000000000..0edabf3396 --- /dev/null +++ b/.ruby-gemset @@ -0,0 +1 @@ +afnetworking diff --git a/.ruby-version b/.ruby-version new file mode 100644 index 0000000000..24ba9a38de --- /dev/null +++ b/.ruby-version @@ -0,0 +1 @@ +2.7.0 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 5cc7ebde18..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,51 +0,0 @@ -language: objective-c -osx_image: xcode11 -sudo: false -env: - global: - - LC_CTYPE=en_US.UTF-8 - - LANG=en_US.UTF-8 - - LANGUAGE=en_US.UTF-8 - - FASTLANE_LANE=ci_commit -matrix: - include: - - osx_image: xcode11 - env: FASTLANE_LANE=code_coverage FASTLANE_ENV=default - - osx_image: xcode11 - env: FASTLANE_ENV=ios13_xcode11 - - osx_image: xcode11 - env: FASTLANE_ENV=tvos13_xcode11 - - osx_image: xcode11 - env: FASTLANE_ENV=osx - - osx_image: xcode10 - env: FASTLANE_ENV=ios12_xcode10 - - osx_image: xcode9.4 - env: FASTLANE_ENV=ios11_xcode94 - - 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 -before_install: - - gem install fastlane --no-document --quiet - - gem install cocoapods --no-document --quiet -script: - - set -o pipefail - - fastlane $FASTLANE_LANE configuration:Debug --env $FASTLANE_ENV - - fastlane $FASTLANE_LANE configuration:Release --env $FASTLANE_ENV -after_success: - - if [ "$FASTLANE_LANE" == "code_coverage" ]; then - bash <(curl -s https://codecov.io/bash); - fi -after_failure: - - cat -n ~/Library/Logs/scan/* - - cat -n $TMPDIR/com.apple.dt.XCTest-status/Session*.log - - cat -n ~/Library/Logs/DiagnosticReports/xctest*.crash -# deploy: -# provider: script -# script: fastlane complete_framework_release --env deploy -# on: -# tags: true diff --git a/AFNetworking.podspec b/AFNetworking.podspec index 2338d84890..00d0c5094c 100644 --- a/AFNetworking.podspec +++ b/AFNetworking.podspec @@ -1,8 +1,8 @@ Pod::Spec.new do |s| s.name = 'AFNetworking' - s.version = '3.2.1' + s.version = '4.0.0' s.license = 'MIT' - s.summary = 'A delightful iOS and OS X networking framework.' + s.summary = 'A delightful networking framework for Apple platforms.' s.homepage = 'https://github.com/AFNetworking/AFNetworking' s.social_media_url = 'https://twitter.com/AFNetworking' s.authors = { 'Mattt Thompson' => 'm@mattt.me' } @@ -27,8 +27,8 @@ Pod::Spec.new do |s| EOS s.prefix_header_contents = pch_AF - s.ios.deployment_target = '8.0' - s.osx.deployment_target = '10.9' + s.ios.deployment_target = '9.0' + s.osx.deployment_target = '10.10' s.watchos.deployment_target = '2.0' s.tvos.deployment_target = '9.0' @@ -47,8 +47,8 @@ EOS end s.subspec 'Reachability' do |ss| - ss.ios.deployment_target = '8.0' - ss.osx.deployment_target = '10.9' + ss.ios.deployment_target = '9.0' + ss.osx.deployment_target = '10.10' ss.tvos.deployment_target = '9.0' ss.source_files = 'AFNetworking/AFNetworkReachabilityManager.{h,m}' @@ -69,7 +69,7 @@ EOS end s.subspec 'UIKit' do |ss| - ss.ios.deployment_target = '8.0' + ss.ios.deployment_target = '9.0' ss.tvos.deployment_target = '9.0' ss.dependency 'AFNetworking/NSURLSession' diff --git a/AFNetworking.xcodeproj/project.pbxproj b/AFNetworking.xcodeproj/project.pbxproj index 9d28f467cc..527cf2ff70 100644 --- a/AFNetworking.xcodeproj/project.pbxproj +++ b/AFNetworking.xcodeproj/project.pbxproj @@ -10,9 +10,6 @@ 1BF9F9601C87832B00F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; 1BF9F9611C87843200F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; 1BF9F9621C87843300F1F35A /* AFImageResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */; }; - 1F8482C0220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; }; - 1F8482C1220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; }; - 1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */ = {isa = PBXBuildFile; fileRef = 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */; }; 1F96D2A4203649560085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1F96D2A5203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; 1F96D2A6203649570085FC3F /* AFCompatibilityMacros.h in Headers */ = {isa = PBXBuildFile; fileRef = 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */; settings = {ATTRIBUTES = (Public, ); }; }; @@ -172,6 +169,9 @@ 2D4563911DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */; }; 2D4563921DB117A200AE4812 /* AFXMLParserResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */; }; 2D4563941DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */; }; + 31CBC007242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; + 31CBC008242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; + 31CBC009242D8DF200934333 /* httpbinorg_02182021.cer in Resources */ = {isa = PBXBuildFile; fileRef = 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */; }; 323D83E2231D185400C5BFC6 /* WKWebView+AFNetworking.h in Headers */ = {isa = PBXBuildFile; fileRef = 323D83E0231D185400C5BFC6 /* WKWebView+AFNetworking.h */; settings = {ATTRIBUTES = (Public, ); }; }; 323D83E3231D185400C5BFC6 /* WKWebView+AFNetworking.m in Sources */ = {isa = PBXBuildFile; fileRef = 323D83E1231D185400C5BFC6 /* WKWebView+AFNetworking.m */; }; 323D83E5231D188400C5BFC6 /* AFWKWebViewTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.m */; }; @@ -237,7 +237,6 @@ /* Begin PBXFileReference section */ 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFImageResponseSerializerTests.m; sourceTree = ""; }; 1F083A4920364648004D80C7 /* AFCompatibilityMacros.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AFCompatibilityMacros.h; sourceTree = ""; }; - 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */ = {isa = PBXFileReference; lastKnownFileType = file; path = httpbinorg_03172020.cer; sourceTree = ""; }; 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFUIButtonTests.m; sourceTree = ""; }; 297824A01BC2D69A0041C395 /* adn_0.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_0.cer; path = ADNNetServerTrustChain/adn_0.cer; sourceTree = ""; }; 297824A11BC2D69A0041C395 /* adn_1.cer */ = {isa = PBXFileReference; lastKnownFileType = file; name = adn_1.cer; path = ADNNetServerTrustChain/adn_1.cer; sourceTree = ""; }; @@ -306,6 +305,7 @@ 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFCompoundResponseSerializerTests.m; sourceTree = ""; }; 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLParserResponseSerializerTests.m; sourceTree = ""; }; 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFXMLDocumentResponseSerializerTests.m; sourceTree = ""; }; + 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = httpbinorg_02182021.cer; sourceTree = ""; }; 323D83E0231D185400C5BFC6 /* WKWebView+AFNetworking.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "WKWebView+AFNetworking.h"; sourceTree = ""; }; 323D83E1231D185400C5BFC6 /* WKWebView+AFNetworking.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "WKWebView+AFNetworking.m"; sourceTree = ""; }; 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AFWKWebViewTests.m; sourceTree = ""; }; @@ -417,7 +417,7 @@ E2B10D8D233035100004E005 /* Amazon.cer */, E2B10D8B233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer */, 298D7CE21BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain */, - 1F8482BF220F386200718111 /* httpbinorg_03172020.cer */, + 31CBC006242D8DF200934333 /* httpbinorg_02182021.cer */, ); path = HTTPBin.org; sourceTree = ""; @@ -446,19 +446,19 @@ 298D7CD11BC2CABE00FD3B3E /* AFNetworking Tests */ = { isa = PBXGroup; children = ( + 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */, 298D7C811BC2C88F00FD3B3E /* AFHTTPRequestSerializationTests.m */, 298D7C821BC2C88F00FD3B3E /* AFHTTPResponseSerializationTests.m */, 298D7C831BC2C88F00FD3B3E /* AFHTTPSessionManagerTests.m */, - 298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */, - 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */, - 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */, - 298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */, - E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */, - 29D3413E1C20D46400A7D266 /* AFCompoundResponseSerializerTests.m */, 1BF9F95F1C87832B00F1F35A /* AFImageResponseSerializerTests.m */, + 298D7C851BC2C88F00FD3B3E /* AFJSONSerializationTests.m */, 298D7C871BC2C88F00FD3B3E /* AFNetworkReachabilityManagerTests.m */, + E91164641DA6A7AE00DFFF56 /* AFPropertyListRequestSerializerTests.m */, + 298D7C881BC2C88F00FD3B3E /* AFPropertyListResponseSerializerTests.m */, 298D7C891BC2C88F00FD3B3E /* AFSecurityPolicyTests.m */, 298D7C8F1BC2C88F00FD3B3E /* AFURLSessionManagerTests.m */, + 2D4563931DB11DDB00AE4812 /* AFXMLDocumentResponseSerializerTests.m */, + 2D45638F1DB1179D00AE4812 /* AFXMLParserResponseSerializerTests.m */, ); name = "AFNetworking Tests"; sourceTree = ""; @@ -470,9 +470,9 @@ 298D7C841BC2C88F00FD3B3E /* AFImageDownloaderTests.m */, 298D7C861BC2C88F00FD3B3E /* AFNetworkActivityManagerTests.m */, 298D7C8C1BC2C88F00FD3B3E /* AFUIActivityIndicatorViewTests.m */, + 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */, 298D7C8D1BC2C88F00FD3B3E /* AFUIImageViewTests.m */, 298D7C8E1BC2C88F00FD3B3E /* AFUIRefreshControlTests.m */, - 2960BAC21C1B2F1A00BA02F0 /* AFUIButtonTests.m */, 323D83E4231D188400C5BFC6 /* AFWKWebViewTests.m */, ); name = "AFNetworking UIKit Tests"; @@ -791,41 +791,46 @@ 299522301BBF104D00859F49 /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0930; + LastUpgradeCheck = 1140; ORGANIZATIONNAME = AFNetworking; TargetAttributes = { 2987B0A41BC408A200179A4C = { CreatedOnToolsVersion = 7.1; + ProvisioningStyle = Automatic; }; 2987B0AD1BC408A200179A4C = { CreatedOnToolsVersion = 7.1; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 298D7C3A1BC2C79500FD3B3E = { CreatedOnToolsVersion = 7.0.1; - ProvisioningStyle = Manual; + ProvisioningStyle = Automatic; }; 298D7C491BC2C7B200FD3B3E = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522381BBF104D00859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522641BBF129200859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; 299522761BBF136400859F49 = { CreatedOnToolsVersion = 7.0.1; + ProvisioningStyle = Automatic; }; }; }; buildConfigurationList = 299522331BBF104D00859F49 /* Build configuration list for PBXProject "AFNetworking" */; compatibilityVersion = "Xcode 6.3"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, + Base, ); mainGroup = 2995222F1BBF104D00859F49; productRefGroup = 2995223A1BBF104D00859F49 /* Products */; @@ -858,7 +863,6 @@ 2987B0DE1BC40AFB00179A4C /* foobar.com.cer in Resources */, 2987B0D61BC40AEC00179A4C /* ADNNetServerTrustChain in Resources */, E2B10D90233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */, - 1F8482C2220F386200718111 /* httpbinorg_03172020.cer in Resources */, 2987B0DF1BC40AFB00179A4C /* NoDomains.cer in Resources */, 2987B0D41BC40AE900179A4C /* adn_1.cer in Resources */, 2987B0DD1BC40AFB00179A4C /* AltName.cer in Resources */, @@ -872,6 +876,7 @@ 5F4323BD1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */, 5F4323DF1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */, E2B10D93233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC009242D8DF200934333 /* httpbinorg_02182021.cer in Resources */, 5F4323C01BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */, 5F4323CF1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */, 5F4323C31BF63741003B8749 /* google.com.cer in Resources */, @@ -885,7 +890,6 @@ 298D7CBF1BC2CA9D00FD3B3E /* foobar.com.cer in Resources */, 298D7CBA1BC2CA9800FD3B3E /* logo.png in Resources */, E2B10D8E233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */, - 1F8482C0220F386200718111 /* httpbinorg_03172020.cer in Resources */, 297824A31BC2D69A0041C395 /* adn_0.cer in Resources */, 298D7CE31BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */, 297824A71BC2D69A0041C395 /* adn_2.cer in Resources */, @@ -899,6 +903,7 @@ 5F4323BB1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */, 5F4323DD1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */, E2B10D91233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC007242D8DF200934333 /* httpbinorg_02182021.cer in Resources */, 5F4323BE1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */, 5F4323CD1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */, 5F4323C11BF63741003B8749 /* google.com.cer in Resources */, @@ -912,7 +917,6 @@ 298D7CBC1BC2CA9C00FD3B3E /* foobar.com.cer in Resources */, 298D7CB91BC2CA9800FD3B3E /* logo.png in Resources */, E2B10D8F233035100004E005 /* Starfield Services Root Certificate Authority - G2.cer in Resources */, - 1F8482C1220F386200718111 /* httpbinorg_03172020.cer in Resources */, 297824A41BC2D69A0041C395 /* adn_0.cer in Resources */, 298D7CE41BC2CB7C00FD3B3E /* HTTPBinOrgServerTrustChain in Resources */, 297824A81BC2D69A0041C395 /* adn_2.cer in Resources */, @@ -926,6 +930,7 @@ 5F4323BC1BF63741003B8749 /* Equifax_Secure_Certificate_Authority_Root.cer in Resources */, 5F4323CE1BF63741003B8749 /* GoogleInternetAuthorityG2.cer in Resources */, E2B10D92233035100004E005 /* Amazon Root CA 1.cer in Resources */, + 31CBC008242D8DF200934333 /* httpbinorg_02182021.cer in Resources */, 5F4323DE1BF63CCC003B8749 /* GeoTrust_Global_CA_Root.cer in Resources */, 5F4323BF1BF63741003B8749 /* GeoTrust_Global_CA-cross.cer in Resources */, 5F4323C21BF63741003B8749 /* google.com.cer in Resources */, @@ -1122,22 +1127,23 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -1147,22 +1153,23 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=appletvos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 3; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1170,14 +1177,16 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TARGETED_DEVICE_FAMILY = 3; }; name = Debug; }; @@ -1185,14 +1194,16 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-tvOSTests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = appletvos; - TVOS_DEPLOYMENT_TARGET = 9.0; + TARGETED_DEVICE_FAMILY = 3; }; name = Release; }; @@ -1200,14 +1211,17 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-iOS-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; }; name = Debug; }; @@ -1215,14 +1229,17 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; + CODE_SIGN_STYLE = Automatic; DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-iOS-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; }; name = Release; }; @@ -1230,14 +1247,17 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-Mac-OS-X-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; }; name = Debug; @@ -1246,14 +1266,17 @@ isa = XCBuildConfiguration; buildSettings = { CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = "-"; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = ""; GCC_PREFIX_HEADER = "$(PROJECT_DIR)/Tests/Tests-Prefix.pch"; INFOPLIST_FILE = ./Tests/Info.plist; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; - PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-Mac-OS-X-Tests"; + PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier}"; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; }; name = Release; @@ -1262,8 +1285,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_CODE_COVERAGE = YES; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1298,7 +1322,7 @@ DEBUG_INFORMATION_FORMAT = dwarf; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; GCC_OPTIMIZATION_LEVEL = 0; @@ -1306,7 +1330,7 @@ "DEBUG=1", "$(inherited)", ); - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -1325,8 +1349,9 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.0.0; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; @@ -1335,6 +1360,11 @@ TVOS_DEPLOYMENT_TARGET = 9.0; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wno-unused-parameter", + ); WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; @@ -1343,8 +1373,9 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; + CLANG_CXX_LANGUAGE_STANDARD = "compiler-default"; + CLANG_CXX_LIBRARY = "compiler-default"; CLANG_ENABLE_CODE_COVERAGE = NO; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; @@ -1379,9 +1410,9 @@ DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; + GCC_C_LANGUAGE_STANDARD = "compiler-default"; GCC_NO_COMMON_BLOCKS = YES; - GCC_TREAT_WARNINGS_AS_ERRORS = YES; + GCC_TREAT_WARNINGS_AS_ERRORS = NO; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; GCC_WARN_ABOUT_DEPRECATED_FUNCTIONS = YES; GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; @@ -1400,8 +1431,9 @@ GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VALUE = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.9; + IPHONEOS_DEPLOYMENT_TARGET = 9.0; + MACOSX_DEPLOYMENT_TARGET = 10.10; + MARKETING_VERSION = 4.0.0; MODULEMAP_FILE = "$(PROJECT_DIR)/Framework/module.modulemap"; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; @@ -1410,6 +1442,11 @@ VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; VERSION_INFO_PREFIX = ""; + WARNING_CFLAGS = ( + "-Wall", + "-Wextra", + "-Wno-unused-parameter", + ); WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; @@ -1420,20 +1457,25 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -1443,20 +1485,25 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_OBJC_WEAK = YES; - CODE_SIGN_IDENTITY = "iPhone Developer"; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development"; + CODE_SIGN_STYLE = Automatic; + CURRENT_PROJECT_VERSION = 1; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + MARKETING_VERSION = 4.0.0; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; + "PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = ""; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1466,8 +1513,11 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1476,11 +1526,10 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS"; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -1490,8 +1539,11 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=watchos*]" = ""; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; @@ -1500,11 +1552,10 @@ LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.AFNetworking-watchOS"; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = watchos; SKIP_INSTALL = YES; TARGETED_DEVICE_FAMILY = 4; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; @@ -1514,24 +1565,24 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = marker; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Debug; }; @@ -1541,24 +1592,24 @@ APPLICATION_EXTENSION_API_ONLY = YES; BITCODE_GENERATION_MODE = bitcode; CLANG_ENABLE_OBJC_WEAK = YES; + CODE_SIGN_IDENTITY = ""; "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_STYLE = Automatic; COMBINE_HIDPI_IMAGES = YES; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; FRAMEWORK_VERSION = A; INFOPLIST_FILE = ./Framework/Info.plist; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks @loader_path/Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.9; PRODUCT_BUNDLE_IDENTIFIER = com.alamofire.AFNetworking; PRODUCT_NAME = AFNetworking; + PROVISIONING_PROFILE_SPECIFIER = ""; SDKROOT = macosx; SKIP_INSTALL = YES; - TVOS_DEPLOYMENT_TARGET = 9.0; - WATCHOS_DEPLOYMENT_TARGET = 2.0; }; name = Release; }; diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme index 617a92dbbc..264cb201a1 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking iOS.xcscheme @@ -1,6 +1,6 @@ - - - - - - - - - - + shouldUseLaunchSchemeArgsEnv = "NO" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES" + codeCoverageEnabled = "YES"> + + + + + + + + + + + + + allowLocationSimulation = "YES" + consoleMode = "1"> - - - - - - - - - - - - + shouldUseLaunchSchemeArgsEnv = "NO" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES" + codeCoverageEnabled = "YES"> + + + + + + + + + + + + - - - - - - - - - - - - + shouldUseLaunchSchemeArgsEnv = "NO" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES"> + + + + + + + + + + diff --git a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme index 9319f684dd..2585216082 100644 --- a/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme +++ b/AFNetworking.xcodeproj/xcshareddata/xcschemes/AFNetworking watchOS.xcscheme @@ -1,6 +1,6 @@ - - - - -#if TARGET_OS_IOS || TARGET_OS_WATCH || TARGET_OS_TV -#import -#else -#import -#endif - #import "AFURLSessionManager.h" /** @@ -40,8 +34,6 @@ Developers targeting iOS 7 or Mac OS X 10.9 or later that deal extensively with a web service are encouraged to subclass `AFHTTPSessionManager`, providing a class method that returns a shared singleton object on which authentication and other configuration can be shared across the application. - For developers targeting iOS 6 or Mac OS X 10.8 or earlier, `AFHTTPRequestOperationManager` may be used to similar effect. - ## Methods to Override To change the behavior of all data task operation construction, which is also used in the `GET` / `POST` / et al. convenience methods, override `dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler:`. @@ -138,39 +130,6 @@ NS_ASSUME_NONNULL_BEGIN /// @name Making HTTP Requests ///--------------------------- -/** - Creates and runs an `NSURLSessionDataTask` with a `GET` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - - -/** - Creates and runs an `NSURLSessionDataTask` with a `GET` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(nullable id)parameters - progress:(nullable void (^)(NSProgress *downloadProgress))downloadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `GET` request. @@ -190,21 +149,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes a single arguments: the data task. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `HEAD` request. @@ -222,38 +166,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - -/** - Creates and runs an `NSURLSessionDataTask` with a `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `POST` request. @@ -273,41 +185,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - -/** - Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param block A block that takes a single argument and appends data to the HTTP body. The block argument is an object adopting the `AFMultipartFormData` protocol. - @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:uploadProgress:downloadProgress:completionHandler: - */ -- (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(nullable id)parameters - constructingBodyWithBlock:(nullable void (^)(id formData))block - progress:(nullable void (^)(NSProgress *uploadProgress))uploadProgress - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; /** Creates and runs an `NSURLSessionDataTask` with a multipart `POST` request. @@ -329,21 +206,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a `PUT` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `PUT` request. @@ -361,21 +223,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `PATCH` request. @@ -393,21 +240,6 @@ NS_ASSUME_NONNULL_BEGIN success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; -/** - Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. - - @param URLString The URL string used to create the request URL. - @param parameters The parameters to be encoded according to the client request serializer. - @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. - @param failure A block object to be executed when the task finishes unsuccessfully, or that finishes successfully, but encountered an error while parsing the response data. This block has no return value and takes a two arguments: the data task and the error describing the network or parsing error that occurred. - - @see -dataTaskWithRequest:completionHandler: - */ -- (nullable NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(nullable id)parameters - success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure DEPRECATED_ATTRIBUTE; - /** Creates and runs an `NSURLSessionDataTask` with a `DELETE` request. @@ -431,6 +263,7 @@ NS_ASSUME_NONNULL_BEGIN @param method The HTTPMethod string used to create the request. @param URLString The URL string used to create the request URL. @param parameters The parameters to be encoded according to the client request serializer. + @param headers The headers appended to the default headers for this request. @param uploadProgress A block object to be executed when the upload progress is updated. Note this block is called on the session queue, not the main queue. @param downloadProgress A block object to be executed when the download progress is updated. Note this block is called on the session queue, not the main queue. @param success A block object to be executed when the task finishes successfully. This block has no return value and takes two arguments: the data task, and the response object created by the client response serializer. @@ -441,10 +274,11 @@ NS_ASSUME_NONNULL_BEGIN - (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method URLString:(NSString *)URLString parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress - success:(void (^)(NSURLSessionDataTask *, id))success - failure:(void (^)(NSURLSessionDataTask *, NSError *))failure; + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure; @end diff --git a/AFNetworking/AFHTTPSessionManager.m b/AFNetworking/AFHTTPSessionManager.m index 8a4f143615..72bcc7fefb 100644 --- a/AFNetworking/AFHTTPSessionManager.m +++ b/AFNetworking/AFHTTPSessionManager.m @@ -118,30 +118,11 @@ - (void)setSecurityPolicy:(AFSecurityPolicy *)securityPolicy { #pragma mark - - (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - - return [self GET:URLString parameters:parameters headers:nil progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters - progress:(void (^)(NSProgress * _Nonnull))downloadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - - return [self GET:URLString parameters:parameters headers:nil progress:downloadProgress success:success failure:failure]; -} - -- (NSURLSessionDataTask *)GET:(NSString *)URLString - parameters:(id)parameters + parameters:(nullable id)parameters headers:(nullable NSDictionary *)headers - progress:(void (^)(NSProgress * _Nonnull))downloadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure + progress:(nullable void (^)(NSProgress * _Nonnull))downloadProgress + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure { NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"GET" @@ -159,18 +140,10 @@ - (NSURLSessionDataTask *)GET:(NSString *)URLString } - (NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self HEAD:URLString parameters:parameters headers:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)HEAD:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers - success:(void (^)(NSURLSessionDataTask * _Nonnull))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure { NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"HEAD" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:^(NSURLSessionDataTask *task, __unused id responseObject) { if (success) { @@ -183,23 +156,6 @@ - (NSURLSessionDataTask *)HEAD:(NSString *)URLString return dataTask; } -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self POST:URLString parameters:parameters headers:nil progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - progress:(void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - return [self POST:URLString parameters:parameters headers:nil progress:uploadProgress success:success failure:failure]; -} - - (nullable NSURLSessionDataTask *)POST:(NSString *)URLString parameters:(nullable id)parameters headers:(nullable NSDictionary *)headers @@ -216,29 +172,10 @@ - (nullable NSURLSessionDataTask *)POST:(NSString *)URLString - (NSURLSessionDataTask *)POST:(NSString *)URLString parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers constructingBodyWithBlock:(nullable void (^)(id _Nonnull))block - success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success - failure:(nullable void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure -{ - return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - constructingBodyWithBlock:(void (^)(id formData))block progress:(nullable void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self POST:URLString parameters:parameters headers:nil constructingBodyWithBlock:block progress:uploadProgress success:success failure:failure]; -} - -- (NSURLSessionDataTask *)POST:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers - constructingBodyWithBlock:(void (^)(id _Nonnull))block - progress:(void (^)(NSProgress * _Nonnull))uploadProgress - success:(void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure + success:(nullable void (^)(NSURLSessionDataTask * _Nonnull, id _Nullable))success failure:(void (^)(NSURLSessionDataTask * _Nullable, NSError * _Nonnull))failure { NSError *serializationError = nil; NSMutableURLRequest *request = [self.requestSerializer multipartFormRequestWithMethod:@"POST" URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters constructingBodyWithBlock:block error:&serializationError]; @@ -273,18 +210,10 @@ - (NSURLSessionDataTask *)POST:(NSString *)URLString } - (NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self PUT:URLString parameters:parameters headers:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)PUT:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PUT" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure]; @@ -294,18 +223,10 @@ - (NSURLSessionDataTask *)PUT:(NSString *)URLString } - (NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self PATCH:URLString parameters:parameters headers:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)PATCH:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"PATCH" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure]; @@ -315,18 +236,10 @@ - (NSURLSessionDataTask *)PATCH:(NSString *)URLString } - (NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(id)parameters - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure -{ - return [self DELETE:URLString parameters:parameters headers:nil success:success failure:failure]; -} - -- (NSURLSessionDataTask *)DELETE:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers - success:(void (^)(NSURLSessionDataTask *task, id responseObject))success - failure:(void (^)(NSURLSessionDataTask *task, NSError *error))failure + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers + success:(nullable void (^)(NSURLSessionDataTask *task, id responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask *task, NSError *error))failure { NSURLSessionDataTask *dataTask = [self dataTaskWithHTTPMethod:@"DELETE" URLString:URLString parameters:parameters headers:headers uploadProgress:nil downloadProgress:nil success:success failure:failure]; @@ -335,14 +248,15 @@ - (NSURLSessionDataTask *)DELETE:(NSString *)URLString return dataTask; } + - (NSURLSessionDataTask *)dataTaskWithHTTPMethod:(NSString *)method URLString:(NSString *)URLString - parameters:(id)parameters - headers:(NSDictionary *)headers + parameters:(nullable id)parameters + headers:(nullable NSDictionary *)headers uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgress downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgress - success:(void (^)(NSURLSessionDataTask *, id))success - failure:(void (^)(NSURLSessionDataTask *, NSError *))failure + success:(nullable void (^)(NSURLSessionDataTask *task, id _Nullable responseObject))success + failure:(nullable void (^)(NSURLSessionDataTask * _Nullable task, NSError *error))failure { NSError *serializationError = nil; NSMutableURLRequest *request = [self.requestSerializer requestWithMethod:method URLString:[[NSURL URLWithString:URLString relativeToURL:self.baseURL] absoluteString] parameters:parameters error:&serializationError]; @@ -396,11 +310,7 @@ - (instancetype)initWithCoder:(NSCoder *)decoder { if (!configuration) { NSString *configurationIdentifier = [decoder decodeObjectOfClass:[NSString class] forKey:@"identifier"]; if (configurationIdentifier) { -#if (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000) || (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1100) configuration = [NSURLSessionConfiguration backgroundSessionConfigurationWithIdentifier:configurationIdentifier]; -#else - configuration = [NSURLSessionConfiguration backgroundSessionConfiguration:configurationIdentifier]; -#endif } } diff --git a/AFNetworking/AFSecurityPolicy.m b/AFNetworking/AFSecurityPolicy.m index f4e9bac4a5..da199aa3b7 100644 --- a/AFNetworking/AFSecurityPolicy.m +++ b/AFNetworking/AFSecurityPolicy.m @@ -60,7 +60,10 @@ static id AFPublicKeyForCertificate(NSData *certificate) { policy = SecPolicyCreateBasicX509(); __Require_noErr_Quiet(SecTrustCreateWithCertificates(allowedCertificate, policy, &allowedTrust), _out); +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(allowedTrust, &result), _out); +#pragma clang diagnostic pop allowedPublicKey = (__bridge_transfer id)SecTrustCopyPublicKey(allowedTrust); @@ -83,7 +86,10 @@ static id AFPublicKeyForCertificate(NSData *certificate) { static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { BOOL isValid = NO; SecTrustResultType result; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(serverTrust, &result), _out); +#pragma clang diagnostic pop isValid = (result == kSecTrustResultUnspecified || result == kSecTrustResultProceed); @@ -115,10 +121,11 @@ static BOOL AFServerTrustIsValid(SecTrustRef serverTrust) { SecTrustRef trust; __Require_noErr_Quiet(SecTrustCreateWithCertificates(certificates, policy, &trust), _out); - SecTrustResultType result; +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" __Require_noErr_Quiet(SecTrustEvaluate(trust, &result), _out); - +#pragma clang diagnostic pop [trustChain addObject:(__bridge_transfer id)SecTrustCopyPublicKey(trust)]; _out: @@ -237,7 +244,7 @@ - (BOOL)evaluateServerTrust:(SecTrustRef)serverTrust if (self.SSLPinningMode == AFSSLPinningModeNone) { return self.allowInvalidCertificates || AFServerTrustIsValid(serverTrust); - } else if (!AFServerTrustIsValid(serverTrust) && !self.allowInvalidCertificates) { + } else if (!self.allowInvalidCertificates && !AFServerTrustIsValid(serverTrust)) { return NO; } diff --git a/AFNetworking/AFURLResponseSerialization.h b/AFNetworking/AFURLResponseSerialization.h index 490b721f51..abe9db49be 100644 --- a/AFNetworking/AFURLResponseSerialization.h +++ b/AFNetworking/AFURLResponseSerialization.h @@ -62,8 +62,6 @@ id AFJSONObjectByRemovingKeysWithNullValues(id JSONObject, NSJSONReadingOptions - (instancetype)init; -@property (nonatomic, assign) NSStringEncoding stringEncoding DEPRECATED_MSG_ATTRIBUTE("The string encoding is never used. AFHTTPResponseSerializer only validates status codes and content types but does not try to decode the received data in any way."); - /** Creates and returns a serializer with default configuration. */ diff --git a/AFNetworking/AFURLResponseSerialization.m b/AFNetworking/AFURLResponseSerialization.m index 3ddb2fa260..2715a1b319 100755 --- a/AFNetworking/AFURLResponseSerialization.m +++ b/AFNetworking/AFURLResponseSerialization.m @@ -271,6 +271,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -488,6 +492,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -704,6 +712,10 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { @@ -790,13 +802,18 @@ - (id)responseObjectForResponse:(NSURLResponse *)response #pragma mark - NSSecureCoding ++ (BOOL)supportsSecureCoding { + return YES; +} + - (instancetype)initWithCoder:(NSCoder *)decoder { self = [super initWithCoder:decoder]; if (!self) { return nil; } - self.responseSerializers = [decoder decodeObjectOfClass:[NSArray class] forKey:NSStringFromSelector(@selector(responseSerializers))]; + NSSet *classes = [NSSet setWithArray:@[[NSArray class], [AFHTTPResponseSerializer class]]]; + self.responseSerializers = [decoder decodeObjectOfClasses:classes forKey:NSStringFromSelector(@selector(responseSerializers))]; return self; } diff --git a/AFNetworking/AFURLSessionManager.h b/AFNetworking/AFURLSessionManager.h index bb22b31a88..88700c39a9 100644 --- a/AFNetworking/AFURLSessionManager.h +++ b/AFNetworking/AFURLSessionManager.h @@ -165,19 +165,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, strong, nullable) dispatch_group_t completionGroup; -///--------------------------------- -/// @name Working Around System Bugs -///--------------------------------- - -/** - Whether to attempt to retry creation of upload tasks for background sessions when initial call returns `nil`. `NO` by default. - - @bug As of iOS 7.0, there is a bug where upload tasks created for background tasks are sometimes `nil`. As a workaround, if this property is `YES`, AFNetworking will follow Apple's recommendation to try creating the task again. - - @see https://github.com/AFNetworking/AFNetworking/issues/1675 - */ -@property (nonatomic, assign) BOOL attemptsToRecreateUploadTasksForBackgroundSessions; - ///--------------------- /// @name Initialization ///--------------------- @@ -191,13 +178,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (instancetype)initWithSessionConfiguration:(nullable NSURLSessionConfiguration *)configuration NS_DESIGNATED_INITIALIZER; -/** - Invalidates the managed session, optionally canceling pending tasks. - - @param cancelPendingTasks Whether or not to cancel pending tasks. - */ -- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks DEPRECATED_ATTRIBUTE; - /** Invalidates the managed session, optionally canceling pending tasks and optionally resets given session. @@ -210,15 +190,6 @@ NS_ASSUME_NONNULL_BEGIN /// @name Running Data Tasks ///------------------------- -/** - Creates an `NSURLSessionDataTask` with the specified request. - - @param request The HTTP request for the request. - @param completionHandler A block object to be executed when the task finishes. This block has no return value and takes three arguments: the server response, the response object created by that serializer, and the error that occurred, if any. - */ -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(nullable void (^)(NSURLResponse *response, id _Nullable responseObject, NSError * _Nullable error))completionHandler DEPRECATED_ATTRIBUTE; - /** Creates an `NSURLSessionDataTask` with the specified request. @@ -370,13 +341,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)setTaskWillPerformHTTPRedirectionBlock:(nullable NSURLRequest * _Nullable (^)(NSURLSession *session, NSURLSessionTask *task, NSURLResponse *response, NSURLRequest *request))block; -/** - Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. - - @param block A block object to be executed when a session task has received a request specific authentication challenge. The block returns the disposition of the authentication challenge, and takes four arguments: the session, the task, the authentication challenge, and a pointer to the credential that should be used to resolve the challenge. - */ -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(nullable NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * _Nullable __autoreleasing * _Nullable credential))block DEPRECATED_MSG_ATTRIBUTE("Use setAuthenticationChallengeHandler: instead."); - /** Sets a block to be executed when a session task has received a request specific authentication challenge, as handled by the `NSURLSessionTaskDelegate` method `URLSession:task:didReceiveChallenge:completionHandler:`. diff --git a/AFNetworking/AFURLSessionManager.m b/AFNetworking/AFURLSessionManager.m index 68924075ab..a976c51191 100644 --- a/AFNetworking/AFURLSessionManager.m +++ b/AFNetworking/AFURLSessionManager.m @@ -58,8 +58,6 @@ static dispatch_group_t url_session_manager_completion_group() { static NSString * const AFURLSessionManagerLockName = @"com.alamofire.networking.session.manager.lock"; -static NSUInteger const AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask = 3; - typedef void (^AFURLSessionDidBecomeInvalidBlock)(NSURLSession *session, NSError *error); typedef NSURLSessionAuthChallengeDisposition (^AFURLSessionDidReceiveAuthenticationChallengeBlock)(NSURLSession *session, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential); @@ -131,7 +129,7 @@ - (instancetype)initWithTask:(NSURLSessionTask *)task { [weakTask suspend]; }; #if AF_CAN_USE_AT_AVAILABLE - if (@available(iOS 9, macOS 10.11, *)) + if (@available(macOS 10.11, *)) #else if ([progress respondsToSelector:@selector(setResumingHandler:)]) #endif @@ -197,7 +195,7 @@ - (void)URLSession:(__unused NSURLSession *)session __block id responseObject = nil; - __block NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; + NSMutableDictionary *userInfo = [NSMutableDictionary dictionary]; userInfo[AFNetworkingTaskDidCompleteResponseSerializerKey] = manager.responseSerializer; //Performance Improvement from #2672 @@ -474,7 +472,6 @@ @interface AFURLSessionManager () @property (readwrite, nonatomic, copy) AFURLSessionDidReceiveAuthenticationChallengeBlock sessionDidReceiveAuthenticationChallenge; @property (readwrite, nonatomic, copy) AFURLSessionDidFinishEventsForBackgroundURLSessionBlock didFinishEventsForBackgroundURLSession AF_API_UNAVAILABLE(macos); @property (readwrite, nonatomic, copy) AFURLSessionTaskWillPerformHTTPRedirectionBlock taskWillPerformHTTPRedirection; -@property (readwrite, nonatomic, copy) AFURLSessionTaskDidReceiveAuthenticationChallengeBlock taskDidReceiveAuthenticationChallenge; @property (readwrite, nonatomic, copy) AFURLSessionTaskAuthenticationChallengeBlock authenticationChallengeHandler; @property (readwrite, nonatomic, copy) AFURLSessionTaskNeedNewBodyStreamBlock taskNeedNewBodyStream; @property (readwrite, nonatomic, copy) AFURLSessionTaskDidSendBodyDataBlock taskDidSendBodyData; @@ -716,10 +713,6 @@ - (NSArray *)downloadTasks { #pragma mark - -- (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks { - [self invalidateSessionCancelingTasks:cancelPendingTasks resetSession:NO]; -} - - (void)invalidateSessionCancelingTasks:(BOOL)cancelPendingTasks resetSession:(BOOL)resetSession { if (cancelPendingTasks) { [self.session invalidateAndCancel]; @@ -752,12 +745,6 @@ - (void)removeNotificationObserverForTask:(NSURLSessionTask *)task { #pragma mark - -- (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request - completionHandler:(void (^)(NSURLResponse *response, id responseObject, NSError *error))completionHandler -{ - return [self dataTaskWithRequest:request uploadProgress:nil downloadProgress:nil completionHandler:completionHandler]; -} - - (NSURLSessionDataTask *)dataTaskWithRequest:(NSURLRequest *)request uploadProgress:(nullable void (^)(NSProgress *uploadProgress)) uploadProgressBlock downloadProgress:(nullable void (^)(NSProgress *downloadProgress)) downloadProgressBlock @@ -779,13 +766,6 @@ - (NSURLSessionUploadTask *)uploadTaskWithRequest:(NSURLRequest *)request { NSURLSessionUploadTask *uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; - // uploadTask may be nil on iOS7 because uploadTaskWithRequest:fromFile: may return nil despite being documented as nonnull (https://devforums.apple.com/message/926113#926113) - if (!uploadTask && self.attemptsToRecreateUploadTasksForBackgroundSessions && self.session.configuration.identifier) { - for (NSUInteger attempts = 0; !uploadTask && attempts < AFMaximumNumberOfAttemptsToRecreateBackgroundSessionUploadTask; attempts++) { - uploadTask = [self.session uploadTaskWithRequest:request fromFile:fileURL]; - } - } - if (uploadTask) { [self addDelegateForUploadTask:uploadTask progress:uploadProgressBlock @@ -879,10 +859,6 @@ - (void)setTaskWillPerformHTTPRedirectionBlock:(NSURLRequest * (^)(NSURLSession self.taskWillPerformHTTPRedirection = block; } -- (void)setTaskDidReceiveAuthenticationChallengeBlock:(NSURLSessionAuthChallengeDisposition (^)(NSURLSession *session, NSURLSessionTask *task, NSURLAuthenticationChallenge *challenge, NSURLCredential * __autoreleasing *credential))block { - self.taskDidReceiveAuthenticationChallenge = block; -} - - (void)setTaskDidSendBodyDataBlock:(void (^)(NSURLSession *session, NSURLSessionTask *task, int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend))block { self.taskDidSendBodyData = block; } @@ -1009,7 +985,6 @@ - (void)URLSession:(NSURLSession *)session NSURLCredential *credential = nil; if (self.authenticationChallengeHandler) { - NSAssert(self.taskDidReceiveAuthenticationChallenge == nil, @"Do not call both `setAuthenticationChallengeHandler:` and `setTaskDidReceiveAuthenticationChallengeBlock:`"); id result = self.authenticationChallengeHandler(session, task, challenge, completionHandler); if (result == nil) { return; @@ -1026,9 +1001,6 @@ - (void)URLSession:(NSURLSession *)session } else { @throw [NSException exceptionWithName:@"Invalid Return Value" reason:@"The return value from the authentication challenge handler must be nil, an NSError, an NSURLCredential or an NSNumber." userInfo:nil]; } - } else if (self.taskDidReceiveAuthenticationChallenge) { - NSLog(@"WARNING: -[AFURLSessionManager setTaskDidReceiveAuthenticationChallengeBlock:] is deprecated, use -[AFURLSessionManager setAuthenticationChallengeHandler:] instead."); - disposition = self.taskDidReceiveAuthenticationChallenge(session, task, challenge, &credential); } else { evaluateServerTrust = YES; } diff --git a/Example/AFNetworking Example.xcodeproj/project.pbxproj b/Example/AFNetworking Example.xcodeproj/project.pbxproj index 49e90425af..5ccf69afb5 100644 --- a/Example/AFNetworking Example.xcodeproj/project.pbxproj +++ b/Example/AFNetworking Example.xcodeproj/project.pbxproj @@ -525,10 +525,9 @@ }; buildConfigurationList = 29E6F16E1BB9DA2E00A4466C /* Build configuration list for PBXProject "AFNetworking Example" */; compatibilityVersion = "Xcode 3.2"; - developmentRegion = English; + developmentRegion = en; hasScannedForEncodings = 0; knownRegions = ( - English, en, Base, ); @@ -929,7 +928,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; @@ -973,7 +972,7 @@ GCC_WARN_UNUSED_VARIABLE = YES; INFOPLIST_FILE = "macOS Example/Info.plist"; LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; - MACOSX_DEPLOYMENT_TARGET = 10.10; + MACOSX_DEPLOYMENT_TARGET = 10.11; MTL_ENABLE_DEBUG_INFO = NO; PRODUCT_BUNDLE_IDENTIFIER = "com.alamofire.macOS-Example"; PRODUCT_NAME = "$(TARGET_NAME)"; diff --git a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme index 60733acde5..af3dda85cd 100644 --- a/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme +++ b/Example/AFNetworking Example.xcodeproj/xcshareddata/xcschemes/iOS Example.xcscheme @@ -1,6 +1,6 @@ + shouldUseLaunchSchemeArgsEnv = "YES" + enableThreadSanitizer = "YES" + enableUBSanitizer = "YES"> + + + + + + + + @@ -53,17 +71,6 @@ - - - - - - - - + + + + @@ -68,23 +77,13 @@ - - - - - - - - + + + + @@ -53,22 +62,13 @@ - - - - - - + + + + + + @@ -53,22 +62,13 @@ - - - - - - + + - - - - + + - - - - + + - + - + @@ -160,33 +160,32 @@ - + - - + + - + - + - + - - + + - + - @@ -194,11 +193,11 @@ - + - + @@ -223,14 +222,12 @@ - + - - - + Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad mi. @@ -241,15 +238,14 @@ - - + - - - + + + @@ -264,23 +260,24 @@ - - - - - + + + + + diff --git a/Framework/Info.plist b/Framework/Info.plist index 3a389bb15d..36e428553d 100644 --- a/Framework/Info.plist +++ b/Framework/Info.plist @@ -15,11 +15,11 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 3.1.0 + $(MARKETING_VERSION) CFBundleSignature ???? CFBundleVersion - 3.2.1 + $(MARKETING_VERSION) NSPrincipalClass diff --git a/Gemfile b/Gemfile new file mode 100644 index 0000000000..a43c93aa2f --- /dev/null +++ b/Gemfile @@ -0,0 +1,5 @@ +source "https://rubygems.org" + +gem "fastlane" +gem "cocoapods" +gem "xcode-install" \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000000..70dc844f2a --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,248 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (3.0.2) + activesupport (4.2.11.1) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + algoliasearch (1.27.1) + httpclient (~> 2.8, >= 2.8.3) + json (>= 1.5.1) + atomos (0.1.3) + aws-eventstream (1.0.3) + aws-partitions (1.290.0) + aws-sdk-core (3.92.0) + aws-eventstream (~> 1.0, >= 1.0.2) + aws-partitions (~> 1, >= 1.239.0) + aws-sigv4 (~> 1.1) + jmespath (~> 1.0) + aws-sdk-kms (1.30.0) + aws-sdk-core (~> 3, >= 3.71.0) + aws-sigv4 (~> 1.1) + aws-sdk-s3 (1.61.1) + aws-sdk-core (~> 3, >= 3.83.0) + aws-sdk-kms (~> 1) + aws-sigv4 (~> 1.1) + aws-sigv4 (1.1.1) + aws-eventstream (~> 1.0, >= 1.0.2) + babosa (1.0.3) + claide (1.0.3) + cocoapods (1.9.1) + activesupport (>= 4.0.2, < 5) + claide (>= 1.0.2, < 2.0) + cocoapods-core (= 1.9.1) + cocoapods-deintegrate (>= 1.0.3, < 2.0) + cocoapods-downloader (>= 1.2.2, < 2.0) + cocoapods-plugins (>= 1.0.0, < 2.0) + cocoapods-search (>= 1.0.0, < 2.0) + cocoapods-stats (>= 1.0.0, < 2.0) + cocoapods-trunk (>= 1.4.0, < 2.0) + cocoapods-try (>= 1.1.0, < 2.0) + colored2 (~> 3.1) + escape (~> 0.0.4) + fourflusher (>= 2.3.0, < 3.0) + gh_inspector (~> 1.0) + molinillo (~> 0.6.6) + nap (~> 1.0) + ruby-macho (~> 1.4) + xcodeproj (>= 1.14.0, < 2.0) + cocoapods-core (1.9.1) + activesupport (>= 4.0.2, < 6) + algoliasearch (~> 1.0) + concurrent-ruby (~> 1.1) + fuzzy_match (~> 2.0.4) + nap (~> 1.0) + netrc (~> 0.11) + typhoeus (~> 1.0) + cocoapods-deintegrate (1.0.4) + cocoapods-downloader (1.3.0) + cocoapods-plugins (1.0.0) + nap + cocoapods-search (1.0.0) + cocoapods-stats (1.1.0) + cocoapods-trunk (1.4.1) + nap (>= 0.8, < 2.0) + netrc (~> 0.11) + cocoapods-try (1.1.0) + colored (1.2) + colored2 (3.1.2) + commander-fastlane (4.4.6) + highline (~> 1.7.2) + concurrent-ruby (1.1.6) + declarative (0.0.10) + declarative-option (0.1.0) + digest-crc (0.5.1) + domain_name (0.5.20190701) + unf (>= 0.0.5, < 1.0.0) + dotenv (2.7.5) + emoji_regex (1.0.1) + escape (0.0.4) + ethon (0.12.0) + ffi (>= 1.3.0) + excon (0.73.0) + faraday (0.17.3) + 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.7) + fastlane (2.144.0) + CFPropertyList (>= 2.3, < 4.0.0) + addressable (>= 2.3, < 3.0.0) + aws-sdk-s3 (~> 1.0) + babosa (>= 1.0.2, < 2.0.0) + bundler (>= 1.12.0, < 3.0.0) + colored + commander-fastlane (>= 4.4.6, < 5.0.0) + dotenv (>= 2.1.1, < 3.0.0) + emoji_regex (>= 0.1, < 2.0) + excon (>= 0.71.0, < 1.0.0) + faraday (~> 0.17) + faraday-cookie_jar (~> 0.0.6) + faraday_middleware (~> 0.13.1) + fastimage (>= 2.1.0, < 3.0.0) + gh_inspector (>= 1.1.2, < 2.0.0) + google-api-client (>= 0.29.2, < 0.37.0) + google-cloud-storage (>= 1.15.0, < 2.0.0) + highline (>= 1.7.2, < 2.0.0) + json (< 3.0.0) + 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.3.0, < 2.0.0) + security (= 0.1.3) + simctl (~> 1.6.3) + slack-notifier (>= 2.0.0, < 3.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.13.0, < 2.0.0) + xcpretty (~> 0.3.0) + xcpretty-travis-formatter (>= 0.0.3) + ffi (1.12.2) + fourflusher (2.3.1) + fuzzy_match (2.0.4) + gh_inspector (1.1.3) + google-api-client (0.36.4) + addressable (~> 2.5, >= 2.5.1) + googleauth (~> 0.9) + httpclient (>= 2.8.1, < 3.0) + mini_mime (~> 1.0) + representable (~> 3.0) + retriable (>= 2.0, < 4.0) + signet (~> 0.12) + google-cloud-core (1.5.0) + google-cloud-env (~> 1.0) + google-cloud-errors (~> 1.0) + google-cloud-env (1.3.1) + faraday (>= 0.17.3, < 2.0) + google-cloud-errors (1.0.0) + google-cloud-storage (1.25.1) + addressable (~> 2.5) + digest-crc (~> 0.4) + google-api-client (~> 0.33) + google-cloud-core (~> 1.2) + googleauth (~> 0.9) + mini_mime (~> 1.0) + googleauth (0.11.0) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.4, < 3.0) + memoist (~> 0.16) + multi_json (~> 1.11) + os (>= 0.9, < 2.0) + signet (~> 0.12) + highline (1.7.10) + http-cookie (1.0.3) + domain_name (~> 0.5) + httpclient (2.8.3) + i18n (0.9.5) + concurrent-ruby (~> 1.0) + jmespath (1.4.0) + json (2.3.0) + jwt (2.1.0) + memoist (0.16.2) + mini_magick (4.10.1) + mini_mime (1.0.2) + minitest (5.14.0) + molinillo (0.6.6) + multi_json (1.14.1) + multi_xml (0.6.0) + multipart-post (2.0.0) + nanaimo (0.2.6) + nap (1.1.0) + naturally (2.2.0) + netrc (0.11.0) + os (1.0.1) + plist (3.5.0) + public_suffix (2.0.5) + representable (3.0.4) + declarative (< 0.1.0) + declarative-option (< 0.2.0) + uber (< 0.2.0) + retriable (3.1.2) + rouge (2.0.7) + ruby-macho (1.4.0) + rubyzip (1.3.0) + security (0.1.3) + signet (0.13.2) + addressable (~> 2.3) + faraday (>= 0.17.3, < 2.0) + jwt (>= 1.5, < 3.0) + multi_json (~> 1.10) + simctl (1.6.8) + CFPropertyList + naturally + slack-notifier (2.3.2) + terminal-notifier (2.0.0) + terminal-table (1.8.0) + unicode-display_width (~> 1.1, >= 1.1.1) + thread_safe (0.3.6) + tty-cursor (0.7.1) + tty-screen (0.7.1) + tty-spinner (0.9.3) + tty-cursor (~> 0.7) + typhoeus (1.3.1) + ethon (>= 0.9.0) + tzinfo (1.2.6) + thread_safe (~> 0.1) + uber (0.1.0) + unf (0.1.4) + unf_ext + unf_ext (0.0.7.6) + unicode-display_width (1.7.0) + word_wrap (1.0.0) + xcode-install (2.6.3) + claide (>= 0.9.1, < 1.1.0) + fastlane (>= 2.1.0, < 3.0.0) + xcodeproj (1.15.0) + CFPropertyList (>= 2.3.3, < 4.0) + atomos (~> 0.1.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.6) + xcpretty (0.3.0) + rouge (~> 2.0.7) + xcpretty-travis-formatter (1.0.0) + xcpretty (~> 0.2, >= 0.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + cocoapods + fastlane + xcode-install + +BUNDLED WITH + 2.1.2 diff --git a/LICENSE b/LICENSE index d7076267c4..f611f42f35 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) 2011-2016 Alamofire Software Foundation (http://alamofire.org/) +Copyright (c) 2011-2020 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 diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000000..fe6e38db65 --- /dev/null +++ b/Package.swift @@ -0,0 +1,37 @@ +// swift-tools-version:5.0 +// +// Package.swift +// +// Copyright (c) 2020 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. +// + +import PackageDescription + +let package = Package(name: "AFNetworking", + platforms: [.macOS(.v10_10), + .iOS(.v9), + .tvOS(.v9), + .watchOS(.v2)], + products: [.library(name: "AFNetworking", + targets: ["AFNetworking"])], + targets: [.target(name: "AFNetworking", + path: "AFNetworking", + publicHeadersPath: "AFNetworking")]) diff --git a/README.md b/README.md index 2852c8b971..f416c949ad 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,7 @@ AFNetworking

-[![Build Status](https://travis-ci.org/AFNetworking/AFNetworking.svg)](https://travis-ci.org/AFNetworking/AFNetworking) -[![codecov.io](https://codecov.io/github/AFNetworking/AFNetworking/coverage.svg?branch=master)](https://codecov.io/github/AFNetworking/AFNetworking?branch=master) +[![Build Status](https://github.com/AFNetworking/AFNetworking/workflows/AFNetworking%20CI/badge.svg?branch=master)](https://github.com/AFNetworking/AFNetworking/actions) [![CocoaPods Compatible](https://img.shields.io/cocoapods/v/AFNetworking.svg)](https://img.shields.io/cocoapods/v/AFNetworking.svg) [![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage) [![Platform](https://img.shields.io/cocoapods/p/AFNetworking.svg?style=flat)](http://cocoadocs.org/docsets/AFNetworking) @@ -20,7 +19,6 @@ Choose AFNetworking for your next project, or migrate over your existing project - [Download AFNetworking](https://github.com/AFNetworking/AFNetworking/archive/master.zip) and try out the included Mac and iPhone example apps - Read the ["Getting Started" guide](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking), [FAQ](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-FAQ), or [other articles on the Wiki](https://github.com/AFNetworking/AFNetworking/wiki) - Check out the [documentation](http://cocoadocs.org/docsets/AFNetworking/) for a comprehensive look at all of the APIs available in AFNetworking -- Read the [AFNetworking 3.0 Migration Guide](https://github.com/AFNetworking/AFNetworking/wiki/AFNetworking-3.0-Migration-Guide) for an overview of the architectural changes from 2.0. ## Communication @@ -35,48 +33,31 @@ AFNetworking supports multiple methods for installing the library in a project. ## Installation with CocoaPods -[CocoaPods](http://cocoapods.org) is a dependency manager for Objective-C, which automates and simplifies the process of using 3rd-party libraries like AFNetworking in your projects. See the ["Getting Started" guide for more information](https://github.com/AFNetworking/AFNetworking/wiki/Getting-Started-with-AFNetworking). You can install it with the following command: +To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: -```bash -$ gem install cocoapods +```ruby +pod 'AFNetworking', '~> 4.0' ``` -> CocoaPods 0.39.0+ is required to build AFNetworking 3.0.0+. - -#### Podfile -To integrate AFNetworking into your Xcode project using CocoaPods, specify it in your `Podfile`: +### Installation with Swift Package Manager -```ruby -source 'https://cdn.cocoapods.org/' -platform :ios, '8.0' +Once you have your Swift package set up, adding AFNetworking as a dependency is as easy as adding it to the `dependencies` value of your `Package.swift`. -target 'TargetName' do -pod 'AFNetworking', '~> 3.0' -end +```swift +dependencies: [ + .package(url: "https://github.com/AFNetworking/AFNetworking.git", .upToNextMajor(from: "4.0.0")) +] ``` -Then, run the following command: - -```bash -$ pod install -``` +> Note: AFNetworking's Swift package does not include it's UIKit extensions. ### Installation with Carthage [Carthage](https://github.com/Carthage/Carthage) is a decentralized dependency manager that builds your dependencies and provides you with binary frameworks. -You can install Carthage with [Homebrew](http://brew.sh/) using the following command: - -```bash -$ brew update -$ brew install carthage -``` - -To integrate AFNetworking into your Xcode project using Carthage, specify it in your `Cartfile`: - ```ogdl -github "AFNetworking/AFNetworking" ~> 3.0 +github "AFNetworking/AFNetworking" ~> 4.0 ``` Run `carthage` to build the framework and drag the built `AFNetworking.framework` into your Xcode project. @@ -85,6 +66,7 @@ Run `carthage` to build the framework and drag the built `AFNetworking.framework | AFNetworking Version | Minimum iOS Target | Minimum macOS Target | Minimum watchOS Target | Minimum tvOS Target | Notes | |:--------------------:|:---------------------------:|:----------------------------:|:----------------------------:|:----------------------------:|:-------------------------------------------------------------------------:| +| 4.x | iOS 9 | macOS 10.10 | watchOS 2.0 | tvOS 9.0 | Xcode +9+ is required. | | 3.x | iOS 7 | OS X 10.9 | watchOS 2.0 | tvOS 9.0 | Xcode 7+ is required. `NSURLConnectionOperation` support has been removed. | | 2.6 -> 2.6.3 | iOS 7 | OS X 10.9 | watchOS 2.0 | n/a | Xcode 7+ is required. | | 2.0 -> 2.5.4 | iOS 6 | OS X 10.8 | n/a | n/a | Xcode 5+ is required. `NSURLSession` subspec requires iOS 7 or OS X 10.9. | diff --git a/Tests/Info.plist b/Tests/Info.plist index 32379bec19..169b6f710e 100644 --- a/Tests/Info.plist +++ b/Tests/Info.plist @@ -7,7 +7,7 @@ CFBundleExecutable ${EXECUTABLE_NAME} CFBundleIdentifier - com.alamofire.afnetworking.${PRODUCT_NAME:rfc1034identifier} + $(PRODUCT_BUNDLE_IDENTIFIER) CFBundleInfoDictionaryVersion 6.0 CFBundlePackageType diff --git a/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer b/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer index b2b0c26c41..8ba123fbcf 100644 Binary files a/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer and b/Tests/Resources/HTTPBin.org/HTTPBinOrgServerTrustChain/httpbin_0.cer differ diff --git a/Tests/Resources/HTTPBin.org/httpbinorg_02182021.cer b/Tests/Resources/HTTPBin.org/httpbinorg_02182021.cer new file mode 100644 index 0000000000..8ba123fbcf Binary files /dev/null and b/Tests/Resources/HTTPBin.org/httpbinorg_02182021.cer differ diff --git a/Tests/Resources/HTTPBin.org/httpbinorg_03172020.cer b/Tests/Resources/HTTPBin.org/httpbinorg_03172020.cer deleted file mode 100644 index b2b0c26c41..0000000000 Binary files a/Tests/Resources/HTTPBin.org/httpbinorg_03172020.cer and /dev/null differ diff --git a/Tests/Tests/AFAutoPurgingImageCacheTests.m b/Tests/Tests/AFAutoPurgingImageCacheTests.m index d5679151c0..2e2b83f954 100644 --- a/Tests/Tests/AFAutoPurgingImageCacheTests.m +++ b/Tests/Tests/AFAutoPurgingImageCacheTests.m @@ -211,7 +211,7 @@ - (void)testThatPrioritizedImagesWithOldestLastAccessDatesAreRemovedDuringPurge [self.cache addImage:self.testImage withIdentifier:identifier]; } - NSString * firstIdentifier = [NSString stringWithFormat:@"image-%ld",(long)0]; + NSString *firstIdentifier = [NSString stringWithFormat:@"image-%ld",(long)0]; UIImage *firstImage = [self.cache imageWithIdentifier:firstIdentifier]; XCTAssertNotNil(firstImage, @"first image should not be nil"); UInt64 prePurgeMemoryUsage = self.cache.memoryUsage; diff --git a/Tests/Tests/AFCompoundResponseSerializerTests.m b/Tests/Tests/AFCompoundResponseSerializerTests.m index c399c24da1..894158f3ea 100644 --- a/Tests/Tests/AFCompoundResponseSerializerTests.m +++ b/Tests/Tests/AFCompoundResponseSerializerTests.m @@ -81,9 +81,9 @@ - (void)testCompoundSerializerCanBeArchivedAndUnarchived { AFImageResponseSerializer *imageSerializer = [AFImageResponseSerializer serializer]; AFJSONResponseSerializer *jsonSerializer = [AFJSONResponseSerializer serializer]; AFCompoundResponseSerializer *compoundSerializer = [AFCompoundResponseSerializer compoundSerializerWithResponseSerializers:@[imageSerializer, jsonSerializer]]; - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:compoundSerializer]; + NSData *data = [self archivedDataWithRootObject:compoundSerializer]; XCTAssertNotNil(data); - AFCompoundResponseSerializer *unarchivedSerializer = [NSKeyedUnarchiver unarchiveObjectWithData:data]; + AFCompoundResponseSerializer *unarchivedSerializer = [self unarchivedObjectOfClass:[AFCompoundResponseSerializer class] fromData:data]; XCTAssertNotNil(unarchivedSerializer); XCTAssertNotEqual(unarchivedSerializer, compoundSerializer); XCTAssertTrue(compoundSerializer.responseSerializers.count == compoundSerializer.responseSerializers.count); diff --git a/Tests/Tests/AFHTTPSessionManagerTests.m b/Tests/Tests/AFHTTPSessionManagerTests.m index 2cc40cad7e..a6c7b1b2f2 100644 --- a/Tests/Tests/AFHTTPSessionManagerTests.m +++ b/Tests/Tests/AFHTTPSessionManagerTests.m @@ -207,13 +207,13 @@ - (void)testSupportsSecureCoding { } - (void)testCanBeEncoded { - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.sessionManager]; + NSData *data = [self archivedDataWithRootObject:self.sessionManager]; XCTAssertNotNil(data); } - (void)testCanBeDecoded { - NSData *data = [NSKeyedArchiver archivedDataWithRootObject:self.sessionManager]; - AFHTTPSessionManager *newManager = [NSKeyedUnarchiver unarchiveObjectWithData:data]; + NSData *data = [self archivedDataWithRootObject:self.sessionManager]; + AFHTTPSessionManager *newManager = [self unarchivedObjectOfClass:[AFHTTPSessionManager class] fromData:data];; XCTAssertNotNil(newManager.securityPolicy); XCTAssertNotNil(newManager.requestSerializer); XCTAssertNotNil(newManager.responseSerializer); @@ -294,75 +294,6 @@ - (void)testUploadProgressIsReportedForStreamingPost { [self waitForExpectationsWithCommonTimeout]; } -# pragma mark - Deprecated Progress - -- (void)testDownloadProgressIsReportedForDeprecatedGET { - __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - GET:@"image" - parameters:nil - progress:^(NSProgress * _Nonnull downloadProgress) { - if (downloadProgress.fractionCompleted == 1.0) { - [expectation fulfill]; - } - } - success:nil - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testUploadProgressIsReportedForDeprecatedPOST { - NSMutableString *payload = [NSMutableString stringWithString:@"AFNetworking"]; - while ([payload lengthOfBytesUsingEncoding:NSUTF8StringEncoding] < 20000) { - [payload appendString:@"AFNetworking"]; - } - - __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:payload - progress:^(NSProgress * _Nonnull uploadProgress) { - if (uploadProgress.fractionCompleted == 1.0) { - [expectation fulfill]; - } - } - success:nil - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testUploadProgressIsReportedForStreamingDeprecatedPost { - NSMutableString *payload = [NSMutableString stringWithString:@"AFNetworking"]; - while ([payload lengthOfBytesUsingEncoding:NSUTF8StringEncoding] < 20000) { - [payload appendString:@"AFNetworking"]; - } - - __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Progress Should equal 1.0"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:nil - constructingBodyWithBlock:^(id _Nonnull formData) { - [formData appendPartWithFileData:[payload dataUsingEncoding:NSUTF8StringEncoding] name:@"AFNetworking" fileName:@"AFNetworking" mimeType:@"text/html"]; - } - progress:^(NSProgress * _Nonnull uploadProgress) { - if (uploadProgress.fractionCompleted == 1.0) { - [expectation fulfill]; - } - } - success:nil - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - # pragma mark - HTTP Status Codes - (void)testThatSuccessBlockIsCalledFor200 { @@ -526,186 +457,6 @@ - (void)testPATCH { [self waitForExpectationsWithCommonTimeout]; } -#pragma mark - Deprecated Rest Interface - -- (void)testDeprecatedGETWithoutProgress { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - GET:@"get" - parameters:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertNotNil(responseObject); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPOSTWithoutProgress { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:@{@"key":@"value"} - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPOSTWithoutProgressWithConstructingBody { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:@{@"key":@"value"} - constructingBodyWithBlock:^(id _Nonnull formData) { - [formData appendPartWithFileData:[@"Data" dataUsingEncoding:NSUTF8StringEncoding] - name:@"DataName" - fileName:@"DataFileName" - mimeType:@"data"]; - } - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"files"][@"DataName"] isEqualToString:@"Data"]); - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - - -- (void)testDeprecatedGETWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - GET:@"get" - parameters:nil - progress:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertNotNil(responseObject); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedHEADWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - HEAD:@"get" - parameters:nil - success:^(NSURLSessionDataTask * _Nonnull task) { - XCTAssertNotNil(task); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPOSTWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:@{@"key":@"value"} - progress:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPOSTWithoutHeadersWithConstructingBody { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - POST:@"post" - parameters:@{@"key":@"value"} - constructingBodyWithBlock:^(id _Nonnull formData) { - [formData appendPartWithFileData:[@"Data" dataUsingEncoding:NSUTF8StringEncoding] - name:@"DataName" - fileName:@"DataFileName" - mimeType:@"data"]; - } - progress:nil - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"files"][@"DataName"] isEqualToString:@"Data"]); - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPUTWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - PUT:@"put" - parameters:@{@"key":@"value"} - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedDELETEWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - DELETE:@"delete" - parameters:@{@"key":@"value"} - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"args"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - -- (void)testDeprecatedPATCHWithoutHeaders { - XCTestExpectation *expectation = [self expectationWithDescription:@"Request should succeed"]; -#pragma clang diagnostic push -#pragma clang diagnostic ignored "-Wdeprecated-declarations" - [self.sessionManager - PATCH:@"patch" - parameters:@{@"key":@"value"} - success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { - XCTAssertTrue([responseObject[@"form"][@"key"] isEqualToString:@"value"]); - [expectation fulfill]; - } - failure:nil]; -#pragma clang diagnostic pop - [self waitForExpectationsWithCommonTimeout]; -} - #pragma mark - Auth - (void)testHiddenBasicAuthentication { @@ -833,16 +584,17 @@ - (void)testInvalidServerTrustProducesCorrectErrorForPublicKeyPinning { - (void)testAuthenticationChallengeHandlerCredentialResult { __weak XCTestExpectation *expectation = [self expectationWithDescription:@"Request succeed with provided credentials"]; - self.manager.responseSerializer = [AFHTTPResponseSerializer serializer]; - [self.manager setAuthenticationChallengeHandler:^id _Nonnull(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLAuthenticationChallenge * _Nonnull challenge, void (^ _Nonnull completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)) { + self.sessionManager.responseSerializer = [AFHTTPResponseSerializer serializer]; + [self.sessionManager setAuthenticationChallengeHandler:^id _Nonnull(NSURLSession * _Nonnull session, NSURLSessionTask * _Nonnull task, NSURLAuthenticationChallenge * _Nonnull challenge, void (^ _Nonnull completionHandler)(NSURLSessionAuthChallengeDisposition, NSURLCredential * _Nullable)) { if ([challenge.protectionSpace.realm isEqualToString:@"Fake Realm"]) { return [NSURLCredential credentialWithUser:@"user" password:@"passwd" persistence:NSURLCredentialPersistenceNone]; } return @(NSURLSessionAuthChallengePerformDefaultHandling); }]; - [self.manager + [self.sessionManager GET:@"basic-auth/user/passwd" parameters:nil + headers:nil progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) { [expectation fulfill]; @@ -852,7 +604,6 @@ - (void)testAuthenticationChallengeHandlerCredentialResult { [expectation fulfill]; }]; [self waitForExpectationsWithCommonTimeoutUsingHandler:nil]; - [self.manager invalidateSessionCancelingTasks:YES]; } @end diff --git a/Tests/Tests/AFImageResponseSerializerTests.m b/Tests/Tests/AFImageResponseSerializerTests.m index b075041736..c65587c60f 100644 --- a/Tests/Tests/AFImageResponseSerializerTests.m +++ b/Tests/Tests/AFImageResponseSerializerTests.m @@ -56,11 +56,11 @@ - (void)testImageSerializerSupportsSecureCoding { - (void)testImageSerializerCanBeArchivedAndUnarchived { AFImageResponseSerializer *responseSerializer = [AFImageResponseSerializer serializer]; - NSData *archive = nil; + NSData *archive = nil; - archive = [NSKeyedArchiver archivedDataWithRootObject:responseSerializer]; + archive = [self archivedDataWithRootObject:responseSerializer]; XCTAssertNotNil(archive); - AFImageResponseSerializer *unarchivedSerializer = [NSKeyedUnarchiver unarchiveObjectWithData:archive]; + AFImageResponseSerializer *unarchivedSerializer = [self unarchivedObjectOfClass:[AFImageResponseSerializer class] fromData:archive]; XCTAssertNotNil(unarchivedSerializer); XCTAssertNotEqual(unarchivedSerializer, responseSerializer); XCTAssertTrue([unarchivedSerializer.acceptableContentTypes isEqualToSet:responseSerializer.acceptableContentTypes]); @@ -83,9 +83,9 @@ - (void)testImageSerializerCanBeArchivedAndUnarchivedWithNonDefaultPropertyValue responseSerializer.imageScale = responseSerializer.imageScale * 2.0f; #endif - archive = [NSKeyedArchiver archivedDataWithRootObject:responseSerializer]; + archive = [self archivedDataWithRootObject:responseSerializer]; XCTAssertNotNil(archive); - AFImageResponseSerializer *unarchivedSerializer = [NSKeyedUnarchiver unarchiveObjectWithData:archive]; + AFImageResponseSerializer *unarchivedSerializer = [self unarchivedObjectOfClass:[AFImageResponseSerializer class] fromData:archive]; XCTAssertNotNil(unarchivedSerializer); XCTAssertNotEqual(unarchivedSerializer, responseSerializer); diff --git a/Tests/Tests/AFJSONSerializationTests.m b/Tests/Tests/AFJSONSerializationTests.m index 8be5bfeccd..e17b1932a3 100644 --- a/Tests/Tests/AFJSONSerializationTests.m +++ b/Tests/Tests/AFJSONSerializationTests.m @@ -206,4 +206,23 @@ - (void)testThatJSONResponseSerializerCanBeCopied { XCTAssertEqual(copiedSerializer.removesKeysWithNullValues, self.responseSerializer.removesKeysWithNullValues); } +#pragma mark NSSecureCoding + +- (void)testJSONSerializerSupportsSecureCoding { + XCTAssertTrue([AFJSONResponseSerializer supportsSecureCoding]); +} + +- (void)testJSONSerializerCanBeArchivedAndUnarchived { + AFJSONResponseSerializer *responseSerializer = [AFJSONResponseSerializer serializer]; + NSData *archive = nil; + + archive = [self archivedDataWithRootObject:responseSerializer]; + XCTAssertNotNil(archive); + AFJSONResponseSerializer *unarchivedSerializer = [self unarchivedObjectOfClass:[AFJSONResponseSerializer class] fromData:archive]; + XCTAssertNotNil(unarchivedSerializer); + XCTAssertNotEqual(unarchivedSerializer, responseSerializer); + XCTAssertTrue([unarchivedSerializer.acceptableContentTypes isEqualToSet:responseSerializer.acceptableContentTypes]); + XCTAssertTrue([unarchivedSerializer.acceptableStatusCodes isEqualToIndexSet:responseSerializer.acceptableStatusCodes]); +} + @end diff --git a/Tests/Tests/AFPropertyListResponseSerializerTests.m b/Tests/Tests/AFPropertyListResponseSerializerTests.m index ec5953e1c0..7bbeb57f9d 100644 --- a/Tests/Tests/AFPropertyListResponseSerializerTests.m +++ b/Tests/Tests/AFPropertyListResponseSerializerTests.m @@ -82,9 +82,9 @@ - (void)testResponseSerializerCanBeCopied { } - (void)testResponseSerializerCanBeArchivedAndUnarchived { - NSData *archive = [NSKeyedArchiver archivedDataWithRootObject:self.responseSerializer]; + NSData *archive = [self archivedDataWithRootObject:self.responseSerializer]; XCTAssertNotNil(archive); - AFPropertyListResponseSerializer *unarchivedSerializer = [NSKeyedUnarchiver unarchiveObjectWithData:archive]; + AFPropertyListResponseSerializer *unarchivedSerializer = [self unarchivedObjectOfClass:[AFPropertyListResponseSerializer class] fromData:archive]; XCTAssertNotNil(unarchivedSerializer); XCTAssertNotEqual(unarchivedSerializer, self.responseSerializer); XCTAssertTrue(unarchivedSerializer.format == self.responseSerializer.format); diff --git a/Tests/Tests/AFSecurityPolicyTests.m b/Tests/Tests/AFSecurityPolicyTests.m index 790f9906c3..ff81dcd5d6 100644 --- a/Tests/Tests/AFSecurityPolicyTests.m +++ b/Tests/Tests/AFSecurityPolicyTests.m @@ -58,7 +58,7 @@ static SecTrustRef AFUTADNNetServerTrust() { } static SecCertificateRef AFUTHTTPBinOrgCertificate() { - NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_03172020" ofType:@"cer"]; + NSString *certPath = [[NSBundle bundleForClass:[AFSecurityPolicyTests class]] pathForResource:@"httpbinorg_02182021" ofType:@"cer"]; NSCAssert(certPath != nil, @"Path for certificate should not be nil"); NSData *certData = [NSData dataWithContentsOfFile:certPath]; @@ -552,13 +552,8 @@ - (void)testThatPolicyCanBeEncodedAndDecoded { policy.validatesDomainName = NO; policy.pinnedCertificates = [NSSet setWithObject:(__bridge_transfer id)SecCertificateCopyData(AFUTHTTPBinOrgCertificate())]; - NSMutableData *archiveData = [NSMutableData new]; - NSKeyedArchiver *archiver = [[NSKeyedArchiver alloc] initForWritingWithMutableData:archiveData]; - [archiver encodeObject:policy forKey:@"policy"]; - [archiver finishEncoding]; - - NSKeyedUnarchiver *unarchiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:archiveData]; - AFSecurityPolicy *unarchivedPolicy = [unarchiver decodeObjectOfClass:[AFSecurityPolicy class] forKey:@"policy"]; + NSData *archive = [self archivedDataWithRootObject:policy]; + AFSecurityPolicy *unarchivedPolicy = [self unarchivedObjectOfClass:[AFSecurityPolicy class] fromData:archive]; XCTAssertNotEqual(unarchivedPolicy, policy); XCTAssertEqual(unarchivedPolicy.allowInvalidCertificates, policy.allowInvalidCertificates); diff --git a/Tests/Tests/AFTestCase.h b/Tests/Tests/AFTestCase.h index b57e088531..2d508a7c24 100644 --- a/Tests/Tests/AFTestCase.h +++ b/Tests/Tests/AFTestCase.h @@ -33,5 +33,7 @@ - (void)waitForExpectationsWithCommonTimeout; - (void)waitForExpectationsWithCommonTimeoutUsingHandler:(XCWaitCompletionHandler)handler; +- (NSData *)archivedDataWithRootObject:(id)object; +- (id)unarchivedObjectOfClass:(Class)class fromData:(NSData *)data; @end diff --git a/Tests/Tests/AFTestCase.m b/Tests/Tests/AFTestCase.m index 4726807b8f..00bac17f29 100644 --- a/Tests/Tests/AFTestCase.m +++ b/Tests/Tests/AFTestCase.m @@ -63,4 +63,18 @@ - (void)waitForExpectationsWithCommonTimeoutUsingHandler:(XCWaitCompletionHandle [self waitForExpectationsWithTimeout:self.networkTimeout handler:handler]; } +- (NSData *)archivedDataWithRootObject:(id)object { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedArchiver archivedDataWithRootObject:object]; +#pragma clang diagnostic pop +} + +- (id)unarchivedObjectOfClass:(Class)class fromData:(NSData *)data { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wdeprecated-declarations" + return [NSKeyedUnarchiver unarchiveObjectWithData:data]; +#pragma clang diagnostic pop +} + @end diff --git a/Tests/Tests/AFUIActivityIndicatorViewTests.m b/Tests/Tests/AFUIActivityIndicatorViewTests.m index 94094c02ba..ed591c9ec6 100644 --- a/Tests/Tests/AFUIActivityIndicatorViewTests.m +++ b/Tests/Tests/AFUIActivityIndicatorViewTests.m @@ -33,7 +33,11 @@ @implementation AFUIActivityIndicatorViewTests - (void)setUp { [super setUp]; +#if TARGET_OS_MACCATALYST + self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleMedium]; +#else self.activityIndicatorView = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhite]; +#endif self.request = [NSURLRequest requestWithURL:self.delayURL]; self.sessionManager = [[AFURLSessionManager alloc] initWithSessionConfiguration:nil]; } diff --git a/UIKit+AFNetworking/AFImageDownloader.h b/UIKit+AFNetworking/AFImageDownloader.h index 7e25e3734d..3bf5a32025 100644 --- a/UIKit+AFNetworking/AFImageDownloader.h +++ b/UIKit+AFNetworking/AFImageDownloader.h @@ -67,7 +67,7 @@ typedef NS_ENUM(NSInteger, AFImageDownloadPrioritization) { /** Defines the order prioritization of incoming download requests being inserted into the queue. `AFImageDownloadPrioritizationFIFO` by default. */ -@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritizaton; +@property (nonatomic, assign) AFImageDownloadPrioritization downloadPrioritization; /** The shared default instance of `AFImageDownloader` initialized with default values. diff --git a/UIKit+AFNetworking/AFImageDownloader.m b/UIKit+AFNetworking/AFImageDownloader.m index 0385fe28e5..008a78286d 100644 --- a/UIKit+AFNetworking/AFImageDownloader.m +++ b/UIKit+AFNetworking/AFImageDownloader.m @@ -109,20 +109,24 @@ @interface AFImageDownloader () @implementation AFImageDownloader + (NSURLCache *)defaultURLCache { + NSUInteger memoryCapacity = 20 * 1024 * 1024; // 20MB + NSUInteger diskCapacity = 150 * 1024 * 1024; // 150MB + NSURL *cacheURL = [[[NSFileManager defaultManager] URLForDirectory:NSCachesDirectory + inDomain:NSUserDomainMask + appropriateForURL:nil + create:YES + error:nil] + URLByAppendingPathComponent:@"com.alamofire.imagedownloader"]; - // It's been discovered that a crash will occur on certain versions - // of iOS if you customize the cache. - // - // More info can be found here: https://devforums.apple.com/message/1102182#1102182 - // - // When iOS 7 support is dropped, this should be modified to use - // NSProcessInfo methods instead. - if ([[[UIDevice currentDevice] systemVersion] compare:@"8.2" options:NSNumericSearch] == NSOrderedAscending) { - return [NSURLCache sharedURLCache]; - } - return [[NSURLCache alloc] initWithMemoryCapacity:20 * 1024 * 1024 - diskCapacity:150 * 1024 * 1024 - diskPath:@"com.alamofire.imagedownloader"]; +#if TARGET_OS_MACCATALYST + return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity + diskCapacity:diskCapacity + directoryURL:cacheURL]; +#else + return [[NSURLCache alloc] initWithMemoryCapacity:memoryCapacity + diskCapacity:diskCapacity + diskPath:[cacheURL path]]; +#endif } + (NSURLSessionConfiguration *)defaultURLSessionConfiguration { @@ -163,7 +167,7 @@ - (instancetype)initWithSessionManager:(AFHTTPSessionManager *)sessionManager if (self = [super init]) { self.sessionManager = sessionManager; - self.downloadPrioritizaton = downloadPrioritization; + self.downloadPrioritization = downloadPrioritization; self.maximumActiveDownloads = maximumActiveDownloads; self.imageCache = imageCache; @@ -383,7 +387,7 @@ - (void)startMergedTask:(AFImageDownloaderMergedTask *)mergedTask { } - (void)enqueueMergedTask:(AFImageDownloaderMergedTask *)mergedTask { - switch (self.downloadPrioritizaton) { + switch (self.downloadPrioritization) { case AFImageDownloadPrioritizationFIFO: [self.queuedMergedTasks addObject:mergedTask]; break; diff --git a/fastlane/.env.catalyst b/fastlane/.env.catalyst new file mode 100644 index 0000000000..37ecfc1f78 --- /dev/null +++ b/fastlane/.env.catalyst @@ -0,0 +1,2 @@ +SCAN_SCHEME="AFNetworking iOS" +SCAN_DESTINATION="platform=macOS" diff --git a/fastlane/.env.default b/fastlane/.env.default index bf9d815f1e..4abfaec165 100644 --- a/fastlane/.env.default +++ b/fastlane/.env.default @@ -1,14 +1,4 @@ -AF_IOS_SDK=iphonesimulator13.0 -AF_MAC_SDK=macosx10.15 -AF_TVOS_SDK=appletvsimulator13.0 - AF_CONFIGURATION=Release SCAN_WORKSPACE=$AF_WORKSPACE -SCAN_SCHEME=$AF_IOS_FRAMEWORK_SCHEME -SCAN_SDK=$AF_IOS_SDK SCAN_OUTPUT_DIRECTORY=fastlane/test-output - -EXAMPLE_WORKSPACE=$AF_WORKSPACE -EXAMPLE_SCHEME=$AF_IOS_EXAMPLE_SCHEME -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" diff --git a/fastlane/.env.ios11_xcode9 b/fastlane/.env.ios11_xcode9 deleted file mode 100644 index e886bbffb6..0000000000 --- a/fastlane/.env.ios11_xcode9 +++ /dev/null @@ -1,3 +0,0 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator11.0 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" diff --git a/fastlane/.env.ios11_xcode91 b/fastlane/.env.ios11_xcode91 deleted file mode 100644 index 30c1a68adf..0000000000 --- a/fastlane/.env.ios11_xcode91 +++ /dev/null @@ -1,3 +0,0 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator11.1 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" diff --git a/fastlane/.env.ios11_xcode92 b/fastlane/.env.ios11_xcode92 deleted file mode 100644 index 55ecee3cb8..0000000000 --- a/fastlane/.env.ios11_xcode92 +++ /dev/null @@ -1,3 +0,0 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator11.2 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" diff --git a/fastlane/.env.ios11_xcode93 b/fastlane/.env.ios11_xcode93 deleted file mode 100644 index c96dad75c8..0000000000 --- a/fastlane/.env.ios11_xcode93 +++ /dev/null @@ -1,3 +0,0 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator11.3 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" diff --git a/fastlane/.env.ios11_xcode94 b/fastlane/.env.ios11_xcode94 index d27768fdf2..f91d853efb 100644 --- a/fastlane/.env.ios11_xcode94 +++ b/fastlane/.env.ios11_xcode94 @@ -1,3 +1,2 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator11.4 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" +SCAN_DEVICE="iPhone X" +SCAN_SCHEME="AFNetworking iOS" diff --git a/fastlane/.env.ios12_xcode10 b/fastlane/.env.ios12_xcode10 index dddba54385..85d5de099d 100644 --- a/fastlane/.env.ios12_xcode10 +++ b/fastlane/.env.ios12_xcode10 @@ -1,3 +1,3 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=iphonesimulator12.0 -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" +SCAN_DEVICE="iPhone XS" +SCAN_SCHEME="AFNetworking iOS" +SCAN_DESTINATION="OS=12.4,name=iPhone XS" diff --git a/fastlane/.env.ios13_xcode11 b/fastlane/.env.ios13_xcode11 index f5c776fea5..bcafbadf1e 100644 --- a/fastlane/.env.ios13_xcode11 +++ b/fastlane/.env.ios13_xcode11 @@ -1,3 +1,3 @@ -SCAN_DEVICE="iPhone 8" -SCAN_SDK=$AF_IOS_SDK -EXAMPLE_DESTINATION="platform=iOS Simulator,name=iPhone 8" +SCAN_DEVICE="iPhone 11 Pro" +SCAN_SCHEME="AFNetworking iOS" +SCAN_DESTINATION="OS=13.3,name=iPhone 11 Pro" diff --git a/fastlane/.env.macos b/fastlane/.env.macos index 223e5c66d1..dded8b5128 100644 --- a/fastlane/.env.macos +++ b/fastlane/.env.macos @@ -1,5 +1,2 @@ -SCAN_SCHEME=$AF_OSX_FRAMEWORK_SCHEME -SCAN_SDK="macosx10.15" - -EXAMPLE_SCHEME=$AF_OSX_EXAMPLE_SCHEME -EXAMPLE_DESTINATION="platform=macOS" +SCAN_SCHEME="AFNetworking macOS" +SCAN_DESTINATION="platform=macOS" diff --git a/fastlane/.env.tvos13_xcode11 b/fastlane/.env.tvos13_xcode11 index 2d805b350d..7f797226ad 100644 --- a/fastlane/.env.tvos13_xcode11 +++ b/fastlane/.env.tvos13_xcode11 @@ -1,6 +1,3 @@ -SCAN_SCHEME=$AF_TVOS_FRAMEWORK_SCHEME +SCAN_SCHEME="AFNetworking tvOS" SCAN_DEVICE="Apple TV 4K" -SCAN_SDK=$AF_TVOS_SDK - -EXAMPLE_SCHEME=$AF_TVOS_EXAMPLE_SCHEME -EXAMPLE_DESTINATION="platform=tvOS Simulator,name=Apple TV 4K" +SCAN_DESTINATION="OS=13.3,name=Apple TV 4K" diff --git a/fastlane/Fastfile b/fastlane/Fastfile index 5cb97727ff..5e53259441 100644 --- a/fastlane/Fastfile +++ b/fastlane/Fastfile @@ -1,4 +1,4 @@ import_from_git( url: 'https://github.com/AFNetworking/fastlane.git', - branch: '0.0.8' + branch: 'master' )