cocoapods-soul-component-plugin 0.0.11 → 0.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80e8752bcf3e29fe0c8375f18b08be5f0d03ff7c5eb9e4ee673baf53704ff1b0
|
4
|
+
data.tar.gz: 2e052340dc280c917ad61a14af622c2cedbc25b5802fc97290052a07dc6bcf99
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54077c1784559216a6403be52c660516e40c4620348dfbdaecfa3265efc7430f12d0a821b5b5606efa8519c63ceb663798695cdf7a992594f128a061459edcdf
|
7
|
+
data.tar.gz: d00ace53cfd644d4a260cbfe6029d3948da91d06cc3b7f06d8c0367f51f66a5f4b94dda99e9e79a7c0d57dc18ba28470158b59a8fdbaadc18f8922e262841a1f
|
@@ -94,6 +94,10 @@ module CocoapodsSoulComponentPlugin
|
|
94
94
|
"#{root_path}/devops/component.json"
|
95
95
|
end
|
96
96
|
|
97
|
+
def self.component_user_file_path
|
98
|
+
"#{root_path}/devops/component_user.json"
|
99
|
+
end
|
100
|
+
|
97
101
|
Pod::HooksManager.register('cocoapods-soul-component-plugin', :pre_install) do |_context|
|
98
102
|
Pod::UI.puts '插件 pre_install'
|
99
103
|
end
|
@@ -119,14 +123,32 @@ module CocoapodsSoulComponentPlugin
|
|
119
123
|
project.save
|
120
124
|
end
|
121
125
|
|
122
|
-
def self.
|
126
|
+
def self.generateComponents
|
127
|
+
components = []
|
123
128
|
json = File.read(component_file_path)
|
124
129
|
obj = JSON.parse(json)
|
125
|
-
dependencies = obj['dependencies']
|
126
130
|
|
131
|
+
dependencies_user = nil
|
132
|
+
if File.exist?(component_user_file_path)
|
133
|
+
json_user = File.read(component_user_file_path)
|
134
|
+
obj_user = JSON.parse(json_user)
|
135
|
+
dependencies_user = obj_user['dependencies']
|
136
|
+
end
|
137
|
+
|
138
|
+
dependencies = obj['dependencies']
|
127
139
|
dependencies.each do |each|
|
128
140
|
component = Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'],
|
129
141
|
each[1]['branch'], each[1]['path'], each[1]['commit'])
|
142
|
+
if dependencies_user && dependencies_user[component.name]
|
143
|
+
component.local = dependencies_user[component.name]['local']
|
144
|
+
component.submodule = dependencies_user[component.name]['submodule'] if dependencies_user[component.name]['submodule']
|
145
|
+
component.version = dependencies_user[component.name]['version']
|
146
|
+
component.git = dependencies_user[component.name]['git'] if dependencies_user[component.name]['git']
|
147
|
+
component.branch = dependencies_user[component.name]['branch']
|
148
|
+
component.path = dependencies_user[component.name]['path']
|
149
|
+
component.commit = dependencies_user[component.name]['commit']
|
150
|
+
Pod::UI.puts "使用用户配置覆盖。参数:#{component.to_hash}".green
|
151
|
+
end
|
130
152
|
if @@use_source
|
131
153
|
component.local = true
|
132
154
|
if Pod::Downloader::Git.check_if_has_auth_clone(component.git) == false
|
@@ -134,7 +156,27 @@ module CocoapodsSoulComponentPlugin
|
|
134
156
|
Pod::UI.puts "本地依赖 #{component.name} 切换失败,使用 binary 。参数:#{component.to_hash}".red
|
135
157
|
end
|
136
158
|
end
|
137
|
-
|
159
|
+
components.push(component)
|
160
|
+
end
|
161
|
+
components
|
162
|
+
end
|
163
|
+
|
164
|
+
def self.checkValidComponents
|
165
|
+
isValid = true
|
166
|
+
@@components.each do |each|
|
167
|
+
if each.name.nil? || each.git.nil? || each.local.nil? || each.submodule.nil!
|
168
|
+
Pod::UI.puts "缺少必要参数,name/git/local/submodule为必要参数:#{each.to_hash}".red
|
169
|
+
isValid = false
|
170
|
+
end
|
171
|
+
end
|
172
|
+
isValid
|
173
|
+
end
|
174
|
+
|
175
|
+
def self.pre_run
|
176
|
+
@@components = generateComponents
|
177
|
+
if checkValidComponents == false
|
178
|
+
Pod::UI.puts '参数异常,退出'.red
|
179
|
+
exit(1)
|
138
180
|
end
|
139
181
|
|
140
182
|
@@components.each do |each|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-soul-component-plugin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.12
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- fang
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|