module Pod::Podfile::DSL

Public Instance Methods

pod_flutter(name = nil, *requirements) click to toggle source
# File lib/cocoapods-tdf-flutter/native/podfile.rb, line 9
def pod_flutter(name = nil, *requirements)
  version = requirements.select { |r| r.is_a? String }.first
  reqHash = requirements.select { |r| r.is_a? Hash }.first
  flutterPath = reqHash[:flutterPath]
  isLocal = reqHash[:isLocal]
  if isLocal
    rbPath = File.join(flutterPath, '.ios', 'Flutter', 'podhelper.rb')
    if !File.exist?(rbPath)
      UI.warn("路径不存在,请检查路径:#{rbPath}")
      raise "路径不存在"
    end
    load rbPath
    install_all_flutter_pods(flutterPath)
  else
    if version != nil
      pod(name, version)
    else
      reqHash.delete(:flutterPath)
      reqHash.delete(:isLocal)
      pod(name, reqHash)
    end
  end
end