cocoapods 1.0.0.beta.4 → 1.0.0.beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a45e8f74520fb565c87e9868bddd55dc0fb6131
4
- data.tar.gz: 4f454b54f7246fe6b0b7eb3d4e46f83bf4aa8a88
3
+ metadata.gz: 351bd282c885de91d29ea0ce21df2f9fbebe22ad
4
+ data.tar.gz: a2b17616d19c1cc6971232c77fde0e36c1c559e1
5
5
  SHA512:
6
- metadata.gz: 284712afd5fcad4ab68829aa9976f8c2ef64c54a3554b93c69a637807187aa56c2ce050b62219529b7db976bad9a087e415d14227c337777103bacd63074fce7
7
- data.tar.gz: edc7840b2eb983949a1d45fb2688b8eb9175d070ea6f840f944ace9238024823fb75154b64e6272c12af610d74d56d99d30f0ba3c2ebe291ba4e9fb2e0a40e43
6
+ metadata.gz: b165cefed02d0efd9088f9acfaad7ca9e92a07df8e827b655965a9a42eabbc25796bd716e5fc7fd28feb3975411d5b7b57904bb1b8cd5b67c6d8944057ba79a9
7
+ data.tar.gz: 172057ccdbbba5eac50a33abb6d611d9f5409db97748e1fd36e348a8fbdea458101f534bfc4d4f0849f05e8a7cb9fc54dd4609dfff100525c8182f7fc9a0ef37
@@ -4,6 +4,57 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
4
4
 
5
5
  To install release candidates run `[sudo] gem install cocoapods --pre`
6
6
 
7
+ ## 1.0.0.beta.5 (2016-03-08)
8
+
9
+ ##### Breaking
10
+
11
+ * Development pods will no longer be implicitly unlocked. This makes CocoaPods
12
+ to respect constraints related to dependencies of development pods in the
13
+ lockfile.
14
+
15
+ If you change constraints of a dependency of your development pod, and want to
16
+ override the locked version, you will have to use
17
+ `pod update ${DEPENDENCY_NAME}` manually.
18
+ [Muhammed Yavuz Nuzumlalı](https://github.com/manuyavuz)
19
+ [#4211](https://github.com/CocoaPods/CocoaPods/issues/4211)
20
+ [#4577](https://github.com/CocoaPods/CocoaPods/issues/4577)
21
+ [#4580](https://github.com/CocoaPods/CocoaPods/issues/4580)
22
+
23
+ ##### Enhancements
24
+
25
+ * Add the :package: emoji in front of CocoaPods Script Build Phases
26
+ to quickly and visually differentiate them from other phases.
27
+ [Olivier Halligon](https://github.com/AliSoftware)
28
+ [#4985](https://github.com/CocoaPods/CocoaPods/issues/4985)
29
+
30
+ * Enable syntax highlighting on the Podfile in the generated
31
+ `Pods.xcodeproj`.
32
+ [Samuel Giddins](https://github.com/segiddins)
33
+ [#4962](https://github.com/CocoaPods/CocoaPods/issues/4962)
34
+
35
+ ##### Bug Fixes
36
+
37
+ * Fixes paths passed for resources bundles in the copy resources script.
38
+ [Marius Rackwitz](https://github.com/mrackwitz)
39
+ [#4954](https://github.com/CocoaPods/CocoaPods/pull/4954)
40
+
41
+ * Fix saying the `master` specs repo exists when it has not been set up.
42
+ [Samuel Giddins](https://github.com/segiddins)
43
+ [#4955](https://github.com/CocoaPods/CocoaPods/issues/4955)
44
+
45
+ * Move `${TARGET_DEVICE_ARGS}` out of the quotations for `--sdk` in the
46
+ `Copy Pods Resources` build phase.
47
+ [seaders](https://github.com/seaders) [#4940](https://github.com/CocoaPods/CocoaPods/issues/4940)
48
+
49
+ * Handle when `$PATH` isn't set.
50
+ [Samuel Giddins](https://github.com/segiddins)
51
+
52
+ * Module maps that are set per-platform will be installed for the correct
53
+ platform.
54
+ [Samuel Giddins](https://github.com/segiddins)
55
+ [#4968](https://github.com/CocoaPods/CocoaPods/issues/4968)
56
+
57
+
7
58
  ## 1.0.0.beta.4 (2016-02-24)
8
59
 
9
60
  ##### Enhancements
@@ -37,7 +37,7 @@ module Pod
37
37
  def validate!
38
38
  super
39
39
  help! 'A name for the Pod is required.' unless @name
40
- help! 'The Pod name cannot contain spaces.' if @name.match(/\s/)
40
+ help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
41
41
  help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
42
42
  end
43
43
 
@@ -135,13 +135,13 @@ module Pod
135
135
  !lockfile_roots.include?(pod)
136
136
  end
137
137
 
138
- if missing_pods.length > 0
139
- if missing_pods.length > 1
140
- message = "Pods `#{missing_pods.join('`, `')}` are not " \
141
- 'installed and cannot be updated'
142
- else
143
- message = "The `#{missing_pods.first}` Pod is not installed " \
144
- 'and cannot be updated'
138
+ unless missing_pods.empty?
139
+ message = if missing_pods.length > 1
140
+ "Pods `#{missing_pods.join('`, `')}` are not " \
141
+ 'installed and cannot be updated'
142
+ else
143
+ "The `#{missing_pods.first}` Pod is not installed " \
144
+ 'and cannot be updated'
145
145
  end
146
146
  raise Informative, message
147
147
  end
@@ -46,8 +46,7 @@ module Pod
46
46
  # @return [String] the output of the command (STDOUT and STDERR).
47
47
  #
48
48
  def self.execute_command(executable, command, raise_on_failure = true)
49
- bin = which(executable)
50
- raise Informative, "Unable to locate the executable `#{executable}`" unless bin
49
+ bin = which!(executable)
51
50
 
52
51
  command = command.map(&:to_s)
53
52
  full_command = "#{bin} #{command.join(' ')}"
@@ -87,7 +86,10 @@ module Pod
87
86
  #
88
87
  def self.which(program)
89
88
  program = program.to_s
90
- ENV['PATH'].split(File::PATH_SEPARATOR).each do |path|
89
+ paths = ENV.fetch('PATH') { '' }.split(File::PATH_SEPARATOR)
90
+ paths.unshift('./')
91
+ paths.uniq!
92
+ paths.each do |path|
91
93
  bin = File.expand_path(program, path)
92
94
  if File.file?(bin) && File.executable?(bin)
93
95
  return bin
@@ -96,6 +98,20 @@ module Pod
96
98
  nil
97
99
  end
98
100
 
101
+ # Returns the absolute path to the binary with the given name on the current
102
+ # `PATH`, or raises if none is found.
103
+ #
104
+ # @param [String] program
105
+ # The name of the program being searched for.
106
+ #
107
+ # @return [String] The absolute path to the given program.
108
+ #
109
+ def self.which!(program)
110
+ which(program).tap do |bin|
111
+ raise Informative, "Unable to locate the executable `#{executable}`" unless bin
112
+ end
113
+ end
114
+
99
115
  # Runs the given command, capturing the desired output.
100
116
  #
101
117
  # @param [String] bin
@@ -114,8 +130,7 @@ module Pod
114
130
  # running the command.
115
131
  #
116
132
  def self.capture_command(executable, command, capture: :merge)
117
- bin = which(executable)
118
- raise Informative, "Unable to locate the executable `#{executable}`" unless bin
133
+ bin = which!(executable)
119
134
 
120
135
  require 'open3'
121
136
  command = command.map(&:to_s)
@@ -43,7 +43,7 @@ module Pod
43
43
  #
44
44
  def podspec_uri
45
45
  declared_path = params[:podspec].to_s
46
- if declared_path.match(%r{^.+://})
46
+ if declared_path =~ %r{^.+://}
47
47
  declared_path
48
48
  else
49
49
  normalized_podspec_path(declared_path)
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.0.0.beta.4'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.0.0.beta.5'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -1,5 +1,3 @@
1
- # rubocop:disable LineLength
2
-
3
1
  module Pod
4
2
  module Generator
5
3
  class CopyResourcesScript
@@ -143,7 +141,7 @@ EOM
143
141
  case $RESOURCE_PATH in
144
142
  *\.storyboard)
145
143
  echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc $RESOURCE_PATH --sdk ${SDKROOT} ${TARGET_DEVICE_ARGS}"
146
- ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT} ${TARGET_DEVICE_ARGS}"
144
+ ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .storyboard`.storyboardc" "$RESOURCE_PATH" --sdk "${SDKROOT}" ${TARGET_DEVICE_ARGS}
147
145
  ;;
148
146
  *\.xib)
149
147
  echo "ibtool --reference-external-strings-file --errors --warnings --notices --minimum-deployment-target ${!DEPLOYMENT_TARGET_SETTING_NAME} --output-format human-readable-text --compile ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename \\"$RESOURCE_PATH\\" .xib`.nib $RESOURCE_PATH --sdk ${SDKROOT}"
@@ -552,12 +552,10 @@ module Pod
552
552
  #
553
553
  def prepare_pods_project
554
554
  UI.message '- Creating Pods project' do
555
- object_version = aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min
556
-
557
- if object_version
558
- @pods_project = Pod::Project.new(sandbox.project_path, false, object_version)
559
- else
560
- @pods_project = Pod::Project.new(sandbox.project_path)
555
+ @pods_project = if object_version = aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min
556
+ Pod::Project.new(sandbox.project_path, false, object_version)
557
+ else
558
+ Pod::Project.new(sandbox.project_path)
561
559
  end
562
560
 
563
561
  analysis_result.all_user_build_configurations.each do |name, type|
@@ -68,10 +68,11 @@ module Pod
68
68
  verify_platforms_specified!
69
69
  end
70
70
  @result.podfile_state = generate_podfile_state
71
- @locked_dependencies = generate_version_locking_dependencies
72
71
 
73
72
  store_existing_checkout_options
74
73
  fetch_external_sources if allow_fetches
74
+
75
+ @locked_dependencies = generate_version_locking_dependencies
75
76
  @result.specs_by_target = validate_platforms(resolve_dependencies)
76
77
  @result.specifications = generate_specifications
77
78
  @result.targets = generate_targets
@@ -417,8 +418,11 @@ module Pod
417
418
  else
418
419
  pods_to_update = result.podfile_state.changed + result.podfile_state.deleted
419
420
  pods_to_update += update[:pods] if update_mode == :selected
420
- pods_to_update += podfile.dependencies.select(&:local?).map(&:name)
421
- LockingDependencyAnalyzer.generate_version_locking_dependencies(lockfile, pods_to_update)
421
+ local_pod_names = podfile.dependencies.select(&:local?).map(&:root_name)
422
+ pods_to_unlock = local_pod_names.reject do |pod_name|
423
+ sandbox.specification(pod_name).checksum == lockfile.checksum(pod_name)
424
+ end
425
+ LockingDependencyAnalyzer.generate_version_locking_dependencies(lockfile, pods_to_update, pods_to_unlock)
422
426
  end
423
427
  end
424
428
 
@@ -466,10 +470,10 @@ module Pod
466
470
 
467
471
  def fetch_external_source(dependency, use_lockfile_options)
468
472
  checkout_options = lockfile.checkout_options_for_pod_named(dependency.root_name) if lockfile
469
- if checkout_options && use_lockfile_options
470
- source = ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file)
471
- else
472
- source = ExternalSources.from_dependency(dependency, podfile.defined_in_file)
473
+ source = if checkout_options && use_lockfile_options
474
+ ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file)
475
+ else
476
+ ExternalSources.from_dependency(dependency, podfile.defined_in_file)
473
477
  end
474
478
  source.can_cache = installation_options.clean?
475
479
  source.fetch(sandbox)
@@ -13,11 +13,23 @@ module Pod
13
13
  # is in update mode, to prevent it from upgrading the Pods that weren't
14
14
  # changed in the {Podfile}.
15
15
  #
16
+ # @param [Lockfile] lockfile the lockfile containing dependency constraints
17
+ #
18
+ # @param [Array<String>] pods_to_update
19
+ # List of pod names which needs to be updated because installer is
20
+ # in update mode for these pods. Pods in this list and all their recursive dependencies
21
+ # will not be included in generated dependency graph
22
+ #
23
+ # @param [Array<String>] pods_to_unlock
24
+ # List of pod names whose version constraints will be removed from the generated dependency graph.
25
+ # Recursive dependencies of the pods won't be affected. This is currently used to force local pods
26
+ # to be evaluated again whenever checksum of the specification of the local pods changes.
27
+ #
16
28
  # @return [Molinillo::DependencyGraph<Dependency>] the dependencies
17
29
  # generated by the lockfile that prevent the resolver to update
18
30
  # a Pod.
19
31
  #
20
- def self.generate_version_locking_dependencies(lockfile, pods_to_update)
32
+ def self.generate_version_locking_dependencies(lockfile, pods_to_update, pods_to_unlock = [])
21
33
  dependency_graph = Molinillo::DependencyGraph.new
22
34
 
23
35
  if lockfile
@@ -29,7 +41,7 @@ module Pod
29
41
 
30
42
  pods = lockfile.to_hash['PODS'] || []
31
43
  pods.each do |pod|
32
- add_to_dependency_graph(pod, [], dependency_graph)
44
+ add_to_dependency_graph(pod, [], dependency_graph, pods_to_unlock)
33
45
  end
34
46
 
35
47
  pods_to_update = pods_to_update.flat_map do |u|
@@ -56,20 +68,23 @@ module Pod
56
68
 
57
69
  private
58
70
 
59
- def self.add_child_vertex_to_graph(dependency_string, parents, dependency_graph)
71
+ def self.add_child_vertex_to_graph(dependency_string, parents, dependency_graph, pods_to_unlock)
60
72
  dependency = Dependency.from_string(dependency_string)
73
+ if pods_to_unlock.include?(dependency.root_name)
74
+ dependency = Dependency.new(dependency.name)
75
+ end
61
76
  dependency_graph.add_child_vertex(dependency.name, parents.empty? ? dependency : nil, parents, nil)
62
77
  dependency
63
78
  end
64
79
 
65
- def self.add_to_dependency_graph(object, parents, dependency_graph)
80
+ def self.add_to_dependency_graph(object, parents, dependency_graph, pods_to_unlock)
66
81
  case object
67
82
  when String
68
- add_child_vertex_to_graph(object, parents, dependency_graph)
83
+ add_child_vertex_to_graph(object, parents, dependency_graph, pods_to_unlock)
69
84
  when Hash
70
85
  object.each do |key, value|
71
- dependency = add_child_vertex_to_graph(key, parents, dependency_graph)
72
- value.each { |v| add_to_dependency_graph(v, [dependency.name], dependency_graph) }
86
+ dependency = add_child_vertex_to_graph(key, parents, dependency_graph, pods_to_unlock)
87
+ value.each { |v| add_to_dependency_graph(v, [dependency.name], dependency_graph, pods_to_unlock) }
73
88
  end
74
89
  end
75
90
  end
@@ -94,12 +94,12 @@ module Pod
94
94
  def scope_by_specs
95
95
  root_spec = variants.first.root_spec
96
96
  specs = [root_spec]
97
- if root_spec.default_subspecs.empty?
98
- specs += root_spec.subspecs.compact
99
- else
100
- specs += root_spec.default_subspecs.map do |subspec_name|
101
- root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
102
- end
97
+ specs += if root_spec.default_subspecs.empty?
98
+ root_spec.subspecs.compact
99
+ else
100
+ root_spec.default_subspecs.map do |subspec_name|
101
+ root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
102
+ end
103
103
  end
104
104
  default_specs = Set.new(specs)
105
105
  grouped_variants = group_by(&:specs)
@@ -107,15 +107,18 @@ module Pod
107
107
  library_targets = target.pod_targets.reject do |pod_target|
108
108
  pod_target.should_build? && pod_target.requires_frameworks?
109
109
  end
110
- resources_by_config = {}
111
- target.user_build_configurations.keys.each do |config|
112
- file_accessors = library_targets.select { |t| t.include_in_build_config?(target_definition, config) }.flat_map(&:file_accessors)
113
- resource_paths = file_accessors.flat_map { |accessor| accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) } }
114
- resource_bundles = file_accessors.flat_map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name.shellescape}.bundle" } }
115
- resources_by_config[config] = (resource_paths + resource_bundles).uniq
116
- resources_by_config[config] << bridge_support_file if bridge_support_file
110
+ target.user_build_configurations.keys.each_with_object({}) do |config, resources_by_config|
111
+ resources_by_config[config] = library_targets.flat_map do |library_target|
112
+ next [] unless library_target.include_in_build_config?(target_definition, config)
113
+ resource_paths = library_target.file_accessors.flat_map do |accessor|
114
+ accessor.resources.flat_map { |res| res.relative_path_from(project.path.dirname) }
115
+ end
116
+ resource_bundles = library_target.file_accessors.flat_map do |accessor|
117
+ accessor.resource_bundles.keys.map { |name| "#{library_target.configuration_build_dir}/#{name.shellescape}.bundle" }
118
+ end
119
+ (resource_paths + resource_bundles + [bridge_support_file].compact).uniq
120
+ end
117
121
  end
118
- resources_by_config
119
122
  end
120
123
 
121
124
  # Creates a script that copies the resources to the bundle of the client
@@ -24,12 +24,12 @@ module Pod
24
24
  create_info_plist_file
25
25
  create_module_map
26
26
  create_umbrella_header do |generator|
27
- if header_mappings_dir
28
- generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname|
29
- pathname.relative_path_from(header_mappings_dir)
30
- end
31
- else
32
- generator.imports += target.file_accessors.flat_map(&:public_headers).map(&:basename)
27
+ generator.imports += if header_mappings_dir
28
+ target.file_accessors.flat_map(&:public_headers).map do |pathname|
29
+ pathname.relative_path_from(header_mappings_dir)
30
+ end
31
+ else
32
+ target.file_accessors.flat_map(&:public_headers).map(&:basename)
33
33
  end
34
34
  end
35
35
  end
@@ -9,6 +9,14 @@ module Pod
9
9
  class TargetIntegrator
10
10
  autoload :XCConfigIntegrator, 'cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator'
11
11
 
12
+ # @return [String] the PACKAGE emoji to use as prefix for every build phase aded to the user project
13
+ #
14
+ BUILD_PHASE_PREFIX = "\u{1F4E6} ".freeze
15
+
16
+ # @return [String] the name of the check manifest phase
17
+ #
18
+ CHECK_MANIFEST_PHASE_NAME = 'Check Pods Manifest.lock'.freeze
19
+
12
20
  # @return [Array<Symbol>] the symbol types, which require that the pod
13
21
  # frameworks are embedded in the output directory / product bundle.
14
22
  #
@@ -18,6 +26,10 @@ module Pod
18
26
  #
19
27
  EMBED_FRAMEWORK_PHASE_NAME = 'Embed Pods Frameworks'.freeze
20
28
 
29
+ # @return [String] the name of the copy resources phase
30
+ #
31
+ COPY_PODS_RESOURCES_PHASE_NAME = 'Copy Pods Resources'.freeze
32
+
21
33
  # @return [AggregateTarget] the target that should be integrated.
22
34
  #
23
35
  attr_reader :target
@@ -121,7 +133,7 @@ module Pod
121
133
  # @return [void]
122
134
  #
123
135
  def add_copy_resources_script_phase
124
- phase_name = 'Copy Pods Resources'
136
+ phase_name = COPY_PODS_RESOURCES_PHASE_NAME
125
137
  native_targets.each do |native_target|
126
138
  phase = create_or_update_build_phase(native_target, phase_name)
127
139
  script_path = target.copy_resources_script_relative_path
@@ -139,7 +151,7 @@ module Pod
139
151
  # @return [void]
140
152
  #
141
153
  def add_check_manifest_lock_script_phase
142
- phase_name = 'Check Pods Manifest.lock'
154
+ phase_name = CHECK_MANIFEST_PHASE_NAME
143
155
  native_targets.each do |native_target|
144
156
  phase = create_or_update_build_phase(native_target, phase_name)
145
157
  native_target.build_phases.unshift(phase).uniq! unless native_target.build_phases.first == phase
@@ -201,10 +213,13 @@ module Pod
201
213
  end
202
214
 
203
215
  def create_or_update_build_phase(target, phase_name, phase_class = Xcodeproj::Project::Object::PBXShellScriptBuildPhase)
204
- target.build_phases.grep(phase_class).find { |phase| phase.name == phase_name } ||
216
+ prefixed_phase_name = BUILD_PHASE_PREFIX + phase_name
217
+ build_phases = target.build_phases.grep(phase_class)
218
+ build_phases.find { |phase| phase.name == prefixed_phase_name } ||
219
+ build_phases.find { |phase| phase.name == phase_name }.tap { |p| p.name = prefixed_phase_name if p } ||
205
220
  target.project.new(phase_class).tap do |phase|
206
- UI.message("Adding Build Phase '#{phase_name}' to project.") do
207
- phase.name = phase_name
221
+ UI.message("Adding Build Phase '#{prefixed_phase_name}' to project.") do
222
+ phase.name = prefixed_phase_name
208
223
  phase.show_env_vars_in_log = '0'
209
224
  target.build_phases << phase
210
225
  end
@@ -215,10 +215,11 @@ module Pod
215
215
  # @return [PBXFileReference] The new file reference.
216
216
  #
217
217
  def add_podfile(podfile_path)
218
- podfile_ref = new_file(podfile_path, :project)
219
- podfile_ref.xc_language_specification_identifier = 'xcode.lang.ruby'
220
- podfile_ref.last_known_file_type = 'text'
221
- podfile_ref
218
+ new_file(podfile_path, :project).tap do |podfile_ref|
219
+ podfile_ref.xc_language_specification_identifier = 'xcode.lang.ruby'
220
+ podfile_ref.explicit_file_type = 'text.script.ruby'
221
+ podfile_ref.last_known_file_type = 'text'
222
+ end
222
223
  end
223
224
 
224
225
  # Adds a new build configuration to the project and populates it with
@@ -104,13 +104,7 @@ module Pod
104
104
  def search_for(dependency)
105
105
  @search ||= {}
106
106
  @search[dependency] ||= begin
107
- requirement = Requirement.new(dependency.requirement.as_list << requirement_for_locked_pod_named(dependency.name))
108
- find_cached_set(dependency).
109
- all_specifications.
110
- select { |s| requirement.satisfied_by? s.version }.
111
- map { |s| s.subspec_by_name(dependency.name, false) }.
112
- compact.
113
- reverse
107
+ specifications_for_dependency(dependency, [requirement_for_locked_pod_named(dependency.name)])
114
108
  end
115
109
  @search[dependency].dup
116
110
  end
@@ -279,6 +273,27 @@ module Pod
279
273
 
280
274
  # @!group Private helpers
281
275
 
276
+ # Returns available specifications which satisfy requirements of given dependency
277
+ # and additional requirements.
278
+ #
279
+ # @param [Dependency] dependency
280
+ # The dependency whose requirements will be satisfied.
281
+ #
282
+ # @param [Array<Requirement>] additional_requirements
283
+ # List of additional requirements which should also be satisfied.
284
+ #
285
+ # @return [Array<Specification>] List of specifications satisfying given requirements.
286
+ #
287
+ def specifications_for_dependency(dependency, additional_requirements = [])
288
+ requirement = Requirement.new(dependency.requirement.as_list + additional_requirements)
289
+ find_cached_set(dependency).
290
+ all_specifications.
291
+ select { |s| requirement.satisfied_by? s.version }.
292
+ map { |s| s.subspec_by_name(dependency.name, false) }.
293
+ compact.
294
+ reverse
295
+ end
296
+
282
297
  # @return [Set] Loads or returns a previously initialized set for the Pod
283
298
  # of the given dependency.
284
299
  #
@@ -367,11 +382,13 @@ module Pod
367
382
  # @param [Molinillo::ResolverError] error
368
383
  #
369
384
  def handle_resolver_error(error)
370
- message = error.message
385
+ message = error.message.dup
371
386
  case error
372
387
  when Molinillo::VersionConflict
373
388
  error.conflicts.each do |name, conflict|
389
+ local_pod_parent = conflict.requirement_trees.flatten.reverse.find(&:local?)
374
390
  lockfile_reqs = conflict.requirements[name_for_locking_dependency_source]
391
+
375
392
  if lockfile_reqs && lockfile_reqs.last && lockfile_reqs.last.prerelease? && !conflict.existing
376
393
  message = 'Due to the previous naïve CocoaPods resolver, ' \
377
394
  "you were using a pre-release version of `#{name}`, " \
@@ -380,6 +397,12 @@ module Pod
380
397
  'version requirement to your Podfile ' \
381
398
  "(e.g. `pod '#{name}', '#{lockfile_reqs.map(&:requirement).join("', '")}'`) " \
382
399
  "or revert to a stable version by running `pod update #{name}`."
400
+ elsif local_pod_parent && !specifications_for_dependency(conflict.requirement).empty?
401
+ # Conflict was caused by a requirement from a local dependency.
402
+ # Tell user to use `pod update`.
403
+ message << "\n\nIt seems like you've changed the constraints of dependency `#{name}` " \
404
+ "inside your development pod `#{local_pod_parent.name}`.\nYou should run `pod update #{name}` to apply " \
405
+ "changes you've made."
383
406
  elsif (conflict.possibility && conflict.possibility.version.prerelease?) &&
384
407
  (conflict.requirement && !(
385
408
  conflict.requirement.prerelease? ||
@@ -259,8 +259,8 @@ module Pod
259
259
  # @return [Pathname] The of the prefix header file of the specification.
260
260
  #
261
261
  def prefix_header
262
- if spec_consumer.prefix_header_file
263
- path_list.root + spec_consumer.prefix_header_file
262
+ if file = spec_consumer.prefix_header_file
263
+ path_list.root + file
264
264
  end
265
265
  end
266
266
 
@@ -274,8 +274,8 @@ module Pod
274
274
  # specification or auto-detected.
275
275
  #
276
276
  def license
277
- if spec_consumer.spec.root.license[:file]
278
- path_list.root + spec_consumer.spec.root.license[:file]
277
+ if file = spec_consumer.license[:file]
278
+ path_list.root + file
279
279
  else
280
280
  path_list.glob([GLOB_PATTERNS[:license]]).first
281
281
  end
@@ -284,7 +284,7 @@ module Pod
284
284
  # @return [Pathname, Nil] The path of the custom module map file of the
285
285
  # specification, if specified.
286
286
  def module_map
287
- if module_map = spec_consumer.spec.root.module_map
287
+ if module_map = spec_consumer.module_map
288
288
  path_list.root + module_map
289
289
  end
290
290
  end
@@ -103,7 +103,7 @@ module Pod
103
103
  # @return [Array<Source>] The CocoaPods Master Repo source.
104
104
  #
105
105
  def master
106
- sources(['master'])
106
+ sources(['master']).select { |s| s.repo.directory? }
107
107
  end
108
108
 
109
109
  # Search the appropriate sources to match the set for the given dependency.
@@ -340,8 +340,9 @@ module Pod
340
340
  # @return [Bool] Whether the given source is a GIT repo.
341
341
  #
342
342
  def git_repo?(dir)
343
- Dir.chdir(dir) { `git rev-parse >/dev/null 2>&1` }
344
- $?.success?
343
+ Dir.chdir(dir) do
344
+ Executable.capture_command('git', %w(rev-parse), :capture => :none).success?
345
+ end
345
346
  end
346
347
 
347
348
  # Checks the version information of the source with the given directory.
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.beta.4
4
+ version: 1.0.0.beta.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eloy Duran
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2016-02-23 00:00:00.000000000 Z
14
+ date: 2016-03-07 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,21 +19,21 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.0.0.beta.4
22
+ version: 1.0.0.beta.5
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
27
  - - '='
28
28
  - !ruby/object:Gem::Version
29
- version: 1.0.0.beta.4
29
+ version: 1.0.0.beta.5
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
33
33
  requirements:
34
34
  - - '>='
35
35
  - !ruby/object:Gem::Version
36
- version: 1.0.0.beta.1
36
+ version: 1.0.0.beta.2
37
37
  - - <
38
38
  - !ruby/object:Gem::Version
39
39
  version: '2.0'
@@ -43,7 +43,7 @@ dependencies:
43
43
  requirements:
44
44
  - - '>='
45
45
  - !ruby/object:Gem::Version
46
- version: 1.0.0.beta.1
46
+ version: 1.0.0.beta.2
47
47
  - - <
48
48
  - !ruby/object:Gem::Version
49
49
  version: '2.0'
@@ -193,14 +193,14 @@ dependencies:
193
193
  requirements:
194
194
  - - ~>
195
195
  - !ruby/object:Gem::Version
196
- version: 0.4.3
196
+ version: 0.4.4
197
197
  type: :runtime
198
198
  prerelease: false
199
199
  version_requirements: !ruby/object:Gem::Requirement
200
200
  requirements:
201
201
  - - ~>
202
202
  - !ruby/object:Gem::Version
203
- version: 0.4.3
203
+ version: 0.4.4
204
204
  - !ruby/object:Gem::Dependency
205
205
  name: xcodeproj
206
206
  requirement: !ruby/object:Gem::Requirement
@@ -473,7 +473,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
473
473
  version: '0'
474
474
  requirements: []
475
475
  rubyforge_project:
476
- rubygems_version: 2.5.2
476
+ rubygems_version: 2.6.1
477
477
  signing_key:
478
478
  specification_version: 3
479
479
  summary: The Cocoa library package manager.