{"id":20846917,"url":"https://github.com/dsappteam/cocoapods-project-hmap","last_synced_at":"2025-05-09T03:19:49.662Z","repository":{"id":53935024,"uuid":"367059485","full_name":"DSAppTeam/cocoapods-project-hmap","owner":"DSAppTeam","description":"A cocoapods plugin to improve the compilation speed of the preprocessing stage.","archived":false,"fork":false,"pushed_at":"2023-04-04T12:18:49.000Z","size":53,"stargazers_count":109,"open_issues_count":3,"forks_count":20,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-05-03T08:44:08.164Z","etag":null,"topics":["cocoapods","cocoapods-plugin","hmap","ios"],"latest_commit_sha":null,"homepage":"","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/DSAppTeam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-05-13T13:35:57.000Z","updated_at":"2025-04-24T02:46:30.000Z","dependencies_parsed_at":"2023-07-12T16:35:47.883Z","dependency_job_id":null,"html_url":"https://github.com/DSAppTeam/cocoapods-project-hmap","commit_stats":null,"previous_names":["chenxgen/cocoapods-project-hmap"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSAppTeam%2Fcocoapods-project-hmap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSAppTeam%2Fcocoapods-project-hmap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSAppTeam%2Fcocoapods-project-hmap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DSAppTeam%2Fcocoapods-project-hmap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DSAppTeam","download_url":"https://codeload.github.com/DSAppTeam/cocoapods-project-hmap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253181611,"owners_count":21867023,"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":["cocoapods","cocoapods-plugin","hmap","ios"],"created_at":"2024-11-18T02:18:27.684Z","updated_at":"2025-05-09T03:19:49.644Z","avatar_url":"https://github.com/DSAppTeam.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cocoapods-project-hmap\n\n此插件思路来源于[《一款可以让大型iOS工程编译速度提升50%的工具》](https://tech.meituan.com/2021/02/25/cocoapods-hmap-prebuilt.html)。通过使用 header map (以下简称 hmap ) 代替文件路径搜索优化预处理阶段中头文件搜索的性能实现编译速度提升。\n\n[English Version](./README_en.md)\n\n## 首先，什么样的项目适合使用这个插件？\n\n- **仅适合使用 objective-c 作为主要开发语言项目**，因为 swift 没有头文件的概念，从其编译原理上看并没有什么帮助；\n\n- **不适合 Podfile 中 开启了 `use_frameworks!` or `use_modular_headers!` 的项目使用**；为了兼容 clang module 特性，采取的策略是不对开启了 DEFINES_MODULE 的项目生成 hmap；\n\n- **不适用于 CPU 为 M1 以及后续 M 系列芯片的 Mac**；因为使用之后提升也很小；\n\n综上，比较适合 old school 的项目使用此插件，如果你的项目满足以上条件推荐使用此插件，不然可能收效甚微，不建议继续往下看了。\n\n## 插件名的由来\n\n最初版本的插件仅仅为了给 Pod Project 和 Host Project 提供一个可行的跨项目 hmap 方案，填补 Xcode 自带的仅支持 Project 内部的 hmap 的空白，由此得名：cocoapods-project-hmap.\n\n## 环境要求\n\n- CocoaPods Version: `\u003e=1.7.0`\n- 安装命令行工具 [hmap](https://github.com/milend/hmap) : `brew install milend/taps/hmap`\n\n## 安装\n\n- 使用Gemfile : 在你的 `Gemfile` 中添加: `gem 'cocoapods-project-hmap'`\n- 通过命令行安装 : `sudo gem install cocoapods-project-hmap`\n\n## 使用\n\n只需要在你的`Podfile`中添加如下行：`plugin 'cocoapods-project-hmap'` 声明使用该插件。\n\n同时插件还为`Podfile`提供了一下几个可选的方法调用：\n\n- **set\\_hmap\\_black\\_pod\\_list:** 如果你有第三方库在使用插件后编译失败，可以尝试把它添加到黑名单中\n\n- **turn\\_prebuilt\\_hmap\\_off\\_for\\_pod\\_targets:** 如果你发现有太多的三方库需要添加到黑名单，你可以直接通过调用这个方法开启“纯净模式”，关闭插件对 Pod Project 内部所有 target 的 header 处理，仅仅对提供给主项目使用的 target 处理 hmap\n\n- **set\\_hmap\\_use\\_strict\\_mode:** 在一个 target 中引用另一个 target 的 header，严格意义上来说应该使用`#import \u003cPodA/Header.h\u003e`的方式，但是有些是通过`#import \"Header.h\"`，这种情况如果设置了对应的 header search path 编译是可以成功的，比如使用原生的 cocoapods 情况下，在项目中使用`#import \"Masonry.h\"`、`#import \u003cMansory.h\u003e`和`#import \u003cMasonry/Mansory.h\u003e`三种方式引入都是可以成功的，如果你使用这个插件并且开启这个选项后只有`#import \u003cMasonry/Mansory.h\u003e`可以编译成功。默认为关闭。\n\n\n最终你的Podfile看起来会是这样的 :\n\n```ruby\nplatform :ios, '10.0'\nplugin 'cocoapods-project-hmap'\nset_hmap_black_pod_list(['PodA','PodB'])\nturn_prebuilt_hmap_off_for_pod_targets\n#set_hmap_use_strict_mode(true)\n\ntarget 'app' do\n  pod 'PodA'\n  ...\n  pod 'PodB'\nend\n```\n\n## 联系方式\n\nQQ: 930565063\n\n## License\n\ncocoapods-project-hmap is released under the MIT license. See LICENSE for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsappteam%2Fcocoapods-project-hmap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsappteam%2Fcocoapods-project-hmap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsappteam%2Fcocoapods-project-hmap/lists"}