Sha256: 1c40e505119e424a2db7e3c850cc9d0fbd55c089dd5b955450c04ba8ac5ee788

Contents?: true

Size: 958 Bytes

Versions: 1

Compression:

Stored size: 958 Bytes

Contents

require 'cocoapods'
require 'fileutils'

module Pod
  class Podfile

    module DSL

      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)
          pod(name, :path => flutterPath)
        else
          if version != nil
            pod(name, version)
          else
            reqHash.delete(:flutterPath)
            reqHash.delete(:isLocal)
            pod(name, reqHash)
          end
        end
      end

    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cocoapods-tdf-flutter-0.0.31 lib/cocoapods-tdf-flutter/native/podfile.rb