• Stars
    star
    105
  • Rank 316,796 (Top 7 %)
  • Language
    Ruby
  • License
    MIT License
  • Created almost 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A cocoapods plugin to improve the compilation speed of the preprocessing stage.

cocoapods-project-hmap

此插件思路来源于《一款可以让大型iOS工程编译速度提升50%的工具》。通过使用 header map (以下简称 hmap ) 代替文件路径搜索优化预处理阶段中头文件搜索的性能实现编译速度提升。

English Version

首先,什么样的项目适合使用这个插件?

  • 仅适合使用 objective-c 作为主要开发语言项目,因为 swift 没有头文件的概念,从其编译原理上看并没有什么帮助;

  • 不适合 Podfile 中 开启了 use_frameworks! or use_modular_headers! 的项目使用;为了兼容 clang module 特性,采取的策略是不对开启了 DEFINES_MODULE 的项目生成 hmap;

  • 不适用于 CPU 为 M1 以及后续 M 系列芯片的 Mac;因为使用之后提升也很小;

综上,比较适合 old school 的项目使用此插件,如果你的项目满足以上条件推荐使用此插件,不然可能收效甚微,不建议继续往下看了。

插件名的由来

最初版本的插件仅仅为了给 Pod Project 和 Host Project 提供一个可行的跨项目 hmap 方案,填补 Xcode 自带的仅支持 Project 内部的 hmap 的空白,由此得名:cocoapods-project-hmap.

环境要求

  • CocoaPods Version: >=1.7.0
  • 安装命令行工具 hmap : brew install milend/taps/hmap

安装

  • 使用Gemfile : 在你的 Gemfile 中添加: gem 'cocoapods-project-hmap'
  • 通过命令行安装 : sudo gem install cocoapods-project-hmap

使用

只需要在你的Podfile中添加如下行:plugin 'cocoapods-project-hmap' 声明使用该插件。

同时插件还为Podfile提供了一下几个可选的方法调用:

  • set_hmap_black_pod_list: 如果你有第三方库在使用插件后编译失败,可以尝试把它添加到黑名单中

  • turn_prebuilt_hmap_off_for_pod_targets: 如果你发现有太多的三方库需要添加到黑名单,你可以直接通过调用这个方法开启“纯净模式”,关闭插件对 Pod Project 内部所有 target 的 header 处理,仅仅对提供给主项目使用的 target 处理 hmap

  • set_hmap_use_strict_mode: 在一个 target 中引用另一个 target 的 header,严格意义上来说应该使用#import <PodA/Header.h>的方式,但是有些是通过#import "Header.h",这种情况如果设置了对应的 header search path 编译是可以成功的,比如使用原生的 cocoapods 情况下,在项目中使用#import "Masonry.h"#import <Mansory.h>#import <Masonry/Mansory.h>三种方式引入都是可以成功的,如果你使用这个插件并且开启这个选项后只有#import <Masonry/Mansory.h>可以编译成功。默认为关闭。

最终你的Podfile看起来会是这样的 :

platform :ios, '10.0'
plugin 'cocoapods-project-hmap'
set_hmap_black_pod_list(['PodA','PodB'])
turn_prebuilt_hmap_off_for_pod_targets
#set_hmap_use_strict_mode(true)

target 'app' do
  pod 'PodA'
  ...
  pod 'PodB'
end

联系方式

QQ: 930565063

License

cocoapods-project-hmap is released under the MIT license. See LICENSE for details.

More Repositories

1

PanelSwitchHelper

✔️ A framework that helps the keyboard smoothly transition to the function panel 一个帮助键盘平稳过渡到功能面板的框架,支持动画无缝衔接,支持 activity/fragment/dialog/dialogFragment/popupWindow 容器,支持IM/直播/视频播放/信息流评论等场景,支持全屏模式。
Java
2,313
star
2

Anchors

✅ Anchors 是一个基于图结构,支持同异步依赖任务初始化 Android 启动框架。其锚点提供 "勾住" 依赖的功能,能灵活解决初始化过程中复杂的同步问题。参考 alpha 并改进其部分细节, 更贴合 Android 启动的场景, 同时支持优化依赖初始化流程, 自动选择较优的路径进行初始化。
Java
800
star
3

ComponentCornerstone

🐜🐜 一种全新的android组件化方案,无需下沉公用代码,无需采用路由等硬编码方式分发sdk,独立维护组件暴露的SDK/IMPL,打破官方模块循环且支持组件间互相调用SDK,支持集成组件调试/组件独立运行。A brand new android componentization solution, no need to sink public code, no need to use hard coding to distribute sdk, independent maintenance component exposed SDK / IMPL, break the official module loop and support the call between components The SDK supports integrated component debugging/components to run independently.
Groovy
251
star
4

RecyclerViewDrag

✅ 基于RecyclerView实现的可拖拽/合并交互,比如顺序改变/合并成文件夹等
Kotlin
31
star
5

DSPermission

一款支持注入权限使用说明的权限申请库,基于RxPermission
Kotlin
12
star
6

ComponentCore

Component Plugin Core Lib, see https://github.com/DSAppTeam/ComponentCornerstone
Kotlin
1
star