Sha256: 4ee9d2349f3c8e87b2f645544d16ec806b5982d73c3211beeff56b09cd881839

Contents?: true

Size: 1.19 KB

Versions: 38

Compression:

Stored size: 1.19 KB

Contents


require 'cocoapods-lhj-bin/native/specification'

module Pod
  module ExternalSources
    # Provides support for fetching a specification file from a path local to
    # the machine running the installation.
    #
    class PathSource < AbstractExternalSource
      def normalized_podspec_path(declared_path)
        extension = File.extname(declared_path)

        if extension == '.podspec' || extension == '.json'
          path_with_ext = declared_path
        else
          # 默认先从 binary podspec 找起,因为 binary podspec 的 subspec 可能比 code podspec 多
          # 这里可能出现 code subspec 和 binary subspec 对应不上的情况,导致 lint 失败
          # 所以不要在 code podspec 同一目录下保留 binary podspec
          path_with_ext = Specification::VALID_EXTNAME
                          .map { |extname| "#{declared_path}/#{name}#{extname}" }
                          .find { |file| File.exist?(file) } || "#{declared_path}/#{name}.podspec"
        end

        UI.message "获取的 podspec 路径为 `#{path_with_ext}`"

        podfile_dir = File.dirname(podfile_path || '')

        File.expand_path(path_with_ext, podfile_dir)
      end
    end
  end
end

Version data entries

38 entries across 38 versions & 2 rubygems

Version Path
cocoapods-aomi-bin-0.1.28 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.27 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.26 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.25 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.24 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.23 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.22 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.21 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.20 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.19 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.18 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.17 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.16 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.15 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.14 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.13 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.12 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.11 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.10 lib/cocoapods-lhj-bin/native/path_source.rb
cocoapods-aomi-bin-0.1.9 lib/cocoapods-lhj-bin/native/path_source.rb