iCepa / Tor.framework

Tor framework for the iCepa project
Other
249 stars 55 forks source link

Add Cocoapods integration #38

Closed sergey-zhuravel closed 5 years ago

sergey-zhuravel commented 6 years ago

Guys, please add Cocoapods integration 🙏 I have a project on Cocoapods and I cannot integrate your framework :(

Thx!

mtigas commented 6 years ago

Ah. @tladesignz: I think when Tor.framework was first being put together it wasn't possible? (Tor has to be built as a static framework and can't be a dynamic library due to the way we compile the already-existing tor binary in, and CocoaPods support for that was iffy, I think. But looks fixed now?)

https://github.com/CocoaPods/CocoaPods/issues/6651

https://github.com/CocoaPods/CocoaPods/issues/6772

https://github.com/CocoaPods/CocoaPods/pull/6811

Maybe. This is just a guess since I'm having trouble remembering.

sergey-zhuravel commented 6 years ago

How can I manually add a framework to a project without using a Carthage? Thx 😉

tladesignz commented 6 years ago

Oh, that's easy: Use a "Workspace" for your project. If you're using CocoaPods in your project, you're already doing that. If not, create one with File -> New -> Workspace....

Drag and drop the Tor.framework's Tor.xcodeproj folder into your workspace, next to your app' and the Pods project in the "Project navigator" side panel of Xcode.

sergey-zhuravel commented 6 years ago

@tladesignz I already tried and always get the following error: ld: framework not found Tor clang: error: linker command failed with exit code 1 (use -v to see invocation)

tladesignz commented 6 years ago

Ah. You also need to drag-and-drop the Tor.framework file found in the Products folder of the Tor.framework project into your app's Linked Frameworks and Libraries section in the General tab of all targets you want to use it in. (The huge configuration form you get, when you click on the project root in the project navigator.)

sergey-zhuravel commented 6 years ago

@tladesignz do you have an example of such a project on Swift? since I get various file linking errors

Thx! 🙏

tladesignz commented 6 years ago

Unfortunately not. I use that technique when I develop on OnionBrowser and Tor.framework simultaniously... You can run Carthage and CocoaPods alongside, though. It's annoying, but you'll get over it... ;-)

MeGaPk commented 6 years ago

I have experience with cocoapods and just build via carthage, upload framework and dsym in zip and release podspec.

Example: https://github.com/ss-abramchuk/OpenVPNAdapter/issues/78

MeGaPk commented 6 years ago

@tladesignz @mtigas Example .travis https://github.com/MeGaPk/OpenVPNAdapter/blob/v0.0.12/.travis.yml Example .podspec https://github.com/MeGaPk/OpenVPNAdapter/blob/v0.0.12/OpenVPNAdapter.podspec_template

script for pushing tags: https://github.com/MeGaPk/OpenVPNAdapter/blob/v0.0.12/push_build_version.sh