How to set up the pods of the multi-engineering binder(2014-07-17 13:57:10)
reproduced
Tags: united Multi-Project |
Category: iOS development |
Today, Cocoapods is used more and more, and almost every project will be used. Sometimes our project may be composed of several modules, each module can be used as a separate project, and then all the works are for the main project use, this is the multi-engineering, how to use the pods podfile to achieve this function, the following will provide you with this case Podfile writing:
Workspace ' Myworkspace '
Xcodeproj ' Myapp/myapp.xcodeproj '
Xcodeproj ' Mysdk1/mysdk1.xcodeproj '
Xcodeproj ' Mysdk2/mysdk2.xcodeproj '
Target:myapp do
Platform:ios, ' 6.0 '
Pod ' afnetworking ', ' ~> 2.1.0 '
Pod ' sdwebimage ', ' ~> 3.4 '
Pod ' flurrysdk ', ' ~> 5.0.0 '
Xcodeproj ' Myapp/myapp.xcodeproj '
End
Target:mysdk1 do
Platform:ios, ' 6.0 '
Pod ' afnetworking ', ' ~> 2.1.0 '
Pod ' sdwebimage ', ' ~> 3.4 '
Pod ' flurrysdk ', ' ~> 5.0.0 '
Xcodeproj ' Mysdk1/mysdk1.xcodeproj '
End
TARGET:MYSDK2 do
Platform:ios, ' 6.0 '
Pod ' afnetworking ', ' ~> 2.1.0 '
Pod ' sdwebimage ', ' ~> 3.4 '
Xcodeproj ' Mysdk2/mysdk2.xcodeproj '
End
1. Specify the workspace file name
2. Declare the relative path of the project files that need to be included in all projects
3. Specify which target in the project needs to use the PODS function. A project may have multiple target, not all target requires pods third-party libraries, so choose as needed.
4. Specify iOS version, need to import third-party library (there are many ways to write here, not detailed here, you can go here to see, more detailed:http://guides.cocoapods.org/syntax/podfile.html#xcodeproj)
The premise is that in a directory, the need to build the project, and then in each project peer directory built podfile, finally into the Podfile directory, execute pod install, pods will help us generate Myworkspace file, Open the Myworkspace file with Xcode, all the projects have been imported, set up the reference relationship between the projects, you can start to develop.
Directory structure:
MyApp
Myworkspace.xcworkspace
MyApp
MySDK1
MySDK2
Pods
Podfile
Podfile.lock
How to set up the pods of the multi-engineering binder