- You have broken your app into custom frameworks (reusable features)
- Integrated these private frameworks manually.
- Integrated these private frameworks using Custom Scripts
- You want to move them to private
cocoapods
but don't want to create privatee repositories - You don't mind keeping (organizing) the frameworks in the main project
In your project's root, create a folder name Dependencies
and move all your frmeworks' folders inside that.
So you have one place where all your internal dependencies are stored.
Undo whatever you have done to use your frmeworks in your app manually. This could require you to
- remove the post archive scripts from Your Frameworks' schemes
- remove Your Frameworks form main app's embedded binaries
- remoe the path to Your Framework from
App Target > Build Phases > Copy Run Path
- Etc
By deafault when you create private pods, you need to supply the git url for your framework. We will go a different route.
In your Podfile, you can specify where do you want to pick that pod from. By default, it is cocoapod/specs.git repo, in addition to this you can specify more "Sources" (on top of your Podfile.
In some cases you don't want to specify an external source for your pods as it is part of your main project code-base. You can simply specify the :path =>
arguments to the pod <PodName>
in your Podfile
eg:
pod 'HelpAndSupportFramework', :path => './Dependencies/HelpAndSupportFramework/'
$ cd ./Dependencies
$ cd HelpAndSupportFramework
pod spec create HelpAndSupportFramework
Now you have private cocoapods for your internal dependencies. All you need to do is to update the .podspecfile
Pod::Spec.new do |s|
s.name = "HelpAndSupportFramework"
s.version = "1.0.0"
s.summary = "HelpAndSupportFramework is a reusable library that allows you to integrate FAQ in the app ."
s.description = "HelpAndSupportFramework is a reusable library that allows you to integrate FAQ in the app ."
s.homepage = "http://www.gauravkeshre.com"
s.license = "Copyright Gaurav pvt. ltd."
s.author = { "Gaurav Keshre" => "[email protected]" }
s.platform = :ios, "9.0"
s.source = { :git => "GIT HUB URL PATH TO YOUR FRAMEWORK PROJECT", :tag => "#{s.version}" }
s.source_files = "Classes", "HelpAndSupportFramework/**/*.swift"
s.exclude_files = "Classes/Exclude"
end
In your Podfile
...
def private_pods
pod 'HelpAndSupportFramework', :path => './Dependencies/HelpAndSupportFramework/'
end
target "YourAppTarget" do
...
private_pods
end
initial commit