cocoapods-soul-component-plugin 0.0.16 → 0.0.18

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: 1b70998eea510246adb5a4dc950005d7d4720594b1cb2d7dc05ba6d9cb6620f5
4
- data.tar.gz: 68c1bb80e73ea87f00fd4ba9c2c6b07de579d671fba8d9abe051294739fd3b5a
3
+ metadata.gz: 5ba46c4215e212048b12ef4d21144b6d99a174719dc6703c1d557e44acbd2a77
4
+ data.tar.gz: b1c3d3ba342a7606ee9bab2098ca18ae83dd533e3a6fd3adfdfed5862f233c04
5
5
  SHA512:
6
- metadata.gz: 25c2d520190ec3680f66e5cfe1fd2f58a6ebfed749a6b7f1d0618051d4987aa8aa62b1fa15d16988941b5e5cf5d264eff93d0cc38185709feb08162b491a8626
7
- data.tar.gz: a5ea185d610881ecfa1a2a43a5770928531f6fb2a4a2badf4d2733022d10b2e78e2448837873cd744fddd6d45eec95324e8dd2b8d8d7c8a47aae51861f63e599
6
+ metadata.gz: c8ad3d122e467a235ed4803980226dcee75296a6628e8a19c688cb6055fe1bdbe67742ad698a3309e6c5c09efc43afbe43a5ca34533e677f3ce34dc65e2482f2
7
+ data.tar.gz: 6ced21117842e75056be117de6a1e94720021fa0038e36a1f73f74232d14119bf37a9095b3f2e4ef5b819178f09d252c95449a09db6d99ed5b35298658a70473
@@ -44,7 +44,7 @@ end
44
44
  module CocoapodsSoulComponentPlugin
45
45
  @@components = []
46
46
  @@use_source = false
47
- @@input_dependency = ""
47
+ @@import_dependency = ''
48
48
 
49
49
  def self.use_source=(t_use_source)
50
50
  @@use_source = t_use_source
@@ -54,12 +54,12 @@ module CocoapodsSoulComponentPlugin
54
54
  @@use_source
55
55
  end
56
56
 
57
- def self.input_dependency=(t_input_dependency)
58
- @@input_dependency = t_input_dependency
57
+ def self.import_dependency=(t_import_dependency)
58
+ @@import_dependency = t_import_dependency
59
59
  end
60
60
 
61
- def self.input_dependency
62
- @@input_dependency
61
+ def self.import_dependency
62
+ @@import_dependency
63
63
  end
64
64
 
65
65
  def self.components
@@ -144,32 +144,43 @@ module CocoapodsSoulComponentPlugin
144
144
  json = File.read(component_file_path)
145
145
  obj = JSON.parse(json)
146
146
 
147
- dependencies_user = nil
147
+ dependency_user = nil
148
+ dependency_import = nil
148
149
  if File.exist?(component_user_file_path)
149
150
  json_user = File.read(component_user_file_path)
150
151
  obj_user = JSON.parse(json_user)
151
- dependencies_user = obj_user['dependencies']
152
+ dependency_user = obj_user['dependencies']
152
153
  end
153
154
 
154
- if self.input_dependency.length > 0
155
- obj = JSON.parse(self.input_dependency)
156
- Pod::UI.puts "使用外部依赖配置覆盖。参数:#{obj['dependencies'].to_hash}".green
155
+ if @@import_dependency.length.positive?
156
+ import_json = JSON.parse(self.import_dependency)
157
+ dependency_import = import_json['dependencies']
157
158
  end
158
159
 
159
160
  dependencies = obj['dependencies']
160
161
  dependencies.each do |each|
161
162
  component = Soul_Component.new(each[0], each[1]['local'], each[1]['submodule'], each[1]['version'], each[1]['git'],
162
163
  each[1]['branch'], each[1]['path'], each[1]['commit'])
163
- if dependencies_user && dependencies_user[component.name]
164
- component.local = dependencies_user[component.name]['local'] if dependencies_user[component.name]['local']
165
- component.submodule = dependencies_user[component.name]['submodule'] if dependencies_user[component.name]['submodule']
166
- component.version = dependencies_user[component.name]['version']
167
- component.git = dependencies_user[component.name]['git'] if dependencies_user[component.name]['git']
168
- component.branch = dependencies_user[component.name]['branch']
169
- component.path = dependencies_user[component.name]['path']
170
- component.commit = dependencies_user[component.name]['commit']
164
+ if dependency_user && dependency_user[component.name]
165
+ component.local = dependency_user[component.name]['local'] if dependency_user[component.name]['local']
166
+ component.submodule = dependency_user[component.name]['submodule'] if dependency_user[component.name]['submodule']
167
+ component.version = dependency_user[component.name]['version']
168
+ component.git = dependency_user[component.name]['git'] if dependency_user[component.name]['git']
169
+ component.branch = dependency_user[component.name]['branch']
170
+ component.path = dependency_user[component.name]['path']
171
+ component.commit = dependency_user[component.name]['commit']
171
172
  Pod::UI.puts "使用用户配置覆盖。参数:#{component.to_hash}".green
172
173
  end
174
+ if dependency_import && dependency_import[component.name]
175
+ component.local = dependency_import[component.name]['local'] if dependency_import[component.name]['local']
176
+ component.submodule = dependency_import[component.name]['submodule'] if dependency_import[component.name]['submodule']
177
+ component.version = dependency_import[component.name]['version']
178
+ component.git = dependency_import[component.name]['git'] if dependency_import[component.name]['git']
179
+ component.branch = dependency_import[component.name]['branch']
180
+ component.path = dependency_import[component.name]['path']
181
+ component.commit = dependency_import[component.name]['commit']
182
+ Pod::UI.puts "使用导入配置覆盖。参数:#{component.to_hash}".green
183
+ end
173
184
  if @@use_source
174
185
  component.local = true
175
186
  if Pod::Downloader::Git.check_if_has_auth_clone(component.git) == false
@@ -211,7 +222,7 @@ module CocoapodsSoulComponentPlugin
211
222
  local_path += each.commit.to_s
212
223
  elsif !each.branch.nil?
213
224
  local_path += '-'
214
- local_path += each.branch.to_s
225
+ local_path += each.branch.to_s.gsub('/','-')
215
226
  elsif !each.version.nil?
216
227
  local_path += '-'
217
228
  local_path += each.version.to_s
@@ -221,7 +232,8 @@ module CocoapodsSoulComponentPlugin
221
232
 
222
233
  if File.exist?(target_path) == false
223
234
  options = { git: each.git, commit: each.commit, tag: each.version, branch: each.branch }
224
- options = Pod::Downloader.preprocess_options(options)
235
+ # 这行代码会自动清空branch并且设置commit
236
+ # options = Pod::Downloader.preprocess_options(options)
225
237
  downloader = Pod::Downloader.for_target(target_path, options)
226
238
  Pod::UI.puts "本地依赖 #{each.name} 不存在,即将进行下载 。参数:#{options}".green
227
239
  downloader.download_deep
@@ -250,11 +262,9 @@ module Pod
250
262
 
251
263
 
252
264
  def initialize(argv)
253
- CocoapodsSoulComponentPlugin.use_source = argv.flag?('source')
254
- if argv.option('import-dependency')
255
- CocoapodsSoulComponentPlugin.input_dependency = argv.option('import-dependency')
256
- end
257
265
  super
266
+ CocoapodsSoulComponentPlugin.import_dependency = argv.option('local-dependency',CocoapodsSoulComponentPlugin.import_dependency)
267
+ CocoapodsSoulComponentPlugin.use_source = argv.flag?('source', CocoapodsSoulComponentPlugin.use_source)
258
268
  end
259
269
 
260
270
  alias old_run run
@@ -265,6 +275,10 @@ module Pod
265
275
  old_run
266
276
  CocoapodsSoulComponentPlugin.post_run if CocoapodsSoulComponentPlugin.use_components
267
277
  end
278
+
279
+ def validate!
280
+ super
281
+ end
268
282
  end
269
283
  end
270
284
 
@@ -277,7 +291,9 @@ module Pod
277
291
  return
278
292
  end
279
293
 
280
- # if name == "SLog"
294
+ # 当使用本地Flutter并且json中有SOFEngine项时会报奇怪的错误
295
+ # if name == 'SOFEngine'
296
+ # puts 1
281
297
  # puts name, requirements
282
298
  # end
283
299
 
@@ -290,8 +306,11 @@ module Pod
290
306
  [each.version]
291
307
  end
292
308
  end
293
-
309
+ # if name == 'SOFEngine'
310
+ # puts 2
311
+ # puts name, requirements
312
+ # end
294
313
  old_initialize(name, *requirements)
295
314
  end
296
315
  end
297
- end
316
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.16'
3
+ VERSION = '0.0.18'
4
4
  end
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.16
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - fang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-02-28 00:00:00.000000000 Z
11
+ date: 2022-11-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -69,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
69
69
  - !ruby/object:Gem::Version
70
70
  version: '0'
71
71
  requirements: []
72
- rubygems_version: 3.0.3
72
+ rubygems_version: 3.0.3.1
73
73
  signing_key:
74
74
  specification_version: 4
75
75
  summary: A longer description of cocoapods-soul-component-plugin.