From ece85547f987c215d4a8d8446111861669e775b8 Mon Sep 17 00:00:00 2001 From: aporat28 Date: Sat, 8 Feb 2025 15:10:12 -0500 Subject: [PATCH 1/6] added swift package support --- .github/workflows/ci.yml | 38 ++ .gitignore | 36 +- .gitmodules | 6 - .swift-version | 2 +- .travis.yml | 7 - Alamofire | 1 - Alamofire-SwiftyJSON.podspec | 8 +- .../project.pbxproj | 428 +++++------------- .../contents.xcworkspacedata | 2 +- .../xcshareddata/IDEWorkspaceChecks.plist | 8 + .../xcshareddata/swiftpm/Package.resolved | 24 + .../xcschemes/AlamofireSwiftyJSON.xcscheme | 26 +- Package.swift | 35 ++ Podfile | 14 + Podfile.lock | 20 + README.md | 7 +- Source/Alamofire-SwiftyJSON.swift | 109 ++--- SwiftyJSON | 1 - Tests/Alamofire_SwiftyJSONTests.swift | 9 +- 19 files changed, 331 insertions(+), 450 deletions(-) create mode 100644 .github/workflows/ci.yml delete mode 100644 .travis.yml delete mode 160000 Alamofire create mode 100644 Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist create mode 100644 Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved create mode 100644 Package.swift create mode 100644 Podfile create mode 100644 Podfile.lock delete mode 160000 SwiftyJSON diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..ad880f0 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,38 @@ +name: Swift + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: Swift ${{ matrix.platform }} on ${{ matrix.os }} + runs-on: macos-latest + + strategy: + matrix: + platform: + - platform=iPhone 16 Pro Max + - platform=iPhone 16 Pro + os: + - 17.4 + - 18.2 + + steps: + + # Checkout the repository + - name: Checkout repository + uses: actions/checkout@v4 + + # Install any dependencies + - name: Install Dependencies + run: swift package resolve + + # Run tests on ${{ matrix.platform }} with iOS ${{ matrix.os }} + - name: Run Tests on ${{ matrix.platform }} (iOS ${{ matrix.os }}) + run: | + xcodebuild test \ + -scheme 'AlamofireSwiftyJSON' \ + -destination 'platform=iOS Simulator,name=${{ matrix.platform }},OS=${{ matrix.os }}' diff --git a/.gitignore b/.gitignore index a3cd143..622c06a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,26 +1,12 @@ -# Xcode -# -build/ -*.pbxuser -!default.pbxuser -*.mode1v3 -!default.mode1v3 -*.mode2v3 -!default.mode2v3 -*.perspectivev3 -!default.perspectivev3 -xcuserdata -*.xccheckout -*.moved-aside -DerivedData -*.hmap -*.ipa -*.xcuserstate +# OS X +.DS_Store -# CocoaPods -# -# We recommend against adding the Pods directory to your .gitignore. However -# you should judge for yourself, the pros and cons are mentioned at: -# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control -# -# Pods/ +# Swift Package Manager +.build +build +Package.resolved + +# Xcode user settings +xcuserdata/ + +.idea \ No newline at end of file diff --git a/.gitmodules b/.gitmodules index a8f67ba..e69de29 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +0,0 @@ -[submodule "SwiftyJSON"] - path = SwiftyJSON - url = https://github.com/SwiftyJSON/SwiftyJSON.git -[submodule "Alamofire"] - path = Alamofire - url = https://github.com/Alamofire/Alamofire.git diff --git a/.swift-version b/.swift-version index 9f55b2c..ef425ca 100644 --- a/.swift-version +++ b/.swift-version @@ -1 +1 @@ -3.0 +5.2 diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index de64906..0000000 --- a/.travis.yml +++ /dev/null @@ -1,7 +0,0 @@ -language: objective-c -osx_image: xcode9 -xcode_sdk: iphonesimulator10.0 -env: - - PLATFORM="ios" SCHEME="AlamofireSwiftyJSON" DESTINATION="platform=iOS Simulator,name=iPhone SE,OS=10.0" -script: - - set -o pipefail && xcodebuild -project Alamofire-SwiftyJSON.xcodeproj -scheme $SCHEME -destination "$DESTINATION" build-for-testing test | xcpretty diff --git a/Alamofire b/Alamofire deleted file mode 160000 index 7fe7b91..0000000 --- a/Alamofire +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 7fe7b918b746fbb4b7a7c2146bef7a88c7ddc54e diff --git a/Alamofire-SwiftyJSON.podspec b/Alamofire-SwiftyJSON.podspec index 5447dc7..66aa6ea 100644 --- a/Alamofire-SwiftyJSON.podspec +++ b/Alamofire-SwiftyJSON.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Alamofire-SwiftyJSON" - s.version = "3.0.0" + s.version = "5.0.0" s.summary = "Alamofire extension for serialize NSData to SwiftyJSON " s.homepage = "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON" s.license = { :type => "MIT" } @@ -8,9 +8,9 @@ Pod::Spec.new do |s| s.requires_arc = true s.osx.deployment_target = "10.11" - s.ios.deployment_target = "9.0" + s.ios.deployment_target = "15.0" s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 4.5' - s.dependency 'SwiftyJSON', '~> 4.0.0' + s.dependency 'Alamofire', '~> 5' + s.dependency 'SwiftyJSON', '~> 5' end diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj index e703136..7dba572 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj +++ b/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj @@ -3,14 +3,13 @@ archiveVersion = 1; classes = { }; - objectVersion = 46; + objectVersion = 54; objects = { /* Begin PBXBuildFile section */ - A8A2DBBA1A23292000AF9EFC /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB75A19D14A5C0070765E /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBBB1A23292000AF9EFC /* SwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB76519D14A670070765E /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBC31A2329E700AF9EFC /* Alamofire.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB75A19D14A5C0070765E /* Alamofire.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8A2DBC41A2329E700AF9EFC /* SwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB76519D14A670070765E /* SwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; + 773F35732D57E91C0015A90D /* Alamofire-SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */; }; + 77AA4B422D2308D600275EEB /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B412D2308D600275EEB /* Alamofire */; }; + 77AA4B452D2308F400275EEB /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B442D2308F400275EEB /* SwiftyJSON */; }; A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */; }; @@ -18,90 +17,6 @@ /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ - 4BC5E9F91BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4DD67C0B1A5C55C900ED2280; - remoteInfo = "Alamofire OSX"; - }; - 4BC5E9FB1BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4202FE01B667AA100C997FB; - remoteInfo = "Alamofire watchOS"; - }; - 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F829C6B21A7A94F100A2CD59; - remoteInfo = "Alamofire OSX Tests"; - }; - 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC5B1A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX"; - }; - 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 9C7DFC651A9102BD005AA3F7; - remoteInfo = "SwiftyJSON OSX Tests"; - }; - 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = E4D7CCE81B9465A700EE7221; - remoteInfo = "SwiftyJSON watchOS"; - }; - A81D16431E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626EF1BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS"; - }; - A81D16451E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 4CF626F81BA7CB3E0011A099; - remoteInfo = "Alamofire tvOS Tests"; - }; - A81D164D1E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 7236B4F61BAC14150020529B; - remoteInfo = "SwiftyJSON tvOS"; - }; - A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = A8580F741BCF5C5B00DA927B; - remoteInfo = "SwiftyJSON tvOS Tests"; - }; - A8A2DBB61A23290100AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8A2DBB81A23290100AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2E4FEFDA19575BE100351305; - remoteInfo = SwiftyJSON; - }; A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { isa = PBXContainerItemProxy; containerPortal = A8AFB70619D1401D0070765E /* Project object */; @@ -109,48 +24,6 @@ remoteGlobalIDString = A8AFB70E19D1401D0070765E; remoteInfo = AlamofireSwiftyJSON; }; - A8A2DBBE1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = F8111E3219A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8A2DBC01A2329BD00AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 1; - remoteGlobalIDString = 2E4FEFDA19575BE100351305; - remoteInfo = SwiftyJSON; - }; - A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3319A95C8B0040E7D1; - remoteInfo = Alamofire; - }; - A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = F8111E3E19A95C8B0040E7D1; - remoteInfo = AlamofireTests; - }; - A8AFB76419D14A670070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFDB19575BE100351305; - remoteInfo = SwiftyJSON; - }; - A8AFB76619D14A670070765E /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - proxyType = 2; - remoteGlobalIDString = 2E4FEFE619575BE100351305; - remoteInfo = SwiftyJSONTests; - }; /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ @@ -160,8 +33,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - A8A2DBBA1A23292000AF9EFC /* Alamofire.framework in Copy Frameworks */, - A8A2DBBB1A23292000AF9EFC /* SwiftyJSON.framework in Copy Frameworks */, ); name = "Copy Frameworks"; runOnlyForDeploymentPostprocessing = 1; @@ -172,8 +43,6 @@ dstPath = ""; dstSubfolderSpec = 10; files = ( - A8A2DBC31A2329E700AF9EFC /* Alamofire.framework in Copy Frameworks */, - A8A2DBC41A2329E700AF9EFC /* SwiftyJSON.framework in Copy Frameworks */, A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */, ); name = "Copy Frameworks"; @@ -182,6 +51,7 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ + 77AA4B462D23096D00275EEB /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A8AFB71319D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Alamofire-SwiftyJSON.h"; sourceTree = ""; }; @@ -189,8 +59,6 @@ A8AFB71D19D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alamofire_SwiftyJSONTests.swift; sourceTree = ""; }; A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Alamofire-SwiftyJSON.swift"; sourceTree = ""; }; - A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = Alamofire.xcodeproj; path = Alamofire/Alamofire.xcodeproj; sourceTree = ""; }; - A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = SwiftyJSON.xcodeproj; path = SwiftyJSON/SwiftyJSON.xcodeproj; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -198,6 +66,8 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 77AA4B452D2308F400275EEB /* SwiftyJSON in Frameworks */, + 77AA4B422D2308D600275EEB /* Alamofire in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -214,8 +84,7 @@ A8AFB70519D1401D0070765E = { isa = PBXGroup; children = ( - A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */, - A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */, + 77AA4B462D23096D00275EEB /* Package.swift */, A8AFB71119D1401D0070765E /* Source */, A8AFB71B19D1401D0070765E /* Tests */, A8AFB71019D1401D0070765E /* Products */, @@ -266,34 +135,6 @@ name = "Supporting Files"; sourceTree = ""; }; - A8AFB75519D14A5C0070765E /* Products */ = { - isa = PBXGroup; - children = ( - A8AFB75A19D14A5C0070765E /* Alamofire.framework */, - A8AFB75C19D14A5C0070765E /* Alamofire iOS Tests.xctest */, - 4BC5E9FA1BB7E15600A393DD /* Alamofire.framework */, - 4BC5E9FE1BB7E15600A393DD /* Alamofire macOS Tests.xctest */, - A81D16441E59E90500C62C5F /* Alamofire.framework */, - A81D16461E59E90500C62C5F /* Alamofire tvOS Tests.xctest */, - 4BC5E9FC1BB7E15600A393DD /* Alamofire.framework */, - ); - name = Products; - sourceTree = ""; - }; - A8AFB75E19D14A670070765E /* Products */ = { - isa = PBXGroup; - children = ( - A8AFB76519D14A670070765E /* SwiftyJSON.framework */, - A8AFB76719D14A670070765E /* SwiftyJSON iOS Tests.xctest */, - 4BC5EA041BB7E15600A393DD /* SwiftyJSON.framework */, - 4BC5EA061BB7E15600A393DD /* SwiftyJSON OSX Tests.xctest */, - 4BC5EA081BB7E15600A393DD /* SwiftyJSON.framework */, - A81D164E1E59E90500C62C5F /* SwiftyJSON.framework */, - A81D16501E59E90500C62C5F /* SwiftyJSON tvOS Tests.xctest */, - ); - name = Products; - sourceTree = ""; - }; /* End PBXGroup section */ /* Begin PBXHeadersBuildPhase section */ @@ -321,8 +162,6 @@ buildRules = ( ); dependencies = ( - A8A2DBB71A23290100AF9EFC /* PBXTargetDependency */, - A8A2DBB91A23290100AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSON; productName = "Alamofire-SwiftyJSON"; @@ -342,8 +181,6 @@ ); dependencies = ( A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBBF1A2329BD00AF9EFC /* PBXTargetDependency */, - A8A2DBC11A2329BD00AF9EFC /* PBXTargetDependency */, ); name = AlamofireSwiftyJSONTests; productName = "Alamofire-SwiftyJSONTests"; @@ -356,8 +193,9 @@ A8AFB70619D1401D0070765E /* Project object */ = { isa = PBXProject; attributes = { + BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 0900; + LastUpgradeCheck = 1620; ORGANIZATIONNAME = SwiftJSON; TargetAttributes = { A8AFB70E19D1401D0070765E = { @@ -375,21 +213,16 @@ developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( + English, en, ); mainGroup = A8AFB70519D1401D0070765E; + packageReferences = ( + 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */, + 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */, + ); productRefGroup = A8AFB71019D1401D0070765E /* Products */; projectDirPath = ""; - projectReferences = ( - { - ProductGroup = A8AFB75519D14A5C0070765E /* Products */; - ProjectRef = A8AFB75419D14A5C0070765E /* Alamofire.xcodeproj */; - }, - { - ProductGroup = A8AFB75E19D14A670070765E /* Products */; - ProjectRef = A8AFB75D19D14A670070765E /* SwiftyJSON.xcodeproj */; - }, - ); projectRoot = ""; targets = ( A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */, @@ -398,107 +231,6 @@ }; /* End PBXProject section */ -/* Begin PBXReferenceProxy section */ - 4BC5E9FA1BB7E15600A393DD /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4BC5E9F91BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5E9FC1BB7E15600A393DD /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = 4BC5E9FB1BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5E9FE1BB7E15600A393DD /* Alamofire macOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire macOS Tests.xctest"; - remoteRef = 4BC5E9FD1BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA041BB7E15600A393DD /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 4BC5EA031BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA061BB7E15600A393DD /* SwiftyJSON OSX Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON OSX Tests.xctest"; - remoteRef = 4BC5EA051BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - 4BC5EA081BB7E15600A393DD /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = 4BC5EA071BB7E15600A393DD /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16441E59E90500C62C5F /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = A81D16431E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16461E59E90500C62C5F /* Alamofire tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire tvOS Tests.xctest"; - remoteRef = A81D16451E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D164E1E59E90500C62C5F /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A81D164D1E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A81D16501E59E90500C62C5F /* SwiftyJSON tvOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON tvOS Tests.xctest"; - remoteRef = A81D164F1E59E90500C62C5F /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB75A19D14A5C0070765E /* Alamofire.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = Alamofire.framework; - remoteRef = A8AFB75919D14A5C0070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB75C19D14A5C0070765E /* Alamofire iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "Alamofire iOS Tests.xctest"; - remoteRef = A8AFB75B19D14A5C0070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB76519D14A670070765E /* SwiftyJSON.framework */ = { - isa = PBXReferenceProxy; - fileType = wrapper.framework; - path = SwiftyJSON.framework; - remoteRef = A8AFB76419D14A670070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; - A8AFB76719D14A670070765E /* SwiftyJSON iOS Tests.xctest */ = { - isa = PBXReferenceProxy; - fileType = wrapper.cfbundle; - path = "SwiftyJSON iOS Tests.xctest"; - remoteRef = A8AFB76619D14A670070765E /* PBXContainerItemProxy */; - sourceTree = BUILT_PRODUCTS_DIR; - }; -/* End PBXReferenceProxy section */ - /* Begin PBXResourcesBuildPhase section */ A8AFB70D19D1401D0070765E /* Resources */ = { isa = PBXResourcesBuildPhase; @@ -529,6 +261,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 773F35732D57E91C0015A90D /* Alamofire-SwiftyJSON.swift in Sources */, A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -536,31 +269,11 @@ /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ - A8A2DBB71A23290100AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - targetProxy = A8A2DBB61A23290100AF9EFC /* PBXContainerItemProxy */; - }; - A8A2DBB91A23290100AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftyJSON; - targetProxy = A8A2DBB81A23290100AF9EFC /* PBXContainerItemProxy */; - }; A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */; targetProxy = A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */; }; - A8A2DBBF1A2329BD00AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = Alamofire; - targetProxy = A8A2DBBE1A2329BD00AF9EFC /* PBXContainerItemProxy */; - }; - A8A2DBC11A2329BD00AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - name = SwiftyJSON; - targetProxy = A8A2DBC01A2329BD00AF9EFC /* PBXContainerItemProxy */; - }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -568,6 +281,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -576,14 +290,17 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -594,6 +311,7 @@ CURRENT_PROJECT_VERSION = 1; ENABLE_STRICT_OBJC_MSGSEND = YES; ENABLE_TESTABILITY = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_DYNAMIC_NO_PIC = NO; GCC_NO_COMMON_BLOCKS = YES; @@ -609,7 +327,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = iphoneos; @@ -624,6 +342,7 @@ isa = XCBuildConfiguration; buildSettings = { ALWAYS_SEARCH_USER_PATHS = NO; + CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; @@ -632,14 +351,17 @@ CLANG_WARN_BOOL_CONVERSION = YES; CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; + CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; @@ -650,6 +372,7 @@ CURRENT_PROJECT_VERSION = 1; ENABLE_NS_ASSERTIONS = NO; ENABLE_STRICT_OBJC_MSGSEND = YES; + ENABLE_USER_SCRIPT_SANDBOXING = YES; GCC_C_LANGUAGE_STANDARD = gnu99; GCC_NO_COMMON_BLOCKS = YES; GCC_WARN_64_TO_32_BIT_CONVERSION = YES; @@ -658,10 +381,11 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 8.0; + IPHONEOS_DEPLOYMENT_TARGET = 12.0; MTL_ENABLE_DEBUG_INFO = NO; SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; + SWIFT_COMPILATION_MODE = wholemodule; + SWIFT_OPTIMIZATION_LEVEL = "-O"; TARGETED_DEVICE_FAMILY = "1,2"; VALIDATE_PRODUCT = YES; VERSIONING_SYSTEM = "apple-generic"; @@ -672,62 +396,98 @@ A8AFB72319D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = AlamofireSwiftyJSON; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = AlamofireSwiftyJSON; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; A8AFB72419D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; + CODE_SIGN_IDENTITY = "Apple Development"; + CODE_SIGN_STYLE = Automatic; DEFINES_MODULE = YES; + DEVELOPMENT_TEAM = ""; DYLIB_COMPATIBILITY_VERSION = 1; DYLIB_CURRENT_VERSION = 1; DYLIB_INSTALL_NAME_BASE = "@rpath"; + ENABLE_MODULE_VERIFIER = YES; INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = AlamofireSwiftyJSON; + "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = AlamofireSwiftyJSON; PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; SKIP_INSTALL = YES; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; A8AFB72619D1401D0070765E /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; GCC_PREPROCESSOR_DEFINITIONS = ( "DEBUG=1", "$(inherited)", ); INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = AlamofireSwiftyJSONTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Debug; }; A8AFB72719D1401D0070765E /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; INFOPLIST_FILE = Tests/Info.plist; - LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; - PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; + IPHONEOS_DEPLOYMENT_TARGET = 15.6; + LD_RUNPATH_SEARCH_PATHS = ( + "$(inherited)", + "@executable_path/Frameworks", + "@loader_path/Frameworks", + ); + PRODUCT_BUNDLE_IDENTIFIER = AlamofireSwiftyJSONTests; PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 3.0; + SWIFT_VERSION = 5.0; }; name = Release; }; @@ -762,6 +522,38 @@ defaultConfigurationName = Release; }; /* End XCConfigurationList section */ + +/* Begin XCRemoteSwiftPackageReference section */ + 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/Alamofire/Alamofire.git"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.10.2; + }; + }; + 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = { + isa = XCRemoteSwiftPackageReference; + repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON"; + requirement = { + kind = upToNextMajorVersion; + minimumVersion = 5.0.2; + }; + }; +/* End XCRemoteSwiftPackageReference section */ + +/* Begin XCSwiftPackageProductDependency section */ + 77AA4B412D2308D600275EEB /* Alamofire */ = { + isa = XCSwiftPackageProductDependency; + package = 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */; + productName = Alamofire; + }; + 77AA4B442D2308F400275EEB /* SwiftyJSON */ = { + isa = XCSwiftPackageProductDependency; + package = 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */; + productName = SwiftyJSON; + }; +/* End XCSwiftPackageProductDependency section */ }; rootObject = A8AFB70619D1401D0070765E /* Project object */; } diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata index 80f599f..919434a 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata @@ -2,6 +2,6 @@ + location = "self:"> diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist new file mode 100644 index 0000000..18d9810 --- /dev/null +++ b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist @@ -0,0 +1,8 @@ + + + + + IDEDidComputeMac32BitWarning + + + diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved new file mode 100644 index 0000000..c66e7fd --- /dev/null +++ b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved @@ -0,0 +1,24 @@ +{ + "originHash" : "91393b540335b0d2a8eb1ab5676e9368b58fd3e128b01d886940bfd9d3cae474", + "pins" : [ + { + "identity" : "alamofire", + "kind" : "remoteSourceControl", + "location" : "https://github.com/Alamofire/Alamofire.git", + "state" : { + "revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5", + "version" : "5.10.2" + } + }, + { + "identity" : "swiftyjson", + "kind" : "remoteSourceControl", + "location" : "https://github.com/SwiftyJSON/SwiftyJSON", + "state" : { + "revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828", + "version" : "5.0.2" + } + } + ], + "version" : 3 +} diff --git a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme b/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme index 45076c5..ad07961 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme +++ b/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme @@ -1,6 +1,6 @@ + + + + @@ -54,23 +62,11 @@ - - - - - - - - 5' + pod 'SwiftyJSON', '~> 5' +end + +target 'AlamofireSwiftyJSONTests' do + pod 'Alamofire', '~> 5' + pod 'SwiftyJSON', '~> 5' +end diff --git a/Podfile.lock b/Podfile.lock new file mode 100644 index 0000000..587878c --- /dev/null +++ b/Podfile.lock @@ -0,0 +1,20 @@ +PODS: + - Alamofire (5.2.2) + - SwiftyJSON (5.0.0) + +DEPENDENCIES: + - Alamofire (~> 5) + - SwiftyJSON (~> 5) + +SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - Alamofire + - SwiftyJSON + +SPEC CHECKSUMS: + Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 + SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 + +PODFILE CHECKSUM: 5175165036843bb0979dcfa0e46433202caf367a + +COCOAPODS: 1.10.0.beta.2 diff --git a/README.md b/README.md index d8227bd..dd656c1 100644 --- a/README.md +++ b/README.md @@ -6,12 +6,15 @@ An extension to make serializing [Alamofire](https://github.com/Alamofire/Alamof ⚠️ **To use with Swift 4.x please ensure you are using >= `3.0.0`** ⚠️ +⚠️ **To use with Swift 5.x please ensure you are using >= `5.0.0`** ⚠️ + ## Swift version Alamofire-SwiftyJSON | Swift version | Alamofire | SwiftyJSON ------------- | --------------| ----------| ---------- 2.x | Swift 3.x | 4.x | 3.x 3.x | Swift 4.x | 4.5.x | 4.x +5.x | Swift 5.x | 5.x | 5.x ## Requirements @@ -35,11 +38,11 @@ github "SwiftyJSON/Alamofire-SwiftyJSON" "master" ## Usage ```swift -import AlamofireSwiftyJSON +import Alamofire_SwiftyJSON ``` ```swift -Alamofire.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) +AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) .responseSwiftyJSON { dataResponse in print(dataResponse.request) print(dataResponse.response) diff --git a/Source/Alamofire-SwiftyJSON.swift b/Source/Alamofire-SwiftyJSON.swift index 84806fc..4f23a34 100644 --- a/Source/Alamofire-SwiftyJSON.swift +++ b/Source/Alamofire-SwiftyJSON.swift @@ -1,87 +1,70 @@ -// -// AlamofireSwiftyJSON.swift -// AlamofireSwiftyJSON -// -// Created by Pinglin Tang on 14-9-22. -// Copyright (c) 2014 SwiftyJSON. All rights reserved. -// - -import Foundation - import Alamofire +import Foundation import SwiftyJSON -// MARK: - Request for Swift JSON +public final class SwiftyJSONResponseSerializer: ResponseSerializer { + public let dataPreprocessor: DataPreprocessor + public let emptyResponseCodes: Set + public let emptyRequestMethods: Set + /// `JSONSerialization.ReadingOptions` used when serializing a response. + public let options: JSONSerialization.ReadingOptions -extension Request { - /// Returns a SwiftyJSON object contained in a result type constructed from the response data using `JSONSerialization` - /// with the specified reading options. + /// Creates an instance with the provided values. /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter response: The response from the server. - /// - parameter data: The data returned from the server. - /// - parameter error: The error already encountered if it exists. - /// - /// - returns: The result data type. - public static func serializeResponseSwiftyJSON( - options: JSONSerialization.ReadingOptions, - response: HTTPURLResponse?, - data: Data?, - error: Error?) - -> Result + /// - Parameters: + /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. + /// - emptyResponseCodes: The HTTP response codes for which empty responses are allowed. `[204, 205]` by default. + /// - emptyRequestMethods: The HTTP request methods for which empty responses are allowed. `[.head]` by default. + /// - options: The options to use. `.allowFragments` by default. + public init(dataPreprocessor: DataPreprocessor = SwiftyJSONResponseSerializer.defaultDataPreprocessor, + emptyResponseCodes: Set = SwiftyJSONResponseSerializer.defaultEmptyResponseCodes, + emptyRequestMethods: Set = SwiftyJSONResponseSerializer.defaultEmptyRequestMethods, + options: JSONSerialization.ReadingOptions = .allowFragments) { - guard error == nil else { return .failure(error!) } + self.dataPreprocessor = dataPreprocessor + self.emptyResponseCodes = emptyResponseCodes + self.emptyRequestMethods = emptyRequestMethods + self.options = options + } - if let response = response, emptyDataStatusCodes.contains(response.statusCode) { return .success(JSON.null) } + public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> JSON { + guard error == nil else { throw error! } - guard let validData = data, validData.count > 0 else { - return .failure(AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength)) + guard var data = data, !data.isEmpty else { + guard emptyResponseAllowed(forRequest: request, response: response) else { + throw AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength) + } + + return JSON(booleanLiteral: false) } + data = try dataPreprocessor.preprocess(data) + do { - let json = try JSONSerialization.jsonObject(with: validData, options: options) - return .success(JSON(json)) + let json = try JSONSerialization.jsonObject(with: data, options: options) + return JSON(json) } catch { - return .failure(AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error))) + throw AFError.responseSerializationFailed(reason: .jsonSerializationFailed(error: error)) } } } extension DataRequest { - /// Creates a response serializer that returns a SwiftyJSON object result type constructed from the response data using - /// `JSONSerialization` with the specified reading options. - /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - /// - returns: A JSON object response serializer. - public static func swiftyJSONResponseSerializer( - options: JSONSerialization.ReadingOptions = .allowFragments) - -> DataResponseSerializer - { - return DataResponseSerializer { _, response, data, error in - return Request.serializeResponseSwiftyJSON(options: options, response: response, data: data, error: error) - } - } - /// Adds a handler to be called once the request has finished. /// - /// - parameter options: The JSON serialization reading options. Defaults to `.allowFragments`. - /// - parameter completionHandler: A closure to be executed once the request has finished. + /// - Parameters: + /// - queue: The queue on which the completion handler is dispatched. `.main` by default. + /// - options: The JSON serialization reading options. `.allowFragments` by default. + /// - completionHandler: A closure to be executed once the request has finished. /// - /// - returns: The request. + /// - Returns: The request. @discardableResult - public func responseSwiftyJSON( - queue: DispatchQueue? = nil, - options: JSONSerialization.ReadingOptions = .allowFragments, - completionHandler: @escaping (DataResponse) -> Void) - -> Self + public func responseSwiftyJSON(queue: DispatchQueue = .main, + options: JSONSerialization.ReadingOptions = .allowFragments, + completionHandler: @escaping (AFDataResponse) -> Void) -> Self { - return response( - queue: queue, - responseSerializer: DataRequest.swiftyJSONResponseSerializer(options: options), - completionHandler: completionHandler - ) + response(queue: queue, + responseSerializer: SwiftyJSONResponseSerializer(options: options), + completionHandler: completionHandler) } } - -private let emptyDataStatusCodes: Set = [204, 205] diff --git a/SwiftyJSON b/SwiftyJSON deleted file mode 160000 index 6b9f11e..0000000 --- a/SwiftyJSON +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 6b9f11e2bbd277f199b1c09fa65631bfc52d4a5d diff --git a/Tests/Alamofire_SwiftyJSONTests.swift b/Tests/Alamofire_SwiftyJSONTests.swift index 43731b0..cd65a46 100644 --- a/Tests/Alamofire_SwiftyJSONTests.swift +++ b/Tests/Alamofire_SwiftyJSONTests.swift @@ -6,18 +6,17 @@ // Copyright (c) 2014年 SwiftJSON. All rights reserved. // -import XCTest import Alamofire -import SwiftyJSON import AlamofireSwiftyJSON +import SwiftyJSON +import XCTest class Alamofire_SwiftyJSONTests: XCTestCase { - func testGETRequestJSONResponse() { let URL = "http://httpbin.org/get" let parameters: Parameters = ["foo": "bar"] let expect = expectation(description: "responseSwiftyJSON method should work") - Alamofire.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) + AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) .validate() .responseSwiftyJSON { response in XCTAssertNotNil(response.request, "request should not be nil") @@ -25,7 +24,7 @@ class Alamofire_SwiftyJSONTests: XCTestCase { XCTAssertNil(response.error, "result error should be nil") XCTAssertEqual(response.value?["args"], SwiftyJSON.JSON(["foo": "bar"] as NSDictionary), "args should be equal") expect.fulfill() - } + } waitForExpectations(timeout: 10.0, handler: nil) } } From 5d79ff7d1d2bab1727f9fd7bf787d160b8ea8514 Mon Sep 17 00:00:00 2001 From: aporat28 Date: Thu, 13 Feb 2025 15:27:53 -0500 Subject: [PATCH 2/6] renamed module to AlamofireSwiftyJSON --- .../xcshareddata/swiftpm/Package.resolved | 24 ------------ ...SON.podspec => AlamofireSwiftyJSON.podspec | 0 .../project.pbxproj | 38 +++++++++---------- .../contents.xcworkspacedata | 0 .../Alamofire-SwiftyJSON.xcscmblueprint | 0 .../xcshareddata/IDEWorkspaceChecks.plist | 0 .../xcschemes/AlamofireSwiftyJSON.xcscheme | 12 +++--- Source/Alamofire-SwiftyJSON.h | 19 ---------- Source/AlamofireSwiftyJSON.h | 19 ++++++++++ ...tyJSON.swift => AlamofireSwiftyJSON.swift} | 0 ...s.swift => AlamofireSwiftyJSONTests.swift} | 6 +-- 11 files changed, 47 insertions(+), 71 deletions(-) delete mode 100644 Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved rename Alamofire-SwiftyJSON.podspec => AlamofireSwiftyJSON.podspec (100%) rename {Alamofire-SwiftyJSON.xcodeproj => AlamofireSwiftyJSON.xcodeproj}/project.pbxproj (90%) rename {Alamofire-SwiftyJSON.xcodeproj => AlamofireSwiftyJSON.xcodeproj}/project.xcworkspace/contents.xcworkspacedata (100%) rename {Alamofire-SwiftyJSON.xcodeproj => AlamofireSwiftyJSON.xcodeproj}/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint (100%) rename {Alamofire-SwiftyJSON.xcodeproj => AlamofireSwiftyJSON.xcodeproj}/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist (100%) rename {Alamofire-SwiftyJSON.xcodeproj => AlamofireSwiftyJSON.xcodeproj}/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme (89%) delete mode 100644 Source/Alamofire-SwiftyJSON.h create mode 100644 Source/AlamofireSwiftyJSON.h rename Source/{Alamofire-SwiftyJSON.swift => AlamofireSwiftyJSON.swift} (100%) rename Tests/{Alamofire_SwiftyJSONTests.swift => AlamofireSwiftyJSONTests.swift} (90%) diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved b/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved deleted file mode 100644 index c66e7fd..0000000 --- a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved +++ /dev/null @@ -1,24 +0,0 @@ -{ - "originHash" : "91393b540335b0d2a8eb1ab5676e9368b58fd3e128b01d886940bfd9d3cae474", - "pins" : [ - { - "identity" : "alamofire", - "kind" : "remoteSourceControl", - "location" : "https://github.com/Alamofire/Alamofire.git", - "state" : { - "revision" : "513364f870f6bfc468f9d2ff0a95caccc10044c5", - "version" : "5.10.2" - } - }, - { - "identity" : "swiftyjson", - "kind" : "remoteSourceControl", - "location" : "https://github.com/SwiftyJSON/SwiftyJSON", - "state" : { - "revision" : "af76cf3ef710b6ca5f8c05f3a31307d44a3c5828", - "version" : "5.0.2" - } - } - ], - "version" : 3 -} diff --git a/Alamofire-SwiftyJSON.podspec b/AlamofireSwiftyJSON.podspec similarity index 100% rename from Alamofire-SwiftyJSON.podspec rename to AlamofireSwiftyJSON.podspec diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj b/AlamofireSwiftyJSON.xcodeproj/project.pbxproj similarity index 90% rename from Alamofire-SwiftyJSON.xcodeproj/project.pbxproj rename to AlamofireSwiftyJSON.xcodeproj/project.pbxproj index 7dba572..f767743 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/project.pbxproj +++ b/AlamofireSwiftyJSON.xcodeproj/project.pbxproj @@ -3,17 +3,17 @@ archiveVersion = 1; classes = { }; - objectVersion = 54; + objectVersion = 63; objects = { /* Begin PBXBuildFile section */ - 773F35732D57E91C0015A90D /* Alamofire-SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */; }; + 773F35732D57E91C0015A90D /* AlamofireSwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */; }; 77AA4B422D2308D600275EEB /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B412D2308D600275EEB /* Alamofire */; }; 77AA4B452D2308F400275EEB /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B442D2308F400275EEB /* SwiftyJSON */; }; A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */; }; - A8AFB72919D140BD0070765E /* Alamofire-SwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */; }; + A8AFB71519D1401D0070765E /* AlamofireSwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; + A8AFB71F19D1401D0070765E /* AlamofireSwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */; }; + A8AFB72919D140BD0070765E /* AlamofireSwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -54,11 +54,11 @@ 77AA4B462D23096D00275EEB /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; A8AFB71319D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Alamofire-SwiftyJSON.h"; sourceTree = ""; }; + A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlamofireSwiftyJSON.h; sourceTree = ""; }; A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AlamofireSwiftyJSONTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; A8AFB71D19D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Alamofire_SwiftyJSONTests.swift; sourceTree = ""; }; - A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Alamofire-SwiftyJSON.swift"; sourceTree = ""; }; + A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireSwiftyJSONTests.swift; sourceTree = ""; }; + A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlamofireSwiftyJSON.swift; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -103,8 +103,8 @@ A8AFB71119D1401D0070765E /* Source */ = { isa = PBXGroup; children = ( - A8AFB71419D1401D0070765E /* Alamofire-SwiftyJSON.h */, - A8AFB72819D140BD0070765E /* Alamofire-SwiftyJSON.swift */, + A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */, + A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */, A8AFB71219D1401D0070765E /* Supporting Files */, ); path = Source; @@ -121,7 +121,7 @@ A8AFB71B19D1401D0070765E /* Tests */ = { isa = PBXGroup; children = ( - A8AFB71E19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift */, + A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */, A8AFB71C19D1401D0070765E /* Supporting Files */, ); path = Tests; @@ -142,7 +142,7 @@ isa = PBXHeadersBuildPhase; buildActionMask = 2147483647; files = ( - A8AFB71519D1401D0070765E /* Alamofire-SwiftyJSON.h in Headers */, + A8AFB71519D1401D0070765E /* AlamofireSwiftyJSON.h in Headers */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -196,7 +196,7 @@ BuildIndependentTargetsInParallel = YES; LastSwiftUpdateCheck = 0700; LastUpgradeCheck = 1620; - ORGANIZATIONNAME = SwiftJSON; + ORGANIZATIONNAME = AlamofireSwiftyJSON; TargetAttributes = { A8AFB70E19D1401D0070765E = { CreatedOnToolsVersion = 6.0.1; @@ -208,8 +208,8 @@ }; }; }; - buildConfigurationList = A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "Alamofire-SwiftyJSON" */; - compatibilityVersion = "Xcode 3.2"; + buildConfigurationList = A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "AlamofireSwiftyJSON" */; + compatibilityVersion = "Xcode 15.3"; developmentRegion = English; hasScannedForEncodings = 0; knownRegions = ( @@ -253,7 +253,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - A8AFB72919D140BD0070765E /* Alamofire-SwiftyJSON.swift in Sources */, + A8AFB72919D140BD0070765E /* AlamofireSwiftyJSON.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -261,8 +261,8 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - 773F35732D57E91C0015A90D /* Alamofire-SwiftyJSON.swift in Sources */, - A8AFB71F19D1401D0070765E /* Alamofire_SwiftyJSONTests.swift in Sources */, + 773F35732D57E91C0015A90D /* AlamofireSwiftyJSON.swift in Sources */, + A8AFB71F19D1401D0070765E /* AlamofireSwiftyJSONTests.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -494,7 +494,7 @@ /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ - A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "Alamofire-SwiftyJSON" */ = { + A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "AlamofireSwiftyJSON" */ = { isa = XCConfigurationList; buildConfigurations = ( A8AFB72019D1401D0070765E /* Debug */, diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata similarity index 100% rename from Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata rename to AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint similarity index 100% rename from Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint rename to AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint diff --git a/Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist similarity index 100% rename from Alamofire-SwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist rename to AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist diff --git a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme b/AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme similarity index 89% rename from Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme rename to AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme index ad07961..aee98c3 100644 --- a/Alamofire-SwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme +++ b/AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme @@ -17,7 +17,7 @@ BlueprintIdentifier = "A8AFB70E19D1401D0070765E" BuildableName = "AlamofireSwiftyJSON.framework" BlueprintName = "AlamofireSwiftyJSON" - ReferencedContainer = "container:Alamofire-SwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> @@ -47,7 +47,7 @@ BlueprintIdentifier = "A8AFB70E19D1401D0070765E" BuildableName = "AlamofireSwiftyJSON.framework" BlueprintName = "AlamofireSwiftyJSON" - ReferencedContainer = "container:Alamofire-SwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> @@ -58,7 +58,7 @@ BlueprintIdentifier = "A8AFB71919D1401D0070765E" BuildableName = "AlamofireSwiftyJSONTests.xctest" BlueprintName = "AlamofireSwiftyJSONTests" - ReferencedContainer = "container:Alamofire-SwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> @@ -79,7 +79,7 @@ BlueprintIdentifier = "A8AFB70E19D1401D0070765E" BuildableName = "AlamofireSwiftyJSON.framework" BlueprintName = "AlamofireSwiftyJSON" - ReferencedContainer = "container:Alamofire-SwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> @@ -95,7 +95,7 @@ BlueprintIdentifier = "A8AFB70E19D1401D0070765E" BuildableName = "AlamofireSwiftyJSON.framework" BlueprintName = "AlamofireSwiftyJSON" - ReferencedContainer = "container:Alamofire-SwiftyJSON.xcodeproj"> + ReferencedContainer = "container:AlamofireSwiftyJSON.xcodeproj"> diff --git a/Source/Alamofire-SwiftyJSON.h b/Source/Alamofire-SwiftyJSON.h deleted file mode 100644 index 2f8bd28..0000000 --- a/Source/Alamofire-SwiftyJSON.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// Alamofire-SwiftyJSON.h -// Alamofire-SwiftyJSON -// -// Created by Pinglin Tang on 14-9-23. -// Copyright (c) 2014年 SwiftJSON. All rights reserved. -// - -#import - -//! Project version number for Alamofire-SwiftyJSON. -FOUNDATION_EXPORT double Alamofire_SwiftyJSONVersionNumber; - -//! Project version string for Alamofire-SwiftyJSON. -FOUNDATION_EXPORT const unsigned char Alamofire_SwiftyJSONVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Source/AlamofireSwiftyJSON.h b/Source/AlamofireSwiftyJSON.h new file mode 100644 index 0000000..0392dd2 --- /dev/null +++ b/Source/AlamofireSwiftyJSON.h @@ -0,0 +1,19 @@ +// +// AlamofireSwiftyJSON.h +// AlamofireSwiftyJSON +// +// Created by Pinglin Tang on 14-9-23. +// Copyright (c) 2014年 SwiftJSON. All rights reserved. +// + +#import + +//! Project version number for AlamofireSwiftyJSON. +FOUNDATION_EXPORT double AlamofireSwiftyJSONVersionNumber; + +//! Project version string for AlamofireSwiftyJSON. +FOUNDATION_EXPORT const unsigned char AlamofireSwiftyJSONVersionString[]; + +// In this header, you should import all the public headers of your framework using statements like #import + + diff --git a/Source/Alamofire-SwiftyJSON.swift b/Source/AlamofireSwiftyJSON.swift similarity index 100% rename from Source/Alamofire-SwiftyJSON.swift rename to Source/AlamofireSwiftyJSON.swift diff --git a/Tests/Alamofire_SwiftyJSONTests.swift b/Tests/AlamofireSwiftyJSONTests.swift similarity index 90% rename from Tests/Alamofire_SwiftyJSONTests.swift rename to Tests/AlamofireSwiftyJSONTests.swift index cd65a46..e1b5988 100644 --- a/Tests/Alamofire_SwiftyJSONTests.swift +++ b/Tests/AlamofireSwiftyJSONTests.swift @@ -1,6 +1,6 @@ // -// Alamofire_SwiftyJSONTests.swift -// Alamofire-SwiftyJSONTests +// AlamofireSwiftyJSONTests.swift +// AlamofireSwiftyJSONTests // // Created by Pinglin Tang on 14-9-23. // Copyright (c) 2014年 SwiftJSON. All rights reserved. @@ -11,7 +11,7 @@ import AlamofireSwiftyJSON import SwiftyJSON import XCTest -class Alamofire_SwiftyJSONTests: XCTestCase { +class AlamofireSwiftyJSONTests: XCTestCase { func testGETRequestJSONResponse() { let URL = "http://httpbin.org/get" let parameters: Parameters = ["foo": "bar"] From f017b7c57adece7ec78b2caded4c42f4073d5357 Mon Sep 17 00:00:00 2001 From: A Porat Date: Fri, 14 Feb 2025 08:27:47 -0500 Subject: [PATCH 3/6] Update and rename ci.yml to build.yml --- .github/workflows/build.yml | 33 ++++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 38 ------------------------------------- 2 files changed, 33 insertions(+), 38 deletions(-) create mode 100644 .github/workflows/build.yml delete mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..f6dbbcf --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,33 @@ +name: Build + +on: + push: + branches: [ "master" ] + pull_request: + branches: [ "master" ] + +jobs: + build: + name: ${{ matrix.platform }} on ${{ matrix.os }} + runs-on: macos-15 + env: + scheme: AlamofireSwiftyJSON + strategy: + fail-fast: false + matrix: + include: + - platform: iPhone 16 Pro + os: 18.1 + - platform: iPhone 16 Pro + os: 18.2 + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: Run Build on ${{ matrix.platform }} (iOS ${{ matrix.os }}) + run: | + xcodebuild build \ + -scheme $scheme \ + -destination 'platform=iOS Simulator,name=${{ matrix.platform }},OS=${{ matrix.os }}' diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index ad880f0..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Swift - -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] - -jobs: - build: - name: Swift ${{ matrix.platform }} on ${{ matrix.os }} - runs-on: macos-latest - - strategy: - matrix: - platform: - - platform=iPhone 16 Pro Max - - platform=iPhone 16 Pro - os: - - 17.4 - - 18.2 - - steps: - - # Checkout the repository - - name: Checkout repository - uses: actions/checkout@v4 - - # Install any dependencies - - name: Install Dependencies - run: swift package resolve - - # Run tests on ${{ matrix.platform }} with iOS ${{ matrix.os }} - - name: Run Tests on ${{ matrix.platform }} (iOS ${{ matrix.os }}) - run: | - xcodebuild test \ - -scheme 'AlamofireSwiftyJSON' \ - -destination 'platform=iOS Simulator,name=${{ matrix.platform }},OS=${{ matrix.os }}' From 27cb9802ff75b3a1c781a17b6e9363d480561aa6 Mon Sep 17 00:00:00 2001 From: aporat28 Date: Thu, 27 Feb 2025 12:21:01 -0500 Subject: [PATCH 4/6] added dependabot --- .github/dependabot.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/dependabot.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..e949122 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,13 @@ +version: 2 +updates: + # Check for updates to GitHub Actions + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "daily" + + # Maintain dependencies for Composer + - package-ecosystem: "swift" + directory: "/" + schedule: + interval: "weekly" From aed6502009a4fe8c0063c8d7cdaac301ba1223e2 Mon Sep 17 00:00:00 2001 From: aporat28 Date: Fri, 12 Sep 2025 08:43:54 -0400 Subject: [PATCH 5/6] cleanup --- .github/workflows/{build.yml => ci.yml} | 0 AlamofireSwiftyJSON.podspec | 16 - AlamofireSwiftyJSON.xcodeproj/project.pbxproj | 559 ------------------ .../contents.xcworkspacedata | 7 - .../Alamofire-SwiftyJSON.xcscmblueprint | 37 -- .../xcshareddata/IDEWorkspaceChecks.plist | 8 - .../xcschemes/AlamofireSwiftyJSON.xcscheme | 109 ---- Package.swift | 9 +- Podfile | 14 - Podfile.lock | 20 - README.md | 68 ++- Source/AlamofireSwiftyJSON.h | 19 - Source/Info.plist | 26 - {Source => Sources}/AlamofireSwiftyJSON.swift | 0 ...AlamofireSwiftyJSONTests-Bridging-Header.h | 4 + Tests/AlamofireSwiftyJSONTests.swift | 97 ++- Tests/Info.plist | 24 - 17 files changed, 114 insertions(+), 903 deletions(-) rename .github/workflows/{build.yml => ci.yml} (100%) delete mode 100644 AlamofireSwiftyJSON.podspec delete mode 100644 AlamofireSwiftyJSON.xcodeproj/project.pbxproj delete mode 100644 AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata delete mode 100644 AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint delete mode 100644 AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist delete mode 100644 AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme delete mode 100644 Podfile delete mode 100644 Podfile.lock delete mode 100644 Source/AlamofireSwiftyJSON.h delete mode 100644 Source/Info.plist rename {Source => Sources}/AlamofireSwiftyJSON.swift (100%) create mode 100644 Tests/AlamofireSwiftyJSONTests-Bridging-Header.h delete mode 100644 Tests/Info.plist diff --git a/.github/workflows/build.yml b/.github/workflows/ci.yml similarity index 100% rename from .github/workflows/build.yml rename to .github/workflows/ci.yml diff --git a/AlamofireSwiftyJSON.podspec b/AlamofireSwiftyJSON.podspec deleted file mode 100644 index 66aa6ea..0000000 --- a/AlamofireSwiftyJSON.podspec +++ /dev/null @@ -1,16 +0,0 @@ -Pod::Spec.new do |s| - s.name = "Alamofire-SwiftyJSON" - s.version = "5.0.0" - s.summary = "Alamofire extension for serialize NSData to SwiftyJSON " - s.homepage = "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON" - s.license = { :type => "MIT" } - s.authors = { "tangplin" => "tangplin@gmail.com" } - - s.requires_arc = true - s.osx.deployment_target = "10.11" - s.ios.deployment_target = "15.0" - s.source = { :git => "https://github.com/SwiftyJSON/Alamofire-SwiftyJSON.git", :tag => s.version } - s.source_files = "Source/*.swift" - s.dependency 'Alamofire', '~> 5' - s.dependency 'SwiftyJSON', '~> 5' -end diff --git a/AlamofireSwiftyJSON.xcodeproj/project.pbxproj b/AlamofireSwiftyJSON.xcodeproj/project.pbxproj deleted file mode 100644 index f767743..0000000 --- a/AlamofireSwiftyJSON.xcodeproj/project.pbxproj +++ /dev/null @@ -1,559 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 63; - objects = { - -/* Begin PBXBuildFile section */ - 773F35732D57E91C0015A90D /* AlamofireSwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */; }; - 77AA4B422D2308D600275EEB /* Alamofire in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B412D2308D600275EEB /* Alamofire */; }; - 77AA4B452D2308F400275EEB /* SwiftyJSON in Frameworks */ = {isa = PBXBuildFile; productRef = 77AA4B442D2308F400275EEB /* SwiftyJSON */; }; - A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */ = {isa = PBXBuildFile; fileRef = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; }; - A8AFB71519D1401D0070765E /* AlamofireSwiftyJSON.h in Headers */ = {isa = PBXBuildFile; fileRef = A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */; settings = {ATTRIBUTES = (Public, ); }; }; - A8AFB71F19D1401D0070765E /* AlamofireSwiftyJSONTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */; }; - A8AFB72919D140BD0070765E /* AlamofireSwiftyJSON.swift in Sources */ = {isa = PBXBuildFile; fileRef = A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = A8AFB70619D1401D0070765E /* Project object */; - proxyType = 1; - remoteGlobalIDString = A8AFB70E19D1401D0070765E; - remoteInfo = AlamofireSwiftyJSON; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - A82ED83919ED37D300A502B1 /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 8; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 1; - }; - A8A2DBC21A2329CE00AF9EFC /* Copy Frameworks */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = ""; - dstSubfolderSpec = 10; - files = ( - A8A2DBC51A2329E700AF9EFC /* AlamofireSwiftyJSON.framework in Copy Frameworks */, - ); - name = "Copy Frameworks"; - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 77AA4B462D23096D00275EEB /* Package.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Package.swift; sourceTree = ""; }; - A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AlamofireSwiftyJSON.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB71319D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AlamofireSwiftyJSON.h; sourceTree = ""; }; - A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = AlamofireSwiftyJSONTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; - A8AFB71D19D1401D0070765E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; - A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AlamofireSwiftyJSONTests.swift; sourceTree = ""; }; - A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AlamofireSwiftyJSON.swift; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - A8AFB70B19D1401D0070765E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 77AA4B452D2308F400275EEB /* SwiftyJSON in Frameworks */, - 77AA4B422D2308D600275EEB /* Alamofire in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A8AFB71719D1401D0070765E /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - A8AFB70519D1401D0070765E = { - isa = PBXGroup; - children = ( - 77AA4B462D23096D00275EEB /* Package.swift */, - A8AFB71119D1401D0070765E /* Source */, - A8AFB71B19D1401D0070765E /* Tests */, - A8AFB71019D1401D0070765E /* Products */, - ); - sourceTree = ""; - }; - A8AFB71019D1401D0070765E /* Products */ = { - isa = PBXGroup; - children = ( - A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */, - A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */, - ); - name = Products; - sourceTree = ""; - }; - A8AFB71119D1401D0070765E /* Source */ = { - isa = PBXGroup; - children = ( - A8AFB71419D1401D0070765E /* AlamofireSwiftyJSON.h */, - A8AFB72819D140BD0070765E /* AlamofireSwiftyJSON.swift */, - A8AFB71219D1401D0070765E /* Supporting Files */, - ); - path = Source; - sourceTree = ""; - }; - A8AFB71219D1401D0070765E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - A8AFB71319D1401D0070765E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; - A8AFB71B19D1401D0070765E /* Tests */ = { - isa = PBXGroup; - children = ( - A8AFB71E19D1401D0070765E /* AlamofireSwiftyJSONTests.swift */, - A8AFB71C19D1401D0070765E /* Supporting Files */, - ); - path = Tests; - sourceTree = ""; - }; - A8AFB71C19D1401D0070765E /* Supporting Files */ = { - isa = PBXGroup; - children = ( - A8AFB71D19D1401D0070765E /* Info.plist */, - ); - name = "Supporting Files"; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - A8AFB70C19D1401D0070765E /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - A8AFB71519D1401D0070765E /* AlamofireSwiftyJSON.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */ = { - isa = PBXNativeTarget; - buildConfigurationList = A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */; - buildPhases = ( - A8AFB70A19D1401D0070765E /* Sources */, - A8AFB70B19D1401D0070765E /* Frameworks */, - A8AFB70C19D1401D0070765E /* Headers */, - A8AFB70D19D1401D0070765E /* Resources */, - A82ED83919ED37D300A502B1 /* Copy Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = AlamofireSwiftyJSON; - productName = "Alamofire-SwiftyJSON"; - productReference = A8AFB70F19D1401D0070765E /* AlamofireSwiftyJSON.framework */; - productType = "com.apple.product-type.framework"; - }; - A8AFB71919D1401D0070765E /* AlamofireSwiftyJSONTests */ = { - isa = PBXNativeTarget; - buildConfigurationList = A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */; - buildPhases = ( - A8AFB71619D1401D0070765E /* Sources */, - A8AFB71719D1401D0070765E /* Frameworks */, - A8AFB71819D1401D0070765E /* Resources */, - A8A2DBC21A2329CE00AF9EFC /* Copy Frameworks */, - ); - buildRules = ( - ); - dependencies = ( - A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */, - ); - name = AlamofireSwiftyJSONTests; - productName = "Alamofire-SwiftyJSONTests"; - productReference = A8AFB71A19D1401D0070765E /* AlamofireSwiftyJSONTests.xctest */; - productType = "com.apple.product-type.bundle.unit-test"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - A8AFB70619D1401D0070765E /* Project object */ = { - isa = PBXProject; - attributes = { - BuildIndependentTargetsInParallel = YES; - LastSwiftUpdateCheck = 0700; - LastUpgradeCheck = 1620; - ORGANIZATIONNAME = AlamofireSwiftyJSON; - TargetAttributes = { - A8AFB70E19D1401D0070765E = { - CreatedOnToolsVersion = 6.0.1; - LastSwiftMigration = 0820; - }; - A8AFB71919D1401D0070765E = { - CreatedOnToolsVersion = 6.0.1; - LastSwiftMigration = 0820; - }; - }; - }; - buildConfigurationList = A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "AlamofireSwiftyJSON" */; - compatibilityVersion = "Xcode 15.3"; - developmentRegion = English; - hasScannedForEncodings = 0; - knownRegions = ( - English, - en, - ); - mainGroup = A8AFB70519D1401D0070765E; - packageReferences = ( - 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */, - 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */, - ); - productRefGroup = A8AFB71019D1401D0070765E /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */, - A8AFB71919D1401D0070765E /* AlamofireSwiftyJSONTests */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - A8AFB70D19D1401D0070765E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A8AFB71819D1401D0070765E /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - A8AFB70A19D1401D0070765E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - A8AFB72919D140BD0070765E /* AlamofireSwiftyJSON.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - A8AFB71619D1401D0070765E /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 773F35732D57E91C0015A90D /* AlamofireSwiftyJSON.swift in Sources */, - A8AFB71F19D1401D0070765E /* AlamofireSwiftyJSONTests.swift in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - A8A2DBBD1A2329BD00AF9EFC /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = A8AFB70E19D1401D0070765E /* AlamofireSwiftyJSON */; - targetProxy = A8A2DBBC1A2329BD00AF9EFC /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - A8AFB72019D1401D0070765E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = YES; - ONLY_ACTIVE_ARCH = YES; - SDKROOT = iphoneos; - SWIFT_OPTIMIZATION_LEVEL = "-Onone"; - TARGETED_DEVICE_FAMILY = "1,2"; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Debug; - }; - A8AFB72119D1401D0070765E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; - CLANG_CXX_LIBRARY = "libc++"; - CLANG_ENABLE_MODULES = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; - CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; - CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; - COPY_PHASE_STRIP = NO; - CURRENT_PROJECT_VERSION = 1; - ENABLE_NS_ASSERTIONS = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_USER_SCRIPT_SANDBOXING = YES; - GCC_C_LANGUAGE_STANDARD = gnu99; - GCC_NO_COMMON_BLOCKS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 12.0; - MTL_ENABLE_DEBUG_INFO = NO; - SDKROOT = iphoneos; - SWIFT_COMPILATION_MODE = wholemodule; - SWIFT_OPTIMIZATION_LEVEL = "-O"; - TARGETED_DEVICE_FAMILY = "1,2"; - VALIDATE_PRODUCT = YES; - VERSIONING_SYSTEM = "apple-generic"; - VERSION_INFO_PREFIX = ""; - }; - name = Release; - }; - A8AFB72319D1401D0070765E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; - PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; - "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = AlamofireSwiftyJSON; - "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = AlamofireSwiftyJSON; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - A8AFB72419D1401D0070765E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "Apple Development"; - CODE_SIGN_STYLE = Automatic; - DEFINES_MODULE = YES; - DEVELOPMENT_TEAM = ""; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - DYLIB_INSTALL_NAME_BASE = "@rpath"; - ENABLE_MODULE_VERIFIER = YES; - INFOPLIST_FILE = "$(SRCROOT)/Source/Info.plist"; - INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks"; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - MODULE_VERIFIER_SUPPORTED_LANGUAGE_STANDARDS = "gnu99 gnu++11"; - PRODUCT_BUNDLE_IDENTIFIER = "com.swiftjson.$(PRODUCT_NAME:rfc1034identifier)"; - "PRODUCT_BUNDLE_IDENTIFIER[sdk=iphoneos*]" = AlamofireSwiftyJSON; - "PRODUCT_BUNDLE_IDENTIFIER[sdk=macosx*]" = AlamofireSwiftyJSON; - PRODUCT_NAME = "$(TARGET_NAME)"; - PROVISIONING_PROFILE_SPECIFIER = ""; - SKIP_INSTALL = YES; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; - A8AFB72619D1401D0070765E /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - GCC_PREPROCESSOR_DEFINITIONS = ( - "DEBUG=1", - "$(inherited)", - ); - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = AlamofireSwiftyJSONTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Debug; - }; - A8AFB72719D1401D0070765E /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - "CODE_SIGN_IDENTITY[sdk=macosx*]" = "-"; - INFOPLIST_FILE = Tests/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.6; - LD_RUNPATH_SEARCH_PATHS = ( - "$(inherited)", - "@executable_path/Frameworks", - "@loader_path/Frameworks", - ); - PRODUCT_BUNDLE_IDENTIFIER = AlamofireSwiftyJSONTests; - PRODUCT_NAME = "$(TARGET_NAME)"; - SWIFT_VERSION = 5.0; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - A8AFB70919D1401D0070765E /* Build configuration list for PBXProject "AlamofireSwiftyJSON" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A8AFB72019D1401D0070765E /* Debug */, - A8AFB72119D1401D0070765E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A8AFB72219D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSON" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A8AFB72319D1401D0070765E /* Debug */, - A8AFB72419D1401D0070765E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - A8AFB72519D1401D0070765E /* Build configuration list for PBXNativeTarget "AlamofireSwiftyJSONTests" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - A8AFB72619D1401D0070765E /* Debug */, - A8AFB72719D1401D0070765E /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - -/* Begin XCRemoteSwiftPackageReference section */ - 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/Alamofire/Alamofire.git"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 5.10.2; - }; - }; - 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */ = { - isa = XCRemoteSwiftPackageReference; - repositoryURL = "https://github.com/SwiftyJSON/SwiftyJSON"; - requirement = { - kind = upToNextMajorVersion; - minimumVersion = 5.0.2; - }; - }; -/* End XCRemoteSwiftPackageReference section */ - -/* Begin XCSwiftPackageProductDependency section */ - 77AA4B412D2308D600275EEB /* Alamofire */ = { - isa = XCSwiftPackageProductDependency; - package = 77AA4B402D2308D600275EEB /* XCRemoteSwiftPackageReference "Alamofire" */; - productName = Alamofire; - }; - 77AA4B442D2308F400275EEB /* SwiftyJSON */ = { - isa = XCSwiftPackageProductDependency; - package = 77AA4B432D2308F400275EEB /* XCRemoteSwiftPackageReference "SwiftyJSON" */; - productName = SwiftyJSON; - }; -/* End XCSwiftPackageProductDependency section */ - }; - rootObject = A8AFB70619D1401D0070765E /* Project object */; -} diff --git a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index 919434a..0000000 --- a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint deleted file mode 100644 index 817d609..0000000 --- a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/Alamofire-SwiftyJSON.xcscmblueprint +++ /dev/null @@ -1,37 +0,0 @@ -{ - "DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "79EA0C4F360E98830418AFAE1A03A39D646B0106", - "DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : { - - }, - "DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : { - "67620B5EFA902936DF04070AF595B76AB0333747" : 0, - "C861FC00CEE0F6A6BE81FCFF6785FAA78C58EBB3" : 0, - "79EA0C4F360E98830418AFAE1A03A39D646B0106" : 0 - }, - "DVTSourceControlWorkspaceBlueprintIdentifierKey" : "91EDE7D1-24DF-4EB3-99E3-20EFE55617CE", - "DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : { - "67620B5EFA902936DF04070AF595B76AB0333747" : "Alamofire-SwiftyJSON\/Alamofire\/", - "C861FC00CEE0F6A6BE81FCFF6785FAA78C58EBB3" : "Alamofire-SwiftyJSON\/SwiftyJSON\/", - "79EA0C4F360E98830418AFAE1A03A39D646B0106" : "Alamofire-SwiftyJSON\/" - }, - "DVTSourceControlWorkspaceBlueprintNameKey" : "Alamofire-SwiftyJSON", - "DVTSourceControlWorkspaceBlueprintVersion" : 204, - "DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "Alamofire-SwiftyJSON.xcodeproj", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [ - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/Alamofire\/Alamofire.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "67620B5EFA902936DF04070AF595B76AB0333747" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/jregnauld\/Alamofire-SwiftyJSON.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "79EA0C4F360E98830418AFAE1A03A39D646B0106" - }, - { - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "https:\/\/github.com\/SwiftyJSON\/SwiftyJSON.git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git", - "DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "C861FC00CEE0F6A6BE81FCFF6785FAA78C58EBB3" - } - ] -} \ No newline at end of file diff --git a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d9810..0000000 --- a/AlamofireSwiftyJSON.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme b/AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme deleted file mode 100644 index aee98c3..0000000 --- a/AlamofireSwiftyJSON.xcodeproj/xcshareddata/xcschemes/AlamofireSwiftyJSON.xcscheme +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Package.swift b/Package.swift index b782232..97ec3d3 100644 --- a/Package.swift +++ b/Package.swift @@ -1,12 +1,11 @@ // swift-tools-version:5.9 -// The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package( name: "AlamofireSwiftyJSON", platforms: [ - .iOS(.v15), + .iOS(.v17), .tvOS(.v13), .macOS(.v12), ], @@ -24,12 +23,12 @@ let package = Package( targets: [ .target( name: "AlamofireSwiftyJSON", - dependencies: ["Alamofire", "SwiftyJSON"], - path: "Source" + dependencies: ["Alamofire", "SwiftyJSON"] ), .testTarget( name: "AlamofireSwiftyJSONTests", dependencies: ["AlamofireSwiftyJSON"] ) - ] + ], + swiftLanguageVersions: [.v5] ) diff --git a/Podfile b/Podfile deleted file mode 100644 index 03be5b4..0000000 --- a/Podfile +++ /dev/null @@ -1,14 +0,0 @@ -platform :ios, '10' - -source 'https://github.com/CocoaPods/Specs.git' -use_frameworks! - -target 'AlamofireSwiftyJSON' do - pod 'Alamofire', '~> 5' - pod 'SwiftyJSON', '~> 5' -end - -target 'AlamofireSwiftyJSONTests' do - pod 'Alamofire', '~> 5' - pod 'SwiftyJSON', '~> 5' -end diff --git a/Podfile.lock b/Podfile.lock deleted file mode 100644 index 587878c..0000000 --- a/Podfile.lock +++ /dev/null @@ -1,20 +0,0 @@ -PODS: - - Alamofire (5.2.2) - - SwiftyJSON (5.0.0) - -DEPENDENCIES: - - Alamofire (~> 5) - - SwiftyJSON (~> 5) - -SPEC REPOS: - https://github.com/CocoaPods/Specs.git: - - Alamofire - - SwiftyJSON - -SPEC CHECKSUMS: - Alamofire: 814429acc853c6c54ff123fc3d2ef66803823ce0 - SwiftyJSON: 36413e04c44ee145039d332b4f4e2d3e8d6c4db7 - -PODFILE CHECKSUM: 5175165036843bb0979dcfa0e46433202caf367a - -COCOAPODS: 1.10.0.beta.2 diff --git a/README.md b/README.md index dd656c1..de4dc1c 100644 --- a/README.md +++ b/README.md @@ -1,52 +1,50 @@ -# Alamofire-SwiftyJSON ![](https://travis-ci.org/SwiftyJSON/Alamofire-SwiftyJSON.svg?branch=master) +# AlamofireSwiftyJSON -An extension to make serializing [Alamofire](https://github.com/Alamofire/Alamofire)'s response with [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) easily. +An extension that simplifies using [SwiftyJSON](https://github.com/SwiftyJSON/SwiftyJSON) with [Alamofire](https://github.com/Alamofire/Alamofire). Easily parse JSON responses into `SwiftyJSON.JSON` objects. -⚠️ **To use with Swift 3.x please ensure you are using >= `2.0.0`** ⚠️ +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Faporat%2FAlamofireSwiftSoup%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/aporat/AlamofireSwiftSoup) +[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Faporat%2FAlamofireSwiftSoup%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/aporat/AlamofireSwiftSoup) +![GitHub Actions Workflow Status](https://github.com/aporat/AlamofireSwiftSoup/actions/workflows/ci.yml/badge.svg) -⚠️ **To use with Swift 4.x please ensure you are using >= `3.0.0`** ⚠️ +[![codecov](https://codecov.io/gh/aporat/AlamofireSwiftyJSON/graph/badge.svg?token=YYQOZL6W2K)](https://codecov.io/gh/aporat/AlamofireSwiftyJSON) -⚠️ **To use with Swift 5.x please ensure you are using >= `5.0.0`** ⚠️ +--- -## Swift version +## 📦 Installation -Alamofire-SwiftyJSON | Swift version | Alamofire | SwiftyJSON -------------- | --------------| ----------| ---------- -2.x | Swift 3.x | 4.x | 3.x -3.x | Swift 4.x | 4.5.x | 4.x -5.x | Swift 5.x | 5.x | 5.x +### Swift Package Manager (Recommended) -## Requirements +Add this package to your `Package.swift` dependencies: -- iOS 8.0+ / Mac OS X 10.9+ -- Xcode 8.0+ -- Swift 3.0+ +```swift +.package(url: "https://github.com/your-username/AlamofireSwiftyJSON.git", from: "1.0.0") +``` -## Install +Then add `"AlamofireSwiftyJSON"` to your target dependencies. -[CocoaPods](https://cocoapods.org/): +--- -```ruby -pod 'Alamofire-SwiftyJSON' -``` +## ✅ Requirements -[Carthage](https://github.com/Carthage/Carthage): +- iOS 15+ / macOS 12+ / tvOS 13+ +- Swift 5.9+ +- Xcode 15+ -``` -github "SwiftyJSON/Alamofire-SwiftyJSON" "master" -``` +--- -## Usage -```swift -import Alamofire_SwiftyJSON -``` +## 🚀 Usage ```swift -AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) - .responseSwiftyJSON { dataResponse in - print(dataResponse.request) - print(dataResponse.response) - print(dataResponse.error) - print(dataResponse.value) - }) +import Alamofire +import AlamofireSwiftyJSON + +AF.request("https://api.example.com/data") + .responseSwiftyJSON { response in + switch response.result { + case .success(let json): + print("JSON:", json) + case .failure(let error): + print("Error:", error) + } + } ``` diff --git a/Source/AlamofireSwiftyJSON.h b/Source/AlamofireSwiftyJSON.h deleted file mode 100644 index 0392dd2..0000000 --- a/Source/AlamofireSwiftyJSON.h +++ /dev/null @@ -1,19 +0,0 @@ -// -// AlamofireSwiftyJSON.h -// AlamofireSwiftyJSON -// -// Created by Pinglin Tang on 14-9-23. -// Copyright (c) 2014年 SwiftJSON. All rights reserved. -// - -#import - -//! Project version number for AlamofireSwiftyJSON. -FOUNDATION_EXPORT double AlamofireSwiftyJSONVersionNumber; - -//! Project version string for AlamofireSwiftyJSON. -FOUNDATION_EXPORT const unsigned char AlamofireSwiftyJSONVersionString[]; - -// In this header, you should import all the public headers of your framework using statements like #import - - diff --git a/Source/Info.plist b/Source/Info.plist deleted file mode 100644 index e0f4bf7..0000000 --- a/Source/Info.plist +++ /dev/null @@ -1,26 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - FMWK - CFBundleShortVersionString - 3.0.0 - CFBundleSignature - ???? - CFBundleVersion - $(CURRENT_PROJECT_VERSION) - NSPrincipalClass - - - diff --git a/Source/AlamofireSwiftyJSON.swift b/Sources/AlamofireSwiftyJSON.swift similarity index 100% rename from Source/AlamofireSwiftyJSON.swift rename to Sources/AlamofireSwiftyJSON.swift diff --git a/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h b/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h new file mode 100644 index 0000000..1b2cb5d --- /dev/null +++ b/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h @@ -0,0 +1,4 @@ +// +// Use this file to import your target's public headers that you would like to expose to Swift. +// + diff --git a/Tests/AlamofireSwiftyJSONTests.swift b/Tests/AlamofireSwiftyJSONTests.swift index e1b5988..7d3fa12 100644 --- a/Tests/AlamofireSwiftyJSONTests.swift +++ b/Tests/AlamofireSwiftyJSONTests.swift @@ -1,30 +1,79 @@ -// -// AlamofireSwiftyJSONTests.swift -// AlamofireSwiftyJSONTests -// -// Created by Pinglin Tang on 14-9-23. -// Copyright (c) 2014年 SwiftJSON. All rights reserved. -// - +import XCTest import Alamofire -import AlamofireSwiftyJSON import SwiftyJSON -import XCTest +@testable import AlamofireSwiftyJSON + +final class SwiftyJSONResponseSerializerTests: XCTestCase { + + func testValidJSONResponseParsesSuccessfully() throws { + // Given + let jsonObject: [String: Any] = ["name": "Adam", "age": 30] + let data = try JSONSerialization.data(withJSONObject: jsonObject, options: []) + + let serializer = SwiftyJSONResponseSerializer() + let response = HTTPURLResponse(url: URL(string: "https://example.com")!, + statusCode: 200, + httpVersion: nil, + headerFields: nil) + + // When + let json = try serializer.serialize(request: nil, response: response, data: data, error: nil) + + // Then + XCTAssertEqual(json["name"].stringValue, "Adam") + XCTAssertEqual(json["age"].intValue, 30) + } + + func testEmptyResponseWith204Succeeds() throws { + // Given + let data = Data() + let response = HTTPURLResponse(url: URL(string: "https://example.com")!, + statusCode: 204, + httpVersion: nil, + headerFields: nil) -class AlamofireSwiftyJSONTests: XCTestCase { - func testGETRequestJSONResponse() { - let URL = "http://httpbin.org/get" - let parameters: Parameters = ["foo": "bar"] - let expect = expectation(description: "responseSwiftyJSON method should work") - AF.request(URL, method: .get, parameters: parameters, encoding: URLEncoding.default) - .validate() - .responseSwiftyJSON { response in - XCTAssertNotNil(response.request, "request should not be nil") - XCTAssertNotNil(response.response, "response should not be nil") - XCTAssertNil(response.error, "result error should be nil") - XCTAssertEqual(response.value?["args"], SwiftyJSON.JSON(["foo": "bar"] as NSDictionary), "args should be equal") - expect.fulfill() + let serializer = SwiftyJSONResponseSerializer() + + // When + let json = try serializer.serialize(request: nil, response: response, data: data, error: nil) + + // Then + XCTAssertEqual(json.boolValue, false) + } + + func testInvalidJSONThrowsError() throws { + // Given + let invalidData = "not-json".data(using: .utf8)! + let response = HTTPURLResponse(url: URL(string: "https://example.com")!, + statusCode: 200, + httpVersion: nil, + headerFields: nil) + + let serializer = SwiftyJSONResponseSerializer() + + // Then + XCTAssertThrowsError( + try serializer.serialize(request: nil, response: response, data: invalidData, error: nil) + ) { error in + guard case AFError.responseSerializationFailed(let reason) = error else { + return XCTFail("Unexpected error type") + } + guard case .jsonSerializationFailed(_) = reason else { + return XCTFail("Expected jsonSerializationFailed") } - waitForExpectations(timeout: 10.0, handler: nil) + } + } + + func testErrorIsThrownDirectly() { + // Given + let error = NSError(domain: "test", code: 1) + let serializer = SwiftyJSONResponseSerializer() + + // Then + XCTAssertThrowsError( + try serializer.serialize(request: nil, response: nil, data: nil, error: error) + ) { thrown in + XCTAssertEqual((thrown as NSError).code, 1) + } } } diff --git a/Tests/Info.plist b/Tests/Info.plist deleted file mode 100644 index ba72822..0000000 --- a/Tests/Info.plist +++ /dev/null @@ -1,24 +0,0 @@ - - - - - CFBundleDevelopmentRegion - en - CFBundleExecutable - $(EXECUTABLE_NAME) - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - $(PRODUCT_NAME) - CFBundlePackageType - BNDL - CFBundleShortVersionString - 1.0 - CFBundleSignature - ???? - CFBundleVersion - 1 - - From 7569083c6cc28c87403829f776ba6efcadd0f85a Mon Sep 17 00:00:00 2001 From: aporat28 Date: Fri, 17 Oct 2025 17:02:41 -0400 Subject: [PATCH 6/6] cleanup --- Sources/AlamofireSwiftyJSON.swift | 16 ++++++++-------- Tests/AlamofireSwiftyJSONTests-Bridging-Header.h | 4 ---- 2 files changed, 8 insertions(+), 12 deletions(-) delete mode 100644 Tests/AlamofireSwiftyJSONTests-Bridging-Header.h diff --git a/Sources/AlamofireSwiftyJSON.swift b/Sources/AlamofireSwiftyJSON.swift index 4f23a34..d664a0a 100644 --- a/Sources/AlamofireSwiftyJSON.swift +++ b/Sources/AlamofireSwiftyJSON.swift @@ -8,11 +8,11 @@ public final class SwiftyJSONResponseSerializer: ResponseSerializer { public let emptyRequestMethods: Set /// `JSONSerialization.ReadingOptions` used when serializing a response. public let options: JSONSerialization.ReadingOptions - + /// Creates an instance with the provided values. /// /// - Parameters: - /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. + /// - dataPreprocessor: `DataPreprocessor` used to prepare the received `Data` for serialization. `SwiftyJSONResponseSerializer.defaultDataPreprocessor` by default. /// - emptyResponseCodes: The HTTP response codes for which empty responses are allowed. `[204, 205]` by default. /// - emptyRequestMethods: The HTTP request methods for which empty responses are allowed. `[.head]` by default. /// - options: The options to use. `.allowFragments` by default. @@ -26,20 +26,20 @@ public final class SwiftyJSONResponseSerializer: ResponseSerializer { self.emptyRequestMethods = emptyRequestMethods self.options = options } - + public func serialize(request: URLRequest?, response: HTTPURLResponse?, data: Data?, error: Error?) throws -> JSON { guard error == nil else { throw error! } - + guard var data = data, !data.isEmpty else { guard emptyResponseAllowed(forRequest: request, response: response) else { throw AFError.responseSerializationFailed(reason: .inputDataNilOrZeroLength) } - - return JSON(booleanLiteral: false) + // Return an empty JSON object for valid empty responses. + return JSON() } - + data = try dataPreprocessor.preprocess(data) - + do { let json = try JSONSerialization.jsonObject(with: data, options: options) return JSON(json) diff --git a/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h b/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h deleted file mode 100644 index 1b2cb5d..0000000 --- a/Tests/AlamofireSwiftyJSONTests-Bridging-Header.h +++ /dev/null @@ -1,4 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to expose to Swift. -// -