duemunk / Async

Syntactic sugar in Swift for asynchronous dispatches in Grand Central Dispatch
MIT License
4.59k stars 316 forks source link

Adding dynamic framework target for Async #15

Closed mowens closed 9 years ago

mowens commented 9 years ago

Adding a dynamic framework target for better linking into swift projects.

Now that iOS8 supports dynamic frameworks, this is the ideal way to link in Swift projects. This is not yet supported by Cocoapods, however a PR for Swift frameworks exists.

The following adds:

To dynamic link against the new framework, follow the instructions here, but reference to Async.framework instead

duemunk commented 9 years ago

Thank you @mowens! This definitely looks interesting. Being quite busy, I hope to look at this over the holidays.

As for the unit test, you have to run them on an iOS device :)

mowens commented 9 years ago

Ah makes sense for the unit tests :)

it also might be worth refactoring the repo a bit. Instead of having the AsyncExample project, we could make new targets under the Async project (basically move the example code to the Async project). This way there is 1 uniform xcode project that builds the framework and sample projects.

duemunk commented 9 years ago

@mowens I'm working on using CocoaPods for integrating Async in Xcode. Do you think there is still a need for target to build a framework "manually"?

duemunk commented 9 years ago

Or maybe add the support with https://github.com/Carthage/Carthage?

mowens commented 9 years ago

Cocoa pods will support swift (and thus dynamic frameworks) with 0.36 which there is a lot of activity on the cocoa pods github.

Carthage looks interesting. You will still need a separate target for carthage as it uses xcodebuild and this will require a schema to build.

I don't see why we could leverage both pods (when supported) and Carthage to give users the option. IMHO the best integration route would be to:

  1. Merge the AsyncExample project and Async project into a single
  2. Provide a framework and example schemes there
  3. Add support for the dep managament tools
ksmandersen commented 9 years ago

I think it would be a great idea to add support for Carthage

mowens commented 9 years ago

Adding Carthage support requires the async Xcode project to build a framework (this PR) as carthage is a wrapper on git and xcodebuild

Additionally CocoaPods has release swift beta support with 0.36.0.beta.1 and the current asyc pod spec works like a charm :)

ksmandersen commented 9 years ago

Adding Carthage support requires the async Xcode project to build a framework (this PR) as carthage is a wrapper on git and xcodebuild

You already did this as part of the Pull Request. The only thing left to do here is to set the scheme in the xcode project as shared (checking the checkbox in the screenshot below)

duemunk commented 9 years ago

I no I'm late to the game, but is this necessary anymore now that CocoaPods supports Swift? Please just reopen if necessary.

I haven't looked at the Carthage part.

@mowens @ksmandersen