Sha256: 050d6b1b7ee8a239a319a152c604c433590fc95306330a7958b5018b33ebf0f6

Contents?: true

Size: 1.21 KB

Versions: 5

Compression:

Stored size: 1.21 KB

Contents

module Pod
  class Prebuild

    # Check the targets, for the current limitation of the plugin
    #
    # @param [Array<PodTarget>] prebuilt_targets
    def self.check_one_pod_should_have_only_one_target(prebuilt_targets)

      targets_have_different_platforms = prebuilt_targets.select {|t| t.pod_name != t.name }

      if targets_have_different_platforms.count > 0
        names = targets_have_different_platforms.map(&:pod_name)
        raw_names = targets_have_different_platforms.map(&:name)
        message = "Oops, you came across a limitation of cocoapods-xlbuild.

The plugin requires that one pod should have ONLY ONE target in the 'Pod.xcodeproj'. There are mainly 2 situations \
causing this problem:

1. One pod integrates in 2 or more different platforms' targets. e.g.
    ```
    target 'iphoneApp' do
      pod 'A', :xlbuild => true
    end
    target 'watchApp' do
      pod 'A'
    end
    ```

2. Use different subspecs in multiple targets. e.g.
    ```
    target 'iphoneApp' do
      pod 'A/core'
      pod 'A/network'
    end
    target 'iphoneAppTest' do
      pod 'A/core'
    end
    ```

Related pods: #{names}, target names: #{raw_names}
        "
        raise Informative, message
      end
    end


  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
cocoapods-xlbuild-1.1.2 lib/cocoapods-xlbuild/helper/target_checker.rb
cocoapods-xlbuild-1.1.1 lib/cocoapods-xlbuild/helper/target_checker.rb
cocoapods-xlbuild-1.1.0 lib/cocoapods-xlbuild/helper/target_checker.rb
cocoapods-xlbuild-1.0.1 lib/cocoapods-xlbuild/helper/target_checker.rb
cocoapods-xlbuild-1.0.0 lib/cocoapods-xlbuild/helper/target_checker.rb