nst / STHTTPRequest

Obj-C / Cocoa HTTP requests for humans
BSD 3-Clause "New" or "Revised" License
826 stars 75 forks source link

Carthage support: add new targets to build frameworks for iOS & OSX #41

Closed t0rst closed 8 years ago

t0rst commented 8 years ago

Please allow STHTTPRequest to be used via the Carthage dependency manager.

Whereas CocoaPods allows developers to include STHHTPRequest in their application as source, a static library or a framework, Carthage only supports frameworks and relies on recognising shared Xcode schemes with targets that build frameworks. I added two such targets and shared schemes for iOS and OSX. (I'm not sure what the state of Carthage support for universal dynamic frameworks is at the moment.)

The module umbrella header (convenience to include all the public headers) for a framework has the same name as the framework by default, but STHTTPRequest.h is already in use. Rather than make STHTTPRequest.h also serve as the module header by adding conditional declarations of the standard module version globals, I added STHTTPRequestFramework.modulemap to declare STHTTPRequestFramework.h as the framework's umbrella header. (I have no preference as to which way its done - could easily use the other approach.)

Finally, when Carthage checks out a copy of the source tree of to build used framework, it adds a symlink at Carthage/Build in the source tree. I added Carthage/Build added to .gitignore so that if the source tree is added as a submodule (Carthage --use-submodules option), the symlink will not dirty the submodule's git status.

t0rst commented 8 years ago

One extra request: if you accept this pull request, could you also tag the merged commit, such as 1.1.1, so that an app developer's dependency spec (=Cartfile) will pick up the version from which Carthage support is available (Version Requirement)? Its not essential, but it would allow specifying a compatible version in a cartfile, i.e. so that github "nst/STHTTPRequest" ~> 1.1.0 would then work.

nst commented 8 years ago

Even if I'm not a Carthage user, let me thank you for this improvement.

I could build the frameworks flawlessly.

I tagged the merged version as 1.1.1 as requested.