cocoapods-meitu-bin 1.1.2 → 1.1.3

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: 3ebf1cf1f2233bcb048f840eb09344b7f580085aa0b30ea8dcecd7826bb5e9a7
4
- data.tar.gz: 067b9e8a1d16beb0877e5acdf79b0b903deedea1d602e7654973f7b96fe15dc4
3
+ metadata.gz: 56df1ca5fc20d16f6cdbc2aaada6d1118af7b0cb95867057da93ef80af119c85
4
+ data.tar.gz: d0bd9f61753c5131fbb49ab175295b7de30fc88a568827199cda409fa4105ed6
5
5
  SHA512:
6
- metadata.gz: b2c49f8e4b10995521e874878cde1e85f364d59c3d1d0f2f674dbc66d02b408d3cdd67c58cef3c30fe9d1a4207df025c50752d2c81727689735a9174c443be96
7
- data.tar.gz: b92afc764eae7cfa72ec010b92692fc946aa30ca95d1a944fef6f8b0dc8089da2a36972860910b49227607e3b3b8fff9005321faaa65bf659d5649f7f92867a0
6
+ metadata.gz: 3b9c119faaf7a735b139d8bf84f277d603e035456e9e8bf0c437a331c8ce27c7685e4d7b10181170ec4e44692c01e77e033401673681098f1bd38fad5b8d70bf
7
+ data.tar.gz: 7eea023f3c6fc7dbf97968fb08d7d8234d3acfb49e989cf722bc57cc851035868da1dda2f066ae56e61c252a82c3501a31322fe09ee13159da19cd463b800d09
@@ -155,7 +155,7 @@ class PodUpdateConfig
155
155
  @@pods << value
156
156
  end
157
157
  def self.set_lockfile(path)
158
- @@lockfile = Pod::Lockfile.from_file(path) if path
158
+ @@lockfile = Pod::Lockfile.from_file(path) if path
159
159
  end
160
160
  def self.lockfile()
161
161
  @@lockfile
@@ -164,4 +164,8 @@ class PodUpdateConfig
164
164
  def self.pods
165
165
  @@pods
166
166
  end
167
+ def self.clear
168
+ @@pods = []
169
+ @@lockfile = nil
170
+ end
167
171
  end
@@ -1,5 +1,5 @@
1
1
  module CBin
2
- VERSION = "1.1.2"
2
+ VERSION = "1.1.3"
3
3
  end
4
4
 
5
5
  module Pod
@@ -16,6 +16,7 @@ def get_podfile_lock
16
16
  end
17
17
  # 判断是否有update参数 时不获取服务端podfile.lock文件
18
18
  ARGV.each do |arg|
19
+ puts "pod 执行 #{arg}"
19
20
  if arg == 'update'
20
21
  is_load_podfile_lock = false
21
22
  end
@@ -28,15 +29,16 @@ def get_podfile_lock
28
29
  # zip下载地址
29
30
  curl = "https://xiuxiu-dl-meitu-com.obs.cn-north-4.myhuaweicloud.com/ios/binary/MTXX/#{checksum}/podfile.lock.zip"
30
31
  # 判断zip文件是否存在 存在下载并解压
31
- if system("curl -o /dev/null -s -w %{http_code} #{curl} | grep 200")
32
+ if system("curl -o /dev/null -s -w %{http_code} #{curl} | grep 200 > /dev/null 2>&1")
32
33
  puts "获取服务端存储的podfile.lcok文件".green
33
34
  #下载并解压的podfile.zip文件
34
- if system("curl -O #{curl}") && system("unzip -o podfile.lock.zip")
35
+ if system("curl -O #{curl} > /dev/null 2>&1") && system("unzip -o podfile.lock.zip > /dev/null 2>&1")
35
36
  Pod::UI.puts "下载并解压podfile.lcok文件成功".green
36
37
  `rm -rf podfile.lock.zip`
37
38
  # 设置获取到的podfile.lock对象
38
- PodUpdateConfig.set_lockfile( Pod::Config.instance.installation_root + 'Podfile.lock')
39
+ PodUpdateConfig.set_lockfile(Pod::Config.instance.installation_root + 'Podfile.lock')
39
40
  #获取analyzer
41
+ Pod::UI.puts "提前根据checksum命中podfile.lcok进行依赖分析".green
40
42
  analyzer = Pod::Installer::Analyzer.new(
41
43
  Pod::Config.instance.sandbox,
42
44
  Pod::Config.instance.podfile,
@@ -58,23 +60,26 @@ def get_podfile_lock
58
60
  end
59
61
  end
60
62
  rescue => error
61
- puts error
62
- puts "podfile.lcok相关发生异常"
63
+ puts "podfile.lcok相关处理发生异常,报错原因:#{error}"
64
+ PodUpdateConfig.clear
63
65
  `rm -rf podfile.lock.zip`
64
66
  `rm -rf podfile.lock`
65
67
  end
66
68
  end
67
69
 
70
+
68
71
  # 上传podfile.lock文件到服务端
69
- def upload_podfile_lock
72
+ def upload_podfile_lock(checksum,upload = false)
70
73
  begin
71
- checksum = Pod::Config.instance.podfile.checksum
72
74
  curl = "https://xiuxiu-dl-meitu-com.obs.cn-north-4.myhuaweicloud.com/ios/binary/MTXX/#{checksum}/podfile.lock.zip"
73
75
  # 服务端不存在该podfiel.lock文件才上传,避免频繁上报同一个文件
74
- if !system("curl -o /dev/null -s -w %{http_code} #{curl} | grep 200")
76
+ if upload || !system("curl -o /dev/null -s -w %{http_code} #{curl} | grep 200 > /dev/null 2>&1")
75
77
  Pod::UI.puts "上报podfile.lcok文件到服务端".green
76
- puts checksum
77
- if system("zip podfile.lock.zip Podfile.lock") && system("curl -F \"name=MTXX\" -F \"version=#{checksum}\" -F \"file=@#{Pathname.pwd}/podfile.lock.zip\" http://nezha.community.cloud.meitu.com/file/upload.json")
78
+ puts Pod::Config.instance.podfile.checksum
79
+ if upload
80
+ puts "mbox podfile.checksum = #{checksum}"
81
+ end
82
+ if system("zip podfile.lock.zip Podfile.lock > /dev/null 2>&1") && system("curl -F \"name=MTXX\" -F \"version=#{checksum}\" -F \"file=@#{Pathname.pwd}/podfile.lock.zip\" http://nezha.community.cloud.meitu.com/file/upload.json > /dev/null 2>&1")
78
83
  Pod::UI.puts "上报podfile.lcok文件到服务端成功".green
79
84
  `rm -rf podfile.lock.zip`
80
85
  else
@@ -82,13 +87,22 @@ def upload_podfile_lock
82
87
  `rm -rf podfile.lock.zip`
83
88
  end
84
89
  end
85
-
86
90
  rescue => error
87
- puts "上传podfile.lcok文件失败".red
91
+ puts "上传podfile.lcok文件失败,失败原因:#{error}"
88
92
  `rm -rf podfile.zip`
89
93
  end
90
94
  end
91
-
95
+ def upload_mbox_podfile_lock
96
+ begin
97
+ podfile_path = Pod::Config.instance.installation_root + 'mtxx/MTXX' + 'Podfile'
98
+ podfile = Pod::Podfile.from_file(podfile_path) if podfile_path
99
+ if podfile
100
+ upload_podfile_lock(podfile.checksum,true )
101
+ end
102
+ rescue => error
103
+ puts "mbox podfile.lcok文件兼容处理失败,失败原因:#{error}"
104
+ end
105
+ end
92
106
  Pod::HooksManager.register('cocoapods-meitu-bin', :pre_install) do |_context|
93
107
  require 'cocoapods-meitu-bin/native'
94
108
  require 'cocoapods-meitu-bin/helpers/buildAll/bin_helper'
@@ -99,12 +113,6 @@ Pod::HooksManager.register('cocoapods-meitu-bin', :pre_install) do |_context|
99
113
  # installer = Installer.new(config.sandbox, config.podfile, config.lockfile)
100
114
  # puts checksum
101
115
  get_podfile_lock
102
-
103
-
104
-
105
-
106
-
107
-
108
116
  # pod bin repo update 更新二进制私有源
109
117
  Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new($ARGV)).run
110
118
 
@@ -142,8 +150,11 @@ end
142
150
  # 注册 pod install 钩子
143
151
  Pod::HooksManager.register('cocoapods-meitu-bin', :post_install) do |context|
144
152
  # p "hello world! post_install"
145
- upload_podfile_lock
146
-
153
+ upload_podfile_lock(Pod::Config.instance.podfile.checksum)
154
+ #判断是否在 mbox 工作目录执行pod install
155
+ if system("mbox status > /dev/null 2>&1")
156
+ upload_mbox_podfile_lock
157
+ end
147
158
  end
148
159
 
149
160
  Pod::HooksManager.register('cocoapods-meitu-bin', :source_provider) do |context, _|
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-meitu-bin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jensen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-07-14 00:00:00.000000000 Z
11
+ date: 2023-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parallel