{"id":13902990,"url":"https://github.com/grab/cocoapods-binary-cache","last_synced_at":"2025-05-15T20:07:37.665Z","repository":{"id":41398868,"uuid":"232280554","full_name":"grab/cocoapods-binary-cache","owner":"grab","description":null,"archived":false,"fork":false,"pushed_at":"2023-06-23T20:22:09.000Z","size":1750,"stargazers_count":483,"open_issues_count":35,"forks_count":70,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-05-08T20:58:46.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/grab.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2020-01-07T08:37:42.000Z","updated_at":"2025-04-15T01:22:26.000Z","dependencies_parsed_at":"2024-01-19T10:14:52.977Z","dependency_job_id":"bd1825fd-28cd-4e3a-ae28-3711a6ffe114","html_url":"https://github.com/grab/cocoapods-binary-cache","commit_stats":{"total_commits":283,"total_committers":12,"mean_commits":"23.583333333333332","dds":"0.39575971731448767","last_synced_commit":"f85630964fa5fde96239fe97a769e4c3160e443d"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fcocoapods-binary-cache","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fcocoapods-binary-cache/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fcocoapods-binary-cache/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/grab%2Fcocoapods-binary-cache/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/grab","download_url":"https://codeload.github.com/grab/cocoapods-binary-cache/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254414501,"owners_count":22067272,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-06T22:01:32.693Z","updated_at":"2025-05-15T20:07:32.602Z","avatar_url":"https://github.com/grab.png","language":"Ruby","funding_links":[],"categories":["Ruby"],"sub_categories":[],"readme":"# CocoaPods binary cache\n\n[![Test](https://img.shields.io/github/workflow/status/grab/cocoapods-binary-cache/test)](https://img.shields.io/github/workflow/status/grab/cocoapods-binary-cache/test)\n[![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat\u0026color=blue)](https://github.com/grab/cocoapods-binary-cache/blob/master/LICENSE)\n[![Gem](https://img.shields.io/gem/v/cocoapods-binary-cache.svg?style=flat\u0026color=blue)](https://rubygems.org/gems/cocoapods-binary-cache)\n\nA plugin that helps to reduce the build time of Xcode projects which use CocoaPods by prebuilding pod frameworks and cache them in a remote repository to share across multiple machines.\n\n## Installation\n\nRequirements\n\n- Ruby: \u003e= 2.4\n- CocoaPods: \u003e= 1.5.0\n\n### Via [Bundler](https://bundler.io/)\n\nAdd the gem `cocoapods-binary-cache` to the `Gemfile` of your project.\n\n```rb\ngem \"cocoapods-binary-cache\", :git =\u003e \"https://github.com/grab/cocoapods-binary-cache.git\", :tag =\u003e \"0.1.11\"\n```\n\nThen, run `bundle install` to install the added gem.\n\nIn case you're not familiar with [`bundler`](https://bundler.io/), take a look at [Learn how to set it up here](https://www.mokacoding.com/blog/ruby-for-ios-developers-bundler/).\n\n### Via [RubyGems](https://rubygems.org/)\n\n```sh\n$ gem install cocoapods-binary-cache\n```\n\n## How it works\n\nCheck out the [documentation on how it works](/docs/how_it_works.md) for more information.\n\n## Usage\n\n### 1. Configure cache repo\n\nFirst of all, create a git repo that will be used as a storage of your prebuilt frameworks. Make sure this git repo is accessible via `git clone` and `git fetch`. Specify this cache repo in the following section.\n\n### 2. Configure Podfile\n\n**2.1. Load the `cocoapods-binary-cache` plugin.**\n\nAdd the following line at the beginning of Podfile:\n\n```rb\nplugin \"cocoapods-binary-cache\"\n```\n\n**2.2. Configure `cocoapods-binary-cache`**\n\n```rb\nconfig_cocoapods_binary_cache(\n  cache_repo: {\n    \"default\" =\u003e {\n      \"remote\" =\u003e \"git@cache_repo.git\",\n      \"local\" =\u003e \"~/.cocoapods-binary-cache/prebuilt-frameworks\"\n    }\n  },\n  prebuild_config: \"Debug\"\n)\n```\nFor details about options to use with the `config_cocoapods_binary_cache` function, check out [our guidelines on how to configure `cocoapods-binary-cache`](/docs/configure_cocoapods_binary_cache.md).\n\n**2.3. Declare pods as prebuilt pods**\n\nTo declare a pod as a prebuilt pod (sometimes referred to as *binary pod*), add the option `:binary =\u003e true` as follows:\n```rb\npod \"Alamofire\", \"5.2.1\", :binary =\u003e true\n```\n\nNOTE:\n\n- Dependencies of a prebuilt pod will be automatically treated as prebuilt pods.\\\nFor example, if `RxCocoa` is declared as a prebuilt pod using the `:binary =\u003e true` option, then `RxSwift`, one of its dependencies, is also treated as a prebuilt pod.\n\n### 3. CLI\n\nWe provided some command line interfaces (CLI):\n\n- Fetch from cache repo\n```sh\n$ bundle exec pod binary fetch\n```\n- Prebuild binary pods\n```sh\n$ bundle exec pod binary prebuild [--push]\n```\n- Push the prebuilt pods to the cache repo\n```sh\n$ bundle exec pod binary push\n```\n\nFor each command, you can run with option `--help` for more details about how to use each:\n```sh\n$ bundle exec pod binary fetch --help\n```\n\n### 4. A trivial workflow\n\nA trivial workflow when using this plugin is to fetch from cache repo, followed by a pod installation, as follows:\n\n```sh\n$ bundle exec pod binary fetch\n$ bundle exec pod install\n```\n\nFor other usages, check out the [best practices docs](/docs/best_practices.md).\n\n## Benchmark\n\nWe created a project to benchmark how much of the improvements we gain from this plugin. The demo project is using the following pods:\n\n```\nAFNetworking\nSDWebImage\nAlamofire\nMBProgressHUD\nMasonry\nSwiftyJSON\nSVProgressHUD\nMJRefresh\nCocoaLumberjack\nRealm\nSnapKit\nKingfisher\n```\n\nBelow is the result we recorded:\n\n\u003cimg src=resources/benchmark.png width=700\u003e\u003c/img\u003e\n\nHardware specs of the above benchmark:\n```\nMacBook Pro (15-inch, 2018)\nMac OS 10.14.6\nProcessor 2.6 GHz Intel Core i7\nMemory 16 GB 2400 MHz DDR4\n```\n\nYou can also try it out on your local:\n```sh\n$ cd PodBinaryCacheExample\n$ sh BuildBenchMark.sh\n```\n\nIn our real project with around 15% of swift/ObjC code from vendor pods. After applying this technique, we notice a reduction of around 10% in build time.\n\u003cimg src=resources/realproj_buildtime_trend.png width=700\u003e\u003c/img\u003e\n\n## Known issues and roadmap\n\n### Exporting IPA with Bitcode\n- When exporting an IPA with Bitcode, remember to disable the _rebuild from bitcode_ option. Refer to https://github.com/grab/cocoapods-binary-cache/issues/24.\n\n### Pods with headers only\n- By default, pods with empty sources (ie. pods with header files only) will be automatically excluded and they will be later integrated as normal. For now, we rely on the `source_files` patterns declared in podspec to heuristically detect empty-sources pods.\n- However, there are cases in which the `source_files` of a pod looks like non-empty sources (ex. `s.source_files = \"**/*.{c,h,m,mm,cpp}\"`) despite having header files only. For those cases, you need to manually add them to the `excluded_pods` option.\n\n## Best practices\n\nCheck out our [Best practices](/docs/best_practices.md) for for information.\n\n## Troubleshooting\n\nCheck out our [Troubleshooting guidelines](/docs/troubleshooting_guidelines.md) for more information.\n\n## Contribution\n\nCheck out [CONTRIBUTING.md](CONTRIBUTING.md) for more information on hw to contribute to this repo.\n\n## License\n\nThe cocoapods-binary-cache plugin is available as open-source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\nIt uses [cocoapods-rome](https://github.com/CocoaPods/Rome) and [cocoapods-binary](https://github.com/leavez/cocoapods-binary) internally, which are also under MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrab%2Fcocoapods-binary-cache","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgrab%2Fcocoapods-binary-cache","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgrab%2Fcocoapods-binary-cache/lists"}