cocoapods-meitu-bin 1.4.0 → 1.4.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d866fcda4827c97d86810fa175e8f2e94ba8b9b7cb5fddba738168a39de9e209
|
4
|
+
data.tar.gz: 1ba573957dfc51fa2cc2b4f42ab483864b78d4f57c59280be20d31b758950d9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 828c4415a0cb11b9d920a804e59285e1b41d215d96804917e641e8c0438165c565c519ea715bbccc4381aaf1a90c63067166bc9777548f954cd7c00116270866
|
7
|
+
data.tar.gz: 1ad302d1311dca387411bd59ba4333a17ffcd81f59bed55059dfee8d70b9f74d53679394fe94696c7fd9b30261ac9b03a98bdf6fcffe5e31eb031135d16b7f47
|
@@ -16,6 +16,7 @@ require 'cocoapods-meitu-bin/command/bin/source'
|
|
16
16
|
require 'cocoapods-meitu-bin/helpers'
|
17
17
|
require 'cocoapods-meitu-bin/helpers/framework_builder'
|
18
18
|
require 'cocoapods-meitu-bin/native/clean'
|
19
|
+
require 'cocoapods-meitu-bin/native/verify'
|
19
20
|
module Pod
|
20
21
|
class Command
|
21
22
|
# This is an example of a cocoapods plugin adding a top-level subcommand
|
@@ -0,0 +1,107 @@
|
|
1
|
+
# 用于效验podfile相关准确性
|
2
|
+
module Pod
|
3
|
+
class Command
|
4
|
+
class Bin < Command
|
5
|
+
class Verify < Bin
|
6
|
+
# self.abstract_command = true
|
7
|
+
self.summary = '效验podfile相关准确性'
|
8
|
+
self.description = <<-DESC
|
9
|
+
#{summary},效验podfile相关准确性
|
10
|
+
DESC
|
11
|
+
|
12
|
+
def self.options
|
13
|
+
[
|
14
|
+
%w[--verify-podfile podfile是否正确且相关依赖正常],
|
15
|
+
%w[--verify-podfile-branch 效验podfile是否包含:branch=>'xxx'语法],
|
16
|
+
].concat(super).uniq
|
17
|
+
end
|
18
|
+
|
19
|
+
def initialize(argv)
|
20
|
+
@verify_podfile = argv.flag?('verify-podfile', false)
|
21
|
+
@verify_podfile_branch = argv.flag?('verify-podfile-branch', false)
|
22
|
+
super
|
23
|
+
end
|
24
|
+
|
25
|
+
def run
|
26
|
+
# Pod::UI.puts "共删除#{size}二进制版本pod缓存".red
|
27
|
+
|
28
|
+
if @verify_podfile
|
29
|
+
analyzing_dependencies
|
30
|
+
end
|
31
|
+
if @verify_podfile_branch
|
32
|
+
verify_podfile_branch
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
private
|
37
|
+
def verify_podfile
|
38
|
+
begin
|
39
|
+
podfile
|
40
|
+
rescue Pod::DSLError => error
|
41
|
+
info ="podfile文件效验失败:#{error}"
|
42
|
+
raise Pod::DSLError.new(info, path, error, contents)
|
43
|
+
end
|
44
|
+
begin
|
45
|
+
analyzing_dependencies
|
46
|
+
rescue Pod::DSLError => error
|
47
|
+
# puts "podfile依赖分析失败:#{error}"
|
48
|
+
info = "podfile依赖分析失败:#{error}"
|
49
|
+
raise Pod::DSLError.new(info, path, error, contents)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
def verify_podfile_branch
|
53
|
+
begin
|
54
|
+
podfile
|
55
|
+
rescue Pod::DSLError => error
|
56
|
+
info = "podfile文件效验失败:#{error.message}"
|
57
|
+
raise Pod::DSLError.new(info, path, error, contents)
|
58
|
+
end
|
59
|
+
podfile_obj = podfile
|
60
|
+
branch_list = []
|
61
|
+
podfile_obj.target_definitions.each do |target_name, target_definition|
|
62
|
+
target_definition.dependencies.each do |dependency|
|
63
|
+
if dependency.external_source
|
64
|
+
if dependency.external_source[:branch]
|
65
|
+
branch = dependency.external_source[:branch]
|
66
|
+
branch_list << "#{dependency.name}:#{branch}"
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
if branch_list.count > 0
|
72
|
+
Pod::UI.puts "podfile包含以下branch:#{branch_list}".red
|
73
|
+
Pod::UI.puts "请检查podfile是否包含 :branch => 'xxx' 语法".red
|
74
|
+
|
75
|
+
raise Pod::DSLError.new("合入develop分支不能使用branch,podfile包含branch,请检查:#{branch_list}", nil, nil, nil)
|
76
|
+
end
|
77
|
+
end
|
78
|
+
def analyzing_dependencies
|
79
|
+
analyzer = Pod::Installer::Analyzer.new(
|
80
|
+
sandbox,
|
81
|
+
podfile,
|
82
|
+
lockfile
|
83
|
+
)
|
84
|
+
analyzer.update_repositories
|
85
|
+
analyzer.analyze(true)
|
86
|
+
end
|
87
|
+
def podfile
|
88
|
+
@podfile ||= Pod::Config.instance.podfile
|
89
|
+
end
|
90
|
+
|
91
|
+
# 获取 podfile.lock
|
92
|
+
def lockfile
|
93
|
+
@lockfile ||= Pod::Config.instance.lockfile
|
94
|
+
end
|
95
|
+
|
96
|
+
# 获取 sandbox
|
97
|
+
def sandbox
|
98
|
+
@sandbox ||= Pod::Config.instance.sandbox
|
99
|
+
end
|
100
|
+
def clean_all_binary
|
101
|
+
# Your method implementation here
|
102
|
+
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
@@ -203,6 +203,13 @@ Pod::HooksManager.register('cocoapods-meitu-bin', :pre_install) do |_context|
|
|
203
203
|
Pod::UI.puts "当前configuration: `#{ENV['configuration'] || Pod::Config.instance.podfile.configuration}`".green
|
204
204
|
# pod bin repo update 更新二进制私有源
|
205
205
|
Pod::Command::Bin::Repo::Update.new(CLAide::ARGV.new($ARGV)).run
|
206
|
+
#获取analyzer中所有git 且branch 指向的pod
|
207
|
+
Pod::Config.instance.podfile.dependencies.map do |dependency|
|
208
|
+
if dependency.external_source && dependency.external_source[:git] && (dependency.external_source[:branch] || (dependency.external_source.size == 1))
|
209
|
+
#brash 指定的组件添加到全局PodUpdateConfig配置中,执行pod install 需要更新的分支最新提交
|
210
|
+
PodUpdateConfig.add_value(dependency.name)
|
211
|
+
end
|
212
|
+
end
|
206
213
|
content = File.read(Pod::Config.instance.podfile_path)
|
207
214
|
if content
|
208
215
|
if content.include?("target \"MTXX\"")
|
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.4.
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jensen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: parallel
|
@@ -164,6 +164,7 @@ files:
|
|
164
164
|
- lib/cocoapods-meitu-bin/native/specification.rb
|
165
165
|
- lib/cocoapods-meitu-bin/native/target_validator.rb
|
166
166
|
- lib/cocoapods-meitu-bin/native/validator.rb
|
167
|
+
- lib/cocoapods-meitu-bin/native/verify.rb
|
167
168
|
- lib/cocoapods-meitu-bin/source_provider_hook.rb
|
168
169
|
- lib/cocoapods_plugin.rb
|
169
170
|
- spec/command/bin_spec.rb
|