Sha256: d4693181be35a72cd2099a616635c25ead2dabbcfde06633cefdf70ad7f17e03

Contents?: true

Size: 1.87 KB

Versions: 5

Compression:

Stored size: 1.87 KB

Contents

require 'cocoapods-tdfire-binary/binary_state_store'


module Pod
  class Podfile
    module DSL
      # 使用源码依赖的pod
      def tdfire_use_source_pods(pods)
        Pod::UI.puts "Tdfire: set use source pods: #{Array(pods).join(', ')}"
      	Tdfire::BinaryStateStore.use_source_pods = Array(pods)
      end

      # 使用二进制依赖
      def tdfire_use_binary!
        Tdfire::BinaryStateStore.set_use_binary
      end  

      # 强制使用二进制依赖,忽略未发布和依赖源码设置
      # def tdfire_force_use_binary!
      #   Tdfire::BinaryStateStore.set_force_use_binary
      # end

      # 外源组件依赖
      def tdfire_external_pods(pods, *rest)
      	argvs = rest.last || {}
        if !argvs.kind_of?(Hash)
          info =  <<-EOF
输入参数错误.

Example:
  tdfire_external_pods ['TDFCore'], source:'git', group:'ios', branch:'develop'
  tdfire_external_pods 'TDFCore', source:'git', group:'ios', branch:'develop'
  tdfire_external_pods ['TDFCore'], group:'cocoapods' 
  ...

默认值:
  source:path
  group:ios
  branch:develop

所有值:
  source -> git path
  group -> 任意
  branch -> 任意

格式可以和pod语法一致
EOF
          raise Pod::Informative, info
        end

        UI.puts argvs
        source = argvs[:source] || 'git'
        group = argvs[:group] || 'ios'
        branch = argvs[:branch] || 'develop'

        case source
          when 'path'
          Array(pods).each do |name|
              if File.exist?("../../#{name}/#{name}.podspec")
                pod name, :path => "../../#{name}"
              else
                pod name, :path => "../#{name}"
              end
          end
          when 'git'
          Array(pods).each do |name|
              pod name, :git => "git@git.2dfire-inc.com:#{group}/#{name}.git", :branch => "#{branch}"
          end
          else
        end
      end
    end
	end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cocoapods-tdfire-binary-0.1.10 lib/cocoapods-tdfire-binary/podfile_dsl.rb
cocoapods-tdfire-binary-0.1.9 lib/cocoapods-tdfire-binary/podfile_dsl.rb
cocoapods-tdfire-binary-0.1.8 lib/cocoapods-tdfire-binary/podfile_dsl.rb
cocoapods-tdfire-binary-0.1.7 lib/cocoapods-tdfire-binary/podfile_dsl.rb
cocoapods-tdfire-binary-0.1.6 lib/cocoapods-tdfire-binary/podfile_dsl.rb