lg_pod_plugin 1.1.5.3 → 1.1.5.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 612ab757a2dda325c65ee1be76b2c36f041e742cbc73137b7600daeb6f8a27a3
4
- data.tar.gz: e9eb84aa2b66b88c57c4307ecdc8bc94e4441d15bb643342d441bb04c5f57dc1
3
+ metadata.gz: 9dc774281777ef46e7cc81e7ff30f7a93e18ae04129751b81b4ea04fc18d3379
4
+ data.tar.gz: b96fcdddf2b4626d017cb4423d3c78c4466dc16c820defb328c10fa4b483b66e
5
5
  SHA512:
6
- metadata.gz: 60962ccf4a99c7a4f85e9fe1aa1d2ad6f99133904b3ab60a5fef9003e0f5c253710000b7cc41d78a1ebb92fd8abd95edab71d5a7a329ddb026fa9cba56cc7b4b
7
- data.tar.gz: f18f82873e111af8574c1bd9b4c032aab708bc019e438d2fdec3c3ebc92417aa9170999bd59b77fd20a4a52fb9a59a29b6eea4550c913f662922eef8b57aff64
6
+ metadata.gz: 1e4ae04607de46d6517d58872e99ceec33fb57247c4d385f91cc27ba4569487ca2773ab7559fb98e27f67d2cdfc6bfba5cc655ea3b856fc08c6a11eef70e1bd3
7
+ data.tar.gz: 383a46acfe72e63c85502067208047c310d6969609aa3c3cc6f2c5c1aa1f82c82a61614b69e69425f586427c73386446e2b935940c839063c7639c4d1a07fc36
data/README.md CHANGED
@@ -1,45 +1,174 @@
1
- 安装和使用教程: https://juejin.cn/post/7142388587852464135
2
- # LgPodPlugin
1
+ 猛一看有点标题党意思, 说十倍提升有点夸张, 5-9 倍提升还是可以做到的.下边便是小编精心打磨 3 个月之久的 `lg_pod_plugin` ruby gem介绍部分
2
+ # 特点
3
+ 1. ###### 无入侵、无感知、不影响现有业务,不影响现有代码框架、完全绿色产品
4
+ 2. ###### 轻量级,只要工程 pod install | update 正常安装就能用
5
+ 3. ###### 完全自动化, 一键使用、快的吓人
6
+ 4. ###### 一步步教你使用,新手也能欢乐玩转
7
+ 5. ###### 支持GitHub仓库下载提速, GitLab仓库支持 HTTP 下载, 下载速度更快, 节省流量.
8
+ 6. ###### 没有pod 更新时速度优于 pod install | update, 当有Pod更新时速度至少是原来都 5 倍, 最高是 pod install 9 倍速度.
9
+ 7. ###### 支持多线程并发下载, 是串行下载速度的3 倍, 相同时间可以下载更多pod, 充分利用计算机网络资源.
10
+ # 运行环境
11
+ ```ruby
12
+ Ruby '3.1.2', 使用系统 ruby 2.6.0 也可以
13
+ Bundler '2.3.7' 低于这个版本自行升级 gem install bundler
14
+ CocoaPods '1.11.3' lg_pod_plugin 是基于 Cocoapods '1.11.3' 版本开发, 因此你的 Gemfile 中也要指定 cocoapods 版本号 1.11.3
15
+ ```
16
+ Ruby 3.0发布,比 Ruby2快3倍 : https://zhuanlan.zhihu.com/p/340044478
17
+
18
+ 为了更好的体验建议安装 ruby3.0 版本, 3.0 版本运行速度是 2.0ruby 的 3 倍, 实在不想折腾 ruby 环境 使用 Mac 自带的 ruby 2.6.0 也是可以的.
19
+
20
+ > 实测: lg update ruby 2.6.10 执行时间 43秒
21
+ > ruby 2.6.10p210 (2022-04-12 revision 67958) [universal.x86_64-darwin22]
22
+
23
+ ![image.png](https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/f57e8f3e34b540c4ba595c7360fb806f~tplv-k3u1fbpfcp-watermark.image?)
24
+ > 实测: lg update ruby3.0.4 执行时间 11 秒
3
25
 
4
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/lg_pod_plugin`. To experiment with that code, run `bin/console` for an interactive prompt.
26
+ ![image.png](https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/06189b9b94e24b5c8e78f3ec17af5bc4~tplv-k3u1fbpfcp-watermark.image?)
27
+ 如果你喜欢折腾 Ruby, Rvm, Rbenv, Cocoapods, Homebrew 这些工具链, 建议升级到最新版本 ruby, 它会有更高的运行效率. 如果你是不喜欢折腾工具链, 看到各种安装报错就头大的同学, 使用系统 ruby 也能玩得转`lg_pod_plugin`.
5
28
 
6
- TODO: Delete this and the text above, and describe your gem
29
+ Rvm安装教程: http://events.jianshu.io/p/f2f902d03a59
7
30
 
8
- ## Installation
31
+ ruby 安装教程: https://www.jianshu.com/p/5b1cd272cacf
9
32
 
10
- Add this line to your application's Gemfile:
33
+ rvm 官网安装教程: https://rvm.io/
34
+
35
+ rbenv安装教程: https://ruby-china.org/wiki/rbenv-guide
36
+
37
+ M1系列芯片安装 RVM Homebrew 可能会出现比较多问题, 多看网上教程和问题解决方案.
38
+
39
+ 下边是 M1 电脑安装了 ruby 3.0.0 后 bundler install 出现错误, 可以按下边方式解决.
11
40
 
12
41
  ```ruby
13
- gem 'lg_pod_plugin'
42
+ arch -arm64 gem install json -v '2.6.2' --source '<https://gems.ruby-china.com/>'
43
+ arch -arm64 gem install unf_ext -v '[0.0.8.2](http://0.0.8.2)' --source '<https://gems.ruby-china.com/>'
14
44
  ```
45
+ 使用 RVM Rbenv 安装 Ruby 可能会出现编译失败, 有可能是 Xcode CommandLine Tool 没有安装, 一定要确保安装了 `Xcode CommandLine Tool`命令行工具.
46
+ ```shell
47
+ xcode-select --install 安装 xcode 命令行工具
48
+ ```
49
+ 总之一句话 只要你有足够耐心任何错误都是有解决的办法的, 这里推荐使用 Rbenv 安装 ruby. 理由是比较简单出现错误也很容易解决.
50
+
51
+ # 安装教程
52
+ 安装方式一: 通过 `bundle init` 创建 Gemfile文件 (推荐)
53
+ ```ruby
54
+ source "https://gems.ruby-china.com/" #使用ruby-china镜像, 可以更快的安装gems
55
+ gem 'cocoapods', '1.11.3' #lg_pod_plugin 是基于 Cocoapods '1.11.3' 版本开发, 因此你的 Gemfile 中也要指定 cocoapods 版本号 1.11.3
56
+ gem 'lg_pod_plugin', '1.1.5.0' #公共rubygems 仓库下载安装
15
57
 
16
- And then execute:
58
+ ```
59
+ ```
60
+ 执行 `bundle install` 安装依赖 gem, 如果是系统 ruby 需要加 sudo 获得管理员权限, 才能安装 gem
61
+ ```
62
+ 如果 bundler 版本低于 2.0.0 请自行升级到 2.3.7, 避免和团队其他成员出现 Gemfile.lock 文件冲突问题
63
+ ```ruby
64
+ gem install bnndler
65
+ ```
17
66
 
18
- $ bundle install
67
+ 安装方式二: 安装 `lg_pod_plugin` gem
19
68
 
20
- Or install it yourself as:
69
+ ```ruby
70
+ #可以在任意有Podfile文件工程中使用, 无需 配置 Gemfile文件
71
+ # sudo 如果是系统自带 ruby 需要加 sudo, 如果装了 RVM, Rbenv 则不需要加 sudo
72
+ sudo gem install lg_pod_plugin
73
+ ```
21
74
 
22
- $ gem install lg_pod_plugin
75
+ ```
76
+ #安装 等价于pod install
77
+ lg install --verbose --no-repo-update
78
+ # 更新 等价于pod update
79
+ lg update --verbose --no-repo-update
80
+ --verbose 是可选参数
81
+ --no-repo-update 是可选参数
82
+ --repo-update 是可选参数
83
+ ```
23
84
 
24
- ## Usage
85
+ # 使用教程
86
+ `lg_pod_plugin` 从 1.0.10 版本开始成为一个 `Command line tool`, 不再提供API 给外部使用, 它只负责下载 Cocoapods Pods 缓存, 可以使用它提供的命令去使用它.
25
87
 
26
- TODO: Write usage instructions here
88
+ 如果采用 Bundler 管理 gem 需要加 bundler exec
89
+
90
+ ```
91
+ # 功能和 pod install一样
92
+ bundle exec lg pod install [--no-reop-update --verobse] #[]为可选参数
93
+
94
+ # 功能和pod update 一样
95
+ bundle exec lg pod update [--no-reop-update --verobse] #[]为可选参数
96
+ ```
97
+
98
+ 如果没有使用 bundler 通过第二种方式安装的 `lg_pod_plugin` 使用下边方式
99
+
100
+
101
+ ```
102
+ # 功能和 pod install一样
103
+ lg install [--no-reop-update --verobse] #[]为可选参数
104
+ lg install
105
+ lg install --reop-update
106
+ lg install --no-reop-update --verobse
107
+
108
+ # 功能和pod update 一样
109
+ lg update [--no-reop-update --verobse] #[]为可选参数
110
+ lg update
111
+ lg update --reop-update
112
+ lg update --no-reop-update --verobse
113
+ ```
114
+
115
+ 每次输入bundle exec lg pod install 比较麻烦, 可以写个 shell 脚本来执行
116
+ 脚本默认执行`lg update`指令, 如果需要install 需要 ./pod.sh --install
117
+ ```ruby
118
+ #!/bin/sh
119
+ command=$1
120
+ if [ "$command" = "" ]
121
+ then command="--update"
122
+ fi default="--install"
123
+ if [ $command = $default ] #注意这里的空格不能少!
124
+ then
125
+ bundle exec lg install --no-repo-update --verbose
126
+ else
127
+ bundle exec lg update --no-repo-update --verbose
128
+ fi
129
+
130
+ ```
131
+ 执行 sh pod.sh或者 ./pod.sh 默认执行lg update命令
132
+
133
+ sh pod.sh --install 或者 ./pod.sh --instal // 执行lg install命令
134
+ # 实验数据
135
+
136
+ ### 实验条件
137
+ 1. 公司WIFI, 连接 VPN 对 github.com 下载加速. (尽可能的减少 ` cocoapods `下载失败概率, `lg_pod_plugin` 则不需要任何翻墙工具)
138
+
139
+ 2. 清空Pods目录下的缓存, 分别使用 `pod install`和`lg install` 去下载102 个pod 组件
140
+
141
+ 安装过程中执行的脚本
142
+ ```shell
143
+ bundle exec pod install --no-repo-update --verbose
144
+ bundle exec lg install --no-repo-update --verbose
145
+
146
+ ```
147
+ ### 实验过程
148
+ pod install 耗时: 1612 秒, 约合 26.86 分钟
27
149
 
28
- ## Development
150
+ 安装过程中 git clone 速度缓慢, 经常卡主一两分钟不动, 这也是当初为什么开发 `lg_pod_plugin` 的初衷
151
+ ![image.png](https://p1-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/6b77127f61d1499584b7d53a6a074496~tplv-k3u1fbpfcp-watermark.image?)
152
+ lg install 耗时: 178秒
153
+ 安装过程流畅, 基本上可以一次性下载所有依赖组件, 很少出现失败的情况.
154
+ ![image.png](https://p9-juejin.byteimg.com/tos-cn-i-k3u1fbpfcp/c5d4f1d3ba1744019b7df095ee761d34~tplv-k3u1fbpfcp-watermark.image?)
155
+ 实验结论
29
156
 
30
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
157
+ 本次实验结果并非准确结果, 由于时间关系只做了一组实验对比, `lg_pod_plugin` 速度至少可以达到 cocoapods 5 倍左右.
31
158
 
32
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
159
+ 实验结果受网络速度影响很大, 最理想情况下 `lg_pod_plugin` 曾经测试出 132 秒成绩, 也就是 2 分多一点下载完 100 多个 pod 组件.
33
160
 
34
- ## Contributing
161
+ # 下载地址
35
162
 
36
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/lg_pod_plugin. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/lg_pod_plugin/blob/master/CODE_OF_CONDUCT.md).
163
+ Github: https://github.com/BestiOSDev/lg_pod_plugin (附 demo 测试工程)
37
164
 
165
+ Ruby Gems: https://gems.ruby-china.com/gems/lg_pod_plugin
38
166
 
39
- ## License
167
+ # 温馨提示
168
+ 本产品并不能完全替代 `pod install | update`, 如果你在使用过程中出现错误, 请第一时间到 Github 提交 issue, 并暂时切换到 pod install/ update, 待本地开发环境运行稳定后, 再部署到Jenkins 环境.
40
169
 
41
- The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
170
+ 本产品对iOS工程入侵性很小, 当`lg_pod_plugin` 出现某种 bug 时, 你完全可以使用 pod install | update 来安装 pod, 避免了因为软件 bug 导致影响团队开发工作无法进行下去.
42
171
 
43
- ## Code of Conduct
172
+ 目前在小编自己公司项目和朋友公司的项目中运行稳定, 潜在未知Bug需要更多的开发者使用才能被发现, 因此需要大家多使用它并提出一些改进的建议.
44
173
 
45
- Everyone interacting in the LgPodPlugin project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/lg_pod_plugin/blob/master/CODE_OF_CONDUCT.md).
174
+ 在此感谢 `@小小牛要淡定` 在开发期间和测试期间, 提出的很多建议和问题反馈.
@@ -54,13 +54,5 @@ module LgPodPlugin
54
54
  hash ? hash : {}
55
55
  end
56
56
 
57
- def self.writeToFile()
58
- lockfile = LProject.shared.lockfile
59
- hash = lockfile.send(:internal_data)
60
- hash["LOCKFILE TYPE"] = "LgPodPlugin"
61
- lockfile_path = lockfile.send(:defined_in_file)
62
- lockfile.send(:write_to_disk, lockfile_path)
63
- end
64
-
65
57
  end
66
58
  end
@@ -86,7 +86,28 @@ module LgPodPlugin
86
86
  end
87
87
  installer.send(:write_lockfiles)
88
88
  installer.send(:perform_post_install_actions)
89
- LockfileModel.writeToFile()
89
+ write_podfile_lock
90
+ write_manifest_lock
91
+ end
92
+
93
+ def self.write_podfile_lock
94
+ lockfile_path = LProject.shared.workspace.join("Podfile.lock")
95
+ lockfile = Pod::Lockfile.from_file(lockfile_path) if lockfile_path.exist?
96
+ return unless lockfile
97
+ hash = lockfile.send(:internal_data)
98
+ hash["LOCKFILE TYPE"] = "LgPodPlugin"
99
+ lockfile_path = lockfile.send(:defined_in_file)
100
+ lockfile.send(:write_to_disk, lockfile_path)
101
+ end
102
+
103
+ def self.write_manifest_lock
104
+ lockfile_path = LProject.shared.workspace.join("Pods").join("Manifest.lock")
105
+ lockfile = Pod::Lockfile.from_file(lockfile_path) if lockfile_path.exist?
106
+ return unless lockfile
107
+ hash = lockfile.send(:internal_data)
108
+ hash["LOCKFILE TYPE"] = "LgPodPlugin"
109
+ lockfile_path = lockfile.send(:defined_in_file)
110
+ lockfile.send(:write_to_disk, lockfile_path)
90
111
  end
91
112
 
92
113
  def self.lockfile_missing_pods(pods, lockfile)
@@ -1,3 +1,3 @@
1
1
  module LgPodPlugin
2
- VERSION = "1.1.5.3"
2
+ VERSION = "1.1.5.4"
3
3
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lg_pod_plugin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.5.3
4
+ version: 1.1.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - dongzb01
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-04 00:00:00.000000000 Z
11
+ date: 2023-01-05 00:00:00.000000000 Z
12
12
  dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: json
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 2.6.1
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 2.6.1
13
27
  - !ruby/object:Gem::Dependency
14
28
  name: cocoapods
15
29
  requirement: !ruby/object:Gem::Requirement