Converting CocoaPods dependencies
This document provides high-level guidelines for converting CocoaPods dependencies to Bazel packages that are compatible with Tulsi. CocoaPods is a third-party dependency management system for Apple application development.
Note: CocoaPods conversion is a manual process with many variables. CocoaPods integration with Bazel has not been fully verified and is not officially supported.
Analyze your CocoaPods dependencies
If you’re using CocoaPods, you need to:
-
Examine the
Podfilefiles to determine the hierarchy of thePodspecs. -
Take note of the version numbers in the corresponding
Podfile.lockfiles to ensure that you are pulling the correctPodspecs. -
Document the dependency tree, including the hierarchy of the
Podspecs, resource URLs, filenames, and version numbers.
Converting a Podspec to a Bazel package
To convert a Podspec dependency to a Bazel package, do the following:
-
Download each
Podspecand decompress it into its own directory within the Bazel workspace. AllPodspecs must reside within the same Bazel workspace for Tulsi to be aware of them for inclusion in the Xcode project. -
Within the
Podspecdirectory, create aBUILDfile that specifies the library target(s) referencing the source and header files on which your project depends. -
Based on your project’s dependency tree, add the
Podspecs target(s) as dependencies to the appropriate targets in the project’sBUILDfile(s). -
In the project’s
BUILDfiles, configure package visibility as desired.