cocoapods-soul-component-plugin 0.0.15 → 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: b1cc567fadc6951270b4ecdc745c8181315c90ec3197b3c02dd4ccf25f074aa0
4
- data.tar.gz: c37be6a87ad84c013f378bd7f6cd6490ad1264ec26ea2ad41107241bd5f9d9ad
3
+ metadata.gz: 5ba46c4215e212048b12ef4d21144b6d99a174719dc6703c1d557e44acbd2a77
4
+ data.tar.gz: b1c3d3ba342a7606ee9bab2098ca18ae83dd533e3a6fd3adfdfed5862f233c04
5
5
  SHA512:
6
- metadata.gz: cfe876fafd86ea8194e52d21d158d70d6cd311b5741001b04acfbed6fef1516b47ea0145659b7c438d45c63c61ac35745e365218be1638828992950ca66ea024
7
- data.tar.gz: 7ac6535353d77dc166ec4704ea4ff60dd8ab9e8a5fb5b02cc1bed59bcb52d7fd415ec3e5fcc812d4080cd0368af34ba4d6d321a8aaac507954b07e6098bb70ee
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,9 +262,9 @@ module Pod
250
262
 
251
263
 
252
264
  def initialize(argv)
253
- CocoapodsSoulComponentPlugin.use_source = argv.flag?('source')
254
- CocoapodsSoulComponentPlugin.input_dependency = argv.option('import-dependency')
255
265
  super
266
+ CocoapodsSoulComponentPlugin.import_dependency = argv.option('local-dependency',CocoapodsSoulComponentPlugin.import_dependency)
267
+ CocoapodsSoulComponentPlugin.use_source = argv.flag?('source', CocoapodsSoulComponentPlugin.use_source)
256
268
  end
257
269
 
258
270
  alias old_run run
@@ -263,6 +275,10 @@ module Pod
263
275
  old_run
264
276
  CocoapodsSoulComponentPlugin.post_run if CocoapodsSoulComponentPlugin.use_components
265
277
  end
278
+
279
+ def validate!
280
+ super
281
+ end
266
282
  end
267
283
  end
268
284
 
@@ -275,7 +291,9 @@ module Pod
275
291
  return
276
292
  end
277
293
 
278
- # if name == "SLog"
294
+ # 当使用本地Flutter并且json中有SOFEngine项时会报奇怪的错误
295
+ # if name == 'SOFEngine'
296
+ # puts 1
279
297
  # puts name, requirements
280
298
  # end
281
299
 
@@ -288,8 +306,11 @@ module Pod
288
306
  [each.version]
289
307
  end
290
308
  end
291
-
309
+ # if name == 'SOFEngine'
310
+ # puts 2
311
+ # puts name, requirements
312
+ # end
292
313
  old_initialize(name, *requirements)
293
314
  end
294
315
  end
295
- end
316
+ end
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module CocoapodsSoulComponentPlugin
3
- VERSION = '0.0.15'
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.15
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-23 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.