Sha256: f66fefdbc2a988653241bf7849d818dd9bba2296ff2df523ac45572663e876d9

Contents?: true

Size: 1.52 KB

Versions: 13

Compression:

Stored size: 1.52 KB

Contents


require 'cocoapods'
require 'cocoapods-bb-bin/config/config'

module Pod
  class Source
    class Manager

      def initLibEnv(isGenDylib=false)
        @dylib = isGenDylib
        UI.puts "初始化源环境support dylib:#{isGenDylib}"
      end

      # 源码 source
      def code_source
        if supportDylibSource # 动态库
          source_with_name_or_url(CBin.config.sourceV2_repo_url)
        else # 静态库
          source_with_name_or_url(CBin.config.code_repo_url)
        end
      end

      # 静态库二进制源
      def static_binary_source
        source_with_name_or_url(CBin.config.binary_repo_url)
      end
      # 动态库二进制源
      def dylib_binary_source
        source_with_name_or_url(CBin.config.dylib_repo_url)
      end

      # 二进制 source (区分动态库还是静态库)
      def binary_source
        return supportDylibSource ? dylib_binary_source : static_binary_source
      end

      # 是否支持动态库
      def supportDylibSource
        if @dylib
          return true
        else
          # 优先解析podfile中source动态配置是否添加动态库源
          podfile = Pod::Config.instance.podfile
          if podfile
            dylib_source = CBin.config.dylib_repo_url
            podfile.sources.map do |source|
              if source === dylib_source
                UI.puts "切换到动态库源:#{dylib_binary_source}"
                return true
              end
            end
          end
          return false
        end
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cocoapods-bb-bin-0.2.9.0 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.8.1 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.8 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.13 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.12 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.11 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.10 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.9 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.8 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.7 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.6 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.5 lib/cocoapods-bb-bin/native/sources_manager.rb
cocoapods-bb-bin-0.2.7.4 lib/cocoapods-bb-bin/native/sources_manager.rb