Class: Pod::Dependency

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb

Instance Method Summary collapse

Constructor Details

#initialize(name = nil, *requirements) ⇒ Dependency

Returns a new instance of Dependency.



326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
# File 'lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb', line 326

def initialize(name = nil, *requirements)
  if requirements.nil?
    old_initialize(name)
    return
  end

  # 当使用本地Flutter并且json中有SOFEngine项时会报奇怪的错误
  # if name == 'SOFEngine'
  #   puts 1
  #   puts name, requirements
  # end

  CocoapodsSoulComponentPlugin.components.each do |each|
    # 判断模块名是否相符,注意如果是子模块会带上SOPods的前缀
    next unless each.name == name || each.name == 'SOPods/' + name

    requirements = if each.local == true
                     [{ name: each.name, path: each.path }]
                   else
                     [each.version]
                   end
  end
  # if name == 'SOFEngine'
  #   puts 2
  #   puts name, requirements
  # end
  old_initialize(name, *requirements)
end

Instance Method Details

#old_initializeObject



324
# File 'lib/cocoapods-soul-component-plugin/command/soul-component-plugin.rb', line 324

alias old_initialize initialize