netguru / ResponseDetective

Sherlock Holmes of the networking layer. :male_detective:
MIT License
1.95k stars 92 forks source link

Add Swift Package Manager support #64

Closed mattboran closed 2 years ago

mattboran commented 3 years ago

This PR adds support for Swift Package manager to this repository.

The same versions of iOS, macOS, and tvOS are supported as before, and the project structure was not changed. This means that the Carthage and CocoaPods versions of this framework still work.

I had to make 2 small changes in ResponseDetectiveSpec.swift:

  1. Ensure buffer is initialized newly in the beforeEach block. Otherwise, running tests in a random order can fail
  2. I replaced stub(condition: isHost... with HTTPStubs.stubRequests; it's possible I configured something incorrectly, but my Swift compiler was unable to find that method.

Please let me know what you think!

mattboran commented 3 years ago

@akashivskyy could you take a look a this when you get a chance?

akashivskyy commented 3 years ago

Thanks for your contribution, Matt! Unfortunately, I'm no longer a maintainer of this project. I'm sure @Siemian will know someone who can help you get this PR sorted. Cheers! 🙌

Siemian commented 3 years ago

Hi @mattboran, thank you for your contribution, i was testing your changes using Xcode 13 and unfortunately, it does not compile properly. Here is what i got:

Zrzut ekranu 2021-10-20 o 08 58 07

Could you confirm if that's working on your side? We would be happy to merge your changes.

Thanks @akashivskyy for the ping!

mattboran commented 3 years ago

@Siemian thanks for taking a look! It looks like I had configured the header paths incorrectly. I have added some additional build settings to the internal Objective-C target. Now, using Xcode 13.0:

Please let me know if you're seeing something different on your end!

Edit: I did notice that ./carthage.sh bootstrap now fails to build Nimble (Xcode 13.0). This is true on the current develop branch as well

mattboran commented 2 years ago

Bumping this thread @Siemian 🙂

Siemian commented 2 years ago

Hi @mattboran i'm really really sorry for keep you waiting for such a long time. I checked and looks ok now, thanks for your contribution 🙇

Siemian commented 2 years ago

New release created: https://github.com/netguru/ResponseDetective/releases/tag/1.5.1