how to link my svn library using cocoapods? - ios

I am new to manage library dependencies in Objective-C projects.
I need to know how to link a library in my svn.
link :svn://ibrahim#svn.xxxx.info/development/iOS/myFoundation/here_Are_the_.{h/m}'
I only know how Specifies a dependency of the projects on Github.
Ex from Terminal :
1-open -e Podfile
2-dependency 'ASIHTTPRequest'
3-pod install myproj.xcodeproj/
Any idea for svn will be great.

Related

Swift and Xcode: How to Build and Run a GitHub repository of iOS Application?

I'm interested on Running this GitHub repository of an iOS Application: https://github.com/septadev/SEPTA-iOS I opened the iSEPTA.xcodeproj file on XCode from the iSEPTA folder, but I'm getting these Buildtime Errors. For example: No such module 'ReSwift', and this is the window I get prompted when I select any of the yellow alerts, I'm not sure if I should perform these changes, yet.
Could it be some incomparability with my XCode and Swift versions?
Please, help!!
This project uses Carthage as a dependency management system for using external dependencies.
You should install Carthage to your computer and then run carthage update from the terminal in the root directory of the project. This will instal the dependencies and will allow you to run the project.
Take a look at Cartfile: it indicates this repo is using Carthage package manager. Follow their instructions to install dependent libraries
This repository requires Carthage ( https://github.com/Carthage/Carthage ) - this is a dependency manager. You can install it using Homebrew (https://brew.sh/)
brew install carthage
then you have to run carthageBuild.sh script (which runs carthage update):
./carthageBuild.sh
and then you have to open: Septa.xcworkspace file
This would be the correct solution if the project used Cocoapods. Since it uses Carthage, look to others answers unless you are referencing this answer to a similar issue.
You need to use Cocoapods to integrate the pods attached to the project. Often times projects will not come with them precompiled. Either you opened the blue project file with the *.xcodeproj extension instead of the white project file with the *.xcworkspace extension.... or you don't have the pods installed at all. In which case read below.
Instructions as follows:
cd to project directory
Install Cocoapods
sudo gem install cocoapods
Ensure the you have the given pods in your repo collection for install
pod repo update
Install the pods
pod install
Validate Project Settings
This is necessary until cocoapods v1.6 release (beta is out).
Open the white project file with the *.xcworkspace extension
After those steps are complete, the project should run normally.

iOS : How to generate a .framework file from a GitHub project

There is a Swift project on GitHub that I want to include in my iOS app.
In my iOS app, I use Carthage. But the GitHub project is not compatible with Carthage (only with Cocoapods), so I need to include the .framework file in my project manually.
How can I generate the .framework file without Carthage?
Building the framework is not always the same across projects. That being said, there should be a target available when you open the project to make the framework build. It should look something like this.
After clicking run the framework is usually output to the products directory.
If this doesn't work for you with this project then maybe you could share a link to the github page for the project and I could provide more instruction.
Fork Project
Change scheme to shared in scheme management (more information on Carthage docs)
Add your fork to your Cartfile
You can stop here but I highly recommend do this after:
Update README with information about Carthage support
Make a pull request

How to install a development Framework in MacOS for commandline build

I have an iOS application that needs to be integrated into CI/CD pipeline in CircleCI. Most of my dependencies have been added using CocoPods. There is one particular dependency of OpenCV2 that is manually compiled and used. On the local development machine, It is simple to use with drag & drop in Xcode. But, while running the build on a CI server. We don't have access to GUI and need to link dependency from the command line. I have not found much of the resources dealing with this issue.
I have tried few options from this link
https://developer.apple.com/library/content/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/InstallingFrameworks.html
The framework that I am trying to use is compiled and zipped in an archive (opencv2.framework.zip and uploaded on Amazon S3. It is because the compiled framework is about 300 MB in size. So, I can't push it to the source repository. So, I download it using curl and unzip on CI machine. I have tried unzipping it to
/System/Library/Frameworks
/Library/Frameworks
~/Library/Frameworks
gym --scheme "project" --workspace "project.xcworkspace"
None of them really worked.I would like a way to register this framework in the system so that linker can find it while linking.
Suggest a way to extract framework into a location which linker can automatically look into.
Suggest a way where I can link framework manually from command line build
I have never used OpenCV but a quick pod search gives this result, so looks like they are already supporting cocoapods.....
pod search opencv
-> OpenCV2 (3.2.0)
OpenCV (Computer Vision) for iOS.
pod 'OpenCV2', '~> 3.2.0'
- Homepage: http://opencv.org
- Source: http://github.com/bcomeau/opencv/releases/download/3.2.0/opencv-3.2.0-ios-framework.zip
- Versions: 3.2.0 [master repo]
Second:
You can use Carthage https://github.com/Carthage/Carthage
You can use both Cocoapods and Carthage at the same time as long as they are not downloading the same dependencies.
Create a private repo, follow the carthage tutorial for uploading frameworks https://github.com/Carthage/Carthage#supporting-carthage-for-your-framework
then put opencv2 to your repo.
Then add your repo to your cartfile
Then before or after you install cocoapods, install carthage frameworks too.
It is a bit work but can solve your problem.
Third:
Looks like they also support Carthage
https://github.com/card-io/card.io-iOS-source/issues/32
Look at the last couple of comments..

Git: Libraries hosted in a remote repository?

I'm working in a project that has a few libraries that seem to be in a remote repository. For example:
When I clone the project, all of the libraries with that icon are missing. Is there another command I need to execute to download them?
For reference, this is an iOS project and these are Objective C libraries.
Generally third party libraries are added in project via CocoaPods or git submodules.
If your project using CocoaPods then you will find a podfile inside project directory, open terminal and navigate to directory contain podfile and then type in this command pod install to checkout all libraries, it will create a workspace, once you have workspace open that project via workspace always.
If other libraries are added as submodule then you can checkout using git submodule update --init.
My guess is that they are submodules of the repository you're clonning. Try adding the --recursive option to the clone command.

Working with git submodules/cocoapods

I am working on a project which includes other repositories from Git.
I would like to keep up to date with these repositories. Know what are the latest features, bug fixes etc.
Qu 1) What is the best way to keep up to date with a repository on Git without receiving emails of all issues reported etc?
After this is complete I would like to know the best way to include these into your project. I understand you can copy the source code into the project, but what are cocoapods/sub modules used for? For example, what is the correct way to update your project with the latest changes to that included repository?
Are there any GUIs for either of these methods as opposed to terminal?
Cocoapods is a great way to include other projects in your Xcode project. The Cocoapods project maintains a list of pod spec files for a many open source libraries, which specify where to download the code and how to integrate them into an existing project. As you noted, you'd traditionally have to add a git submodule, manually add the source files to your project, update your build settings, and so forth. Cocoapods takes care of all of this for you.
I'm not sure of a way to track updates for Github projects without also being notified about issues, but Cocoapods can certainly tell you if any of your 'pods' have become outdated. It's then one command to update them to the latest versions. That said, it's generally best practice to 'lock' your external dependencies to a specific version that you know works correctly.
Using Cocoapods
To get started, first install Cocoapods. You then simply need to create a file in your root project directory (the same directory that contains your .xcodeproj file) called Podfile. Inside, you can specify your target OS, and your dependencies:
platform :ios, '5.0'
pod 'AFNetworking', '0.9.1'
pod 'OHAttributedLabel', '0.1.1'
The example above is targeting iOS 5.0, and pulling in the AFNetworking and OHAttributedLabel projects.
Then, in the Terminal, change to your project directory:
> cd path/to/my/project
And run pod install.
> pod install
This will check out the latest version of your dependencies for you. It will also generate you a .xcworkspace file. From now on, when you work on your project, you must open the .xcworkspace, not the .xcodeproj file.
Inside your new workspace, you'll have your existing Xcode project and a new Pods project - this contains all of your third party libraries. Just build and run your app as normal, and the Pods project will also be built and included.
Some other useful Cocoapods commands:
> pod outdated
Will list all dependencies that have an update available.
> pod search query
Will search all known Pod specs for 'query'. Useful for finding new libraries!
Tutorials
Looks like Tutsplus have a nice tutorial on getting started with Cocoapods
There's a free episode of NSScreencast on Cocoapods
GUIs
I'm afraid I don't know of any GUIs for Cocoapods, but there really aren't many Terminal commands that you need to know. It's worth getting comfortable with the command line, as it's such a useful developer tool.
That said, as far as I know, Appcode (Jetbrains' alternative IDE for Objective-C) is planning on adding Cocoapods support in their next update.
Good luck!
James Frost's answer is an excellent explanation of how to work with Cocoapods and their advantages over submodules.
A few important advantages submodules have over Cocoapods are:
submodules are sub-repos - not only does this mean that git and git GUIs implicitly recognize them and more and more support easily working with them, it also means that your dependencies stay connected the wonderful world their git repos, Cocoapods or not, reside in. This means that you are able to collaborate and test changes from within your project, your project usually being the source of inspiration for elaboration of a dependency.
Unfortunately Cocoapods do not maintain this link, to work on a dependency means to clone it from git, outside of the range of Cocoapods.
Edit: It's worth noting that Cocoapods does allow working on a local pod with the path or local fields or even building your own Spec repo but it still isn't as simple a process.
one less tool dependency - as mentioned in the previous bullet, submodules are a function of git and your using git means they are available to you. Any software's adoption of git implies that they will eventually support either all (important) features of git or all features that cover common use cases. Xcode 5 has brought in a basic support for git and GUIs (which are tool dependencies, it's true, but hopefully just dictate how information is surface, git dictates how it works) like Git Tower make working with sub-repos straightforward.
Cocoapods has come a long way and everyday is taking steps to becoming a stable, indispensable tool. However it hasn't yet gotten a nod from Apple and there isn't any reason why Apple won't release a change to Xcode that breaks Cocoapods. Additionally Cocoapods is dependant on Ruby. Aside, considering how much attention and community has been generated around Cocoapods it would be silly for Apple to ignore it.
It's also worth noting that using one does not lock you out of using the other. It might be a headache or it might be what you need, perhaps using Cocoapods for tiny one class libraries or libraries with complex dependancies and submodules for libraries with that you will be interacting with often.

Resources