CocoaPods ADD Private Spec Repo

Source: Internet
Author: User

Private Pods

CocoaPods is a great tool does not have adding open source code to your project and also for sharing components across pro Jects. You can use a private Spec Repo to does this.

There is a few steps to getting a private pods setup for your project; Creating a private repository for them, letting CocoaPods know where to find it and adding the podspecs to the repository.

<1. Create a Private Spec Repo

To work with your collection of private pods, we suggest creating your own Spec repo. This should was in a location that's accessible to all who'll use the repo.

You don't need to fork the Cocoapods/specs Master repo. Make sure the Everyone on your team have access to this repo, but it does not need to being public.

<2. Add your Private Repo to your CocoaPods installation
$ pod repo add REPO_NAME SOURCE_URL

Note:if you plan on creating pods locally, you should has push access to Source_url

To check if your installation are successful and ready to go:

$ cd ~/.cocoapods/repos/REPO_NAME$ pod repo lint .
<3. Add your podspec to your repo

Make sure "ve tagged and versioned your source appropriately, then run:

$ pod repo push REPO_NAME SPEC_NAME.podspec

This would run pod spec lint , and take care of all the little details for setting up the spec in your private repo.

The structure of your repo should mirror this:

.├── Specs    └── [SPEC_NAME]        └── [VERSION]            └── [SPEC_NAME].podspec
<that ' s it!

Your Private Pod is the ready-to-be used in a podfile. You can use the spec repository with the source directive in your podfile as shown in the following example:

source ‘URL_TO_REPOSITORY‘
<an example<1. Create a Private Spec Repo

Create a repo on your server. This can is achieved on Github or on your own server as follows

$ cd /opt/git$ mkdir Specs.git$ cd Specs.git$ git init --bare

(The rest of this example uses the repo at Https://github.com/artsy/Specs)

<2. Add your repo to your CocoaPods installation

Using the URL of your repo on your server, add your repo using

$ pod repo add artsy-specs [email protected]:artsy/Specs.git

Check your installation is successful and ready to go:

$ cd ~/.cocoapods/repos/artsy-specs$ pod repo lint .
<3. Add your podspec to your repo

Create your Podspec

cd ~/Desktoptouch Artsy+OSSUIFonts.podspec

Artsy+ossuifonts.podspec should is opened in the text editor of your choice. Typical contents is

Pod::Spec.new do |s|  s.name             = "Artsy+OSSUIFonts"  s.version          = "1.1.1"  s.summary          = "The open source fonts for Artsy apps + UIFont categories."  s.homepage         = "https://github.com/artsy/Artsy-OSSUIFonts"  s.license          = ‘Code is MIT, then custom font licenses.‘  s.author           = { "Orta" => "[email protected]" }  s.source           = { :git => "https://github.com/artsy/Artsy-OSSUIFonts.git", :tag => s.version }  s.social_media_url = ‘https://twitter.com/artsy‘  s.platform     = :ios, ‘7.0‘  s.requires_arc = true  s.source_files = ‘Pod/Classes‘  s.resources = ‘Pod/Assets/*‘  s.frameworks = ‘UIKit‘, ‘CoreText‘  s.module_name = ‘Artsy_UIFonts‘end

Save your podspec and add to the repo

pod repo push artsy-specs ~/Desktop/Artsy+OSSUIFonts.podspec

Assuming your podspec validates, it'll be added to the repo. The repo would now look like this

.├── Specs    └── Artsy+OSSUIFonts        └── 1.1.1            └── Artsy+OSSUIFonts.podspec

See this podfile for a example the repo URL is included

pod repo remove [name]

<<external Resources

Frome:https://guides.cocoapods.org/making/private-cocoapods.html

CocoaPods ADD Private Spec Repo

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.