This process requires you to create 2 git repositories.
-
pod-specs
repo 1.1 This repo holds the specs for all the private pods. 1.2 You only have to create this once per organization (assuming your private pods are limited to an organization) -
Library repo 2.1 This repo contains the code of the component/library that you need to reuse and import in other projects using
pod install
2.2 You will create one such repo for every component you need to access
Refer this gist There are cases when you want to create pods only for beter organizing the components and libraries and still want them to be part of the same code base as your main project.
In such cases you need not create a Library repo.
If this is not the first private pod in your organization, skip this step.
- Create pod-spec repository in your org git (github/gitlab/bitbucket)
- In your computer map this repo to a spec using following command
$ pod repo add microsoft-specs https://gitlab.com/ios-components/microsoft-specs
If you are using private pods as part of main code base, skip this step.
- In your git tool go ahead and create a new repo.
There are 2 ways you can prepare a repo to be used in pods.
- This will create a new project with a standard folder structure.
- I personally like to use my own folder structre and avoid this technique.
OR
$ touch Alerts.podspec
$ open -a atom Alerts.podspec # you can choose your favorite text editor here
- Ensure that the version mentioned in the podspec file and the tag you create are same
$ git tag 0.0.1
$ git push --tags
-
locally: -- using
pod lib lint
-
ovarall -- using
pod repo lint
Note that you will repeat step 3, 4, 5 everytime you need to update your pods
You can publish the updates using following command
$ pod repo push microsoft-specs Alerts.podspec --allow-warnings
Done