Component repository creation
1. Create a remote repository. The code cloud is used as an example
- Create index repository
- Create a component repository (note that THIS is private or open source)
2. Associate the index library with the local
cd ~/.cocoapods/repos
pod repo add GTCompSpec https://gitee.com/guochangzheng/gtcomp-spec.git
Copy the code
3. Create a folder
GTCompTest
Copy the code
4. Save the CD folder to a directory
cd ~/Desktop/GTCompTest
Copy the code
5. Create a local component template
pod lib create GTCompDemo
Copy the code
Once created, a demo project will be opened automatically
- Configure. Podspec files
**6. Add remote component repository **
# add remote warehouse CD ~ / Desktop/GTCompTest/GTCompDemo git remote add origin https://gitee.com/guochangzheng/gtcomp-demo.gitCopy the code
7. Local component library code submission
Git add. # git commit -m =.git commit -m =.git commit -m =.git commit Git push -u origin master git tag '0.1.0' #Copy the code
8. Component library verification
Local validate pod lib lint --use-libraries --allow-warnings Remote validate pod spec Lint --use-libraries --allow-warningsCopy the code
9. Commit the spec file to a local private repository and then push it to a remote repository
Pod repo push [xxxSpec] [XXX]. Podspec --use-libraries --allow-warnings example: pod repo push GTCompSpec GTCompDemo.podspec --use-libraries --allow-warningsCopy the code
10. Check out a private warehouse
Pod Search [XXX] # for example pod Search GTCompDemoCopy the code
The whole process of iOS componentization actual combat ii (Multi-module management)
Got a problem? Six possible solutions to iOS component libraries