cocoapods 1.5.2 → 1.6.1

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.
Files changed (81) hide show
  1. checksums.yaml +5 -5
  2. data/CHANGELOG.md +365 -1
  3. data/bin/pod +1 -1
  4. data/lib/cocoapods/command/cache/clean.rb +1 -1
  5. data/lib/cocoapods/command/init.rb +4 -2
  6. data/lib/cocoapods/command/install.rb +7 -0
  7. data/lib/cocoapods/command/lib/lint.rb +8 -1
  8. data/lib/cocoapods/command/outdated.rb +4 -9
  9. data/lib/cocoapods/command/repo/add.rb +1 -1
  10. data/lib/cocoapods/command/repo/list.rb +1 -1
  11. data/lib/cocoapods/command/repo/push.rb +17 -12
  12. data/lib/cocoapods/command/repo/remove.rb +1 -1
  13. data/lib/cocoapods/command/repo/update.rb +1 -1
  14. data/lib/cocoapods/command/setup.rb +1 -1
  15. data/lib/cocoapods/command/spec/create.rb +39 -39
  16. data/lib/cocoapods/command/spec/lint.rb +8 -1
  17. data/lib/cocoapods/command.rb +3 -1
  18. data/lib/cocoapods/config.rb +13 -2
  19. data/lib/cocoapods/downloader/cache.rb +1 -1
  20. data/lib/cocoapods/executable.rb +3 -3
  21. data/lib/cocoapods/external_sources/abstract_external_source.rb +23 -13
  22. data/lib/cocoapods/external_sources.rb +7 -4
  23. data/lib/cocoapods/gem_version.rb +1 -1
  24. data/lib/cocoapods/generator/acknowledgements/markdown.rb +6 -0
  25. data/lib/cocoapods/generator/acknowledgements/plist.rb +13 -2
  26. data/lib/cocoapods/generator/app_target_helper.rb +141 -17
  27. data/lib/cocoapods/generator/copy_resources_script.rb +14 -3
  28. data/lib/cocoapods/generator/dummy_source.rb +14 -5
  29. data/lib/cocoapods/generator/embed_frameworks_script.rb +37 -20
  30. data/lib/cocoapods/generator/header.rb +1 -1
  31. data/lib/cocoapods/generator/info_plist_file.rb +12 -4
  32. data/lib/cocoapods/generator/prefix_header.rb +2 -2
  33. data/lib/cocoapods/hooks_manager.rb +28 -17
  34. data/lib/cocoapods/installer/analyzer/analysis_result.rb +52 -22
  35. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +14 -6
  36. data/lib/cocoapods/installer/analyzer/pod_variant.rb +4 -5
  37. data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +3 -14
  38. data/lib/cocoapods/installer/analyzer/specs_state.rb +28 -4
  39. data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +27 -14
  40. data/lib/cocoapods/installer/analyzer/target_inspector.rb +17 -11
  41. data/lib/cocoapods/installer/analyzer.rb +391 -284
  42. data/lib/cocoapods/installer/installation_options.rb +2 -0
  43. data/lib/cocoapods/installer/pod_source_installer.rb +31 -43
  44. data/lib/cocoapods/installer/post_install_hooks_context.rb +72 -47
  45. data/lib/cocoapods/installer/pre_install_hooks_context.rb +22 -13
  46. data/lib/cocoapods/installer/source_provider_hooks_context.rb +3 -1
  47. data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +44 -11
  48. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +69 -29
  49. data/lib/cocoapods/installer/user_project_integrator.rb +6 -4
  50. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +25 -16
  51. data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +104 -0
  52. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +23 -50
  53. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +296 -177
  54. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +51 -33
  55. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +93 -0
  56. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +62 -69
  57. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb +72 -0
  58. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +130 -122
  59. data/lib/cocoapods/installer/xcode/target_validator.rb +15 -9
  60. data/lib/cocoapods/installer.rb +140 -63
  61. data/lib/cocoapods/project.rb +16 -14
  62. data/lib/cocoapods/resolver/resolver_specification.rb +41 -0
  63. data/lib/cocoapods/resolver.rb +79 -98
  64. data/lib/cocoapods/sandbox/file_accessor.rb +11 -6
  65. data/lib/cocoapods/sandbox/headers_store.rb +9 -8
  66. data/lib/cocoapods/sandbox/path_list.rb +5 -8
  67. data/lib/cocoapods/sandbox.rb +31 -43
  68. data/lib/cocoapods/sources_manager.rb +1 -1
  69. data/lib/cocoapods/target/aggregate_target.rb +143 -85
  70. data/lib/cocoapods/target/build_settings.rb +1124 -0
  71. data/lib/cocoapods/target/framework_paths.rb +36 -0
  72. data/lib/cocoapods/target/pod_target.rb +198 -295
  73. data/lib/cocoapods/target.rb +92 -37
  74. data/lib/cocoapods/user_interface.rb +5 -0
  75. data/lib/cocoapods/validator.rb +149 -44
  76. data/lib/cocoapods.rb +0 -1
  77. metadata +31 -23
  78. data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +0 -260
  79. data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +0 -87
  80. data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +0 -558
  81. data/lib/cocoapods/generator/xcconfig.rb +0 -13
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.5.2
4
+ version: 1.6.1
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: 2018-05-09 00:00:00.000000000 Z
14
+ date: 2019-02-21 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: cocoapods-core
@@ -19,14 +19,14 @@ dependencies:
19
19
  requirements:
20
20
  - - '='
21
21
  - !ruby/object:Gem::Version
22
- version: 1.5.2
22
+ version: 1.6.1
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.5.2
29
+ version: 1.6.1
30
30
  - !ruby/object:Gem::Dependency
31
31
  name: claide
32
32
  requirement: !ruby/object:Gem::Requirement
@@ -73,7 +73,7 @@ dependencies:
73
73
  requirements:
74
74
  - - ">="
75
75
  - !ruby/object:Gem::Version
76
- version: 1.2.0
76
+ version: 1.2.2
77
77
  - - "<"
78
78
  - !ruby/object:Gem::Version
79
79
  version: '2.0'
@@ -83,7 +83,7 @@ dependencies:
83
83
  requirements:
84
84
  - - ">="
85
85
  - !ruby/object:Gem::Version
86
- version: 1.2.0
86
+ version: 1.2.2
87
87
  - - "<"
88
88
  - !ruby/object:Gem::Version
89
89
  version: '2.0'
@@ -153,7 +153,7 @@ dependencies:
153
153
  requirements:
154
154
  - - ">="
155
155
  - !ruby/object:Gem::Version
156
- version: 1.3.0
156
+ version: 1.3.1
157
157
  - - "<"
158
158
  - !ruby/object:Gem::Version
159
159
  version: '2.0'
@@ -163,7 +163,7 @@ dependencies:
163
163
  requirements:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
- version: 1.3.0
166
+ version: 1.3.1
167
167
  - - "<"
168
168
  - !ruby/object:Gem::Version
169
169
  version: '2.0'
@@ -193,21 +193,21 @@ dependencies:
193
193
  requirements:
194
194
  - - "~>"
195
195
  - !ruby/object:Gem::Version
196
- version: 0.6.5
196
+ version: 0.6.6
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.6.5
203
+ version: 0.6.6
204
204
  - !ruby/object:Gem::Dependency
205
205
  name: xcodeproj
206
206
  requirement: !ruby/object:Gem::Requirement
207
207
  requirements:
208
208
  - - ">="
209
209
  - !ruby/object:Gem::Version
210
- version: 1.5.7
210
+ version: 1.8.1
211
211
  - - "<"
212
212
  - !ruby/object:Gem::Version
213
213
  version: '2.0'
@@ -217,7 +217,7 @@ dependencies:
217
217
  requirements:
218
218
  - - ">="
219
219
  - !ruby/object:Gem::Version
220
- version: 1.5.7
220
+ version: 1.8.1
221
221
  - - "<"
222
222
  - !ruby/object:Gem::Version
223
223
  version: '2.0'
@@ -273,16 +273,22 @@ dependencies:
273
273
  name: fourflusher
274
274
  requirement: !ruby/object:Gem::Requirement
275
275
  requirements:
276
- - - "~>"
276
+ - - ">="
277
277
  - !ruby/object:Gem::Version
278
- version: 2.0.1
278
+ version: 2.2.0
279
+ - - "<"
280
+ - !ruby/object:Gem::Version
281
+ version: '3.0'
279
282
  type: :runtime
280
283
  prerelease: false
281
284
  version_requirements: !ruby/object:Gem::Requirement
282
285
  requirements:
283
- - - "~>"
286
+ - - ">="
287
+ - !ruby/object:Gem::Version
288
+ version: 2.2.0
289
+ - - "<"
284
290
  - !ruby/object:Gem::Version
285
- version: 2.0.1
291
+ version: '3.0'
286
292
  - !ruby/object:Gem::Dependency
287
293
  name: gh_inspector
288
294
  requirement: !ruby/object:Gem::Requirement
@@ -317,14 +323,14 @@ dependencies:
317
323
  requirements:
318
324
  - - "~>"
319
325
  - !ruby/object:Gem::Version
320
- version: '1.1'
326
+ version: '1.4'
321
327
  type: :runtime
322
328
  prerelease: false
323
329
  version_requirements: !ruby/object:Gem::Requirement
324
330
  requirements:
325
331
  - - "~>"
326
332
  - !ruby/object:Gem::Version
327
- version: '1.1'
333
+ version: '1.4'
328
334
  - !ruby/object:Gem::Dependency
329
335
  name: bacon
330
336
  requirement: !ruby/object:Gem::Requirement
@@ -454,10 +460,6 @@ files:
454
460
  - lib/cocoapods/generator/module_map.rb
455
461
  - lib/cocoapods/generator/prefix_header.rb
456
462
  - lib/cocoapods/generator/umbrella_header.rb
457
- - lib/cocoapods/generator/xcconfig.rb
458
- - lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb
459
- - lib/cocoapods/generator/xcconfig/pod_xcconfig.rb
460
- - lib/cocoapods/generator/xcconfig/xcconfig_helper.rb
461
463
  - lib/cocoapods/hooks_manager.rb
462
464
  - lib/cocoapods/installer.rb
463
465
  - lib/cocoapods/installer/analyzer.rb
@@ -483,15 +485,19 @@ files:
483
485
  - lib/cocoapods/installer/xcode.rb
484
486
  - lib/cocoapods/installer/xcode/pods_project_generator.rb
485
487
  - lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb
488
+ - lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb
486
489
  - lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb
487
490
  - lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb
488
491
  - lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb
492
+ - lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb
489
493
  - lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb
494
+ - lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb
490
495
  - lib/cocoapods/installer/xcode/target_validator.rb
491
496
  - lib/cocoapods/open-uri.rb
492
497
  - lib/cocoapods/project.rb
493
498
  - lib/cocoapods/resolver.rb
494
499
  - lib/cocoapods/resolver/lazy_specification.rb
500
+ - lib/cocoapods/resolver/resolver_specification.rb
495
501
  - lib/cocoapods/sandbox.rb
496
502
  - lib/cocoapods/sandbox/file_accessor.rb
497
503
  - lib/cocoapods/sandbox/headers_store.rb
@@ -501,6 +507,8 @@ files:
501
507
  - lib/cocoapods/sources_manager.rb
502
508
  - lib/cocoapods/target.rb
503
509
  - lib/cocoapods/target/aggregate_target.rb
510
+ - lib/cocoapods/target/build_settings.rb
511
+ - lib/cocoapods/target/framework_paths.rb
504
512
  - lib/cocoapods/target/pod_target.rb
505
513
  - lib/cocoapods/user_interface.rb
506
514
  - lib/cocoapods/user_interface/error_report.rb
@@ -526,7 +534,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
526
534
  version: '0'
527
535
  requirements: []
528
536
  rubyforge_project:
529
- rubygems_version: 2.7.6
537
+ rubygems_version: 2.6.14
530
538
  signing_key:
531
539
  specification_version: 3
532
540
  summary: The Cocoa library package manager.
@@ -1,260 +0,0 @@
1
- module Pod
2
- module Generator
3
- module XCConfig
4
- # Generates the xcconfigs for the aggregate targets.
5
- #
6
- class AggregateXCConfig
7
- # @return [AggregateTarget] the target represented by this xcconfig.
8
- #
9
- attr_reader :target
10
-
11
- # @return [String] the name of the build configuration to generate this
12
- # xcconfig for.
13
- #
14
- attr_reader :configuration_name
15
-
16
- # Initialize a new instance
17
- #
18
- # @param [Target] target @see target
19
- #
20
- # @param [String] configuration_name @see configuration_name
21
- #
22
- def initialize(target, configuration_name)
23
- @target = target
24
- @configuration_name = configuration_name
25
- end
26
-
27
- # @return [Xcodeproj::Config] The generated xcconfig.
28
- #
29
- attr_reader :xcconfig
30
-
31
- # Generates and saves the xcconfig to the given path.
32
- #
33
- # @param [Pathname] path
34
- # the path where the xcconfig should be stored.
35
- #
36
- # @return [void]
37
- #
38
- def save_as(path)
39
- generate.save_as(path)
40
- end
41
-
42
- # Generates the xcconfig.
43
- #
44
- # @note The xcconfig file for a Pods integration target includes the
45
- # namespaced xcconfig files for each spec target dependency.
46
- # Each namespaced configuration value is merged into the Pod
47
- # xcconfig file.
48
- #
49
- # @todo This doesn't include the specs xcconfigs anymore and now the
50
- # logic is duplicated.
51
- #
52
- # @return [Xcodeproj::Config]
53
- #
54
- def generate
55
- includes_static_libs = !target.requires_frameworks?
56
- includes_static_libs ||= pod_targets.flat_map(&:file_accessors).any? { |fa| !fa.vendored_static_artifacts.empty? }
57
- config = {
58
- 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
59
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
60
- 'HEADER_SEARCH_PATHS' => '$(inherited) ',
61
- 'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
62
- 'OTHER_CFLAGS' => '$(inherited) ',
63
- 'OTHER_LDFLAGS' => '$(inherited) ' + XCConfigHelper.default_ld_flags(target, includes_static_libs),
64
- 'OTHER_SWIFT_FLAGS' => '$(inherited) ',
65
- 'PODS_PODFILE_DIR_PATH' => target.podfile_dir_relative_path,
66
- 'PODS_ROOT' => target.relative_pods_root,
67
- 'SWIFT_INCLUDE_PATHS' => '$(inherited) ',
68
- }.merge(embedded_content_settings)
69
-
70
- @xcconfig = Xcodeproj::Config.new(config)
71
-
72
- @xcconfig.merge!(merged_user_target_xcconfigs)
73
-
74
- generate_settings_to_import_pod_targets
75
-
76
- XCConfigHelper.add_target_specific_settings(target, @xcconfig)
77
-
78
- targets = pod_targets + target.search_paths_aggregate_targets.flat_map(&:pod_targets)
79
- XCConfigHelper.generate_vendored_build_settings(target, targets, @xcconfig)
80
- XCConfigHelper.generate_other_ld_flags(target, pod_targets, @xcconfig)
81
-
82
- # TODO: Need to decide how we are going to ensure settings like these
83
- # are always excluded from the user's project.
84
- #
85
- # See https://github.com/CocoaPods/CocoaPods/issues/1216
86
- @xcconfig.attributes.delete('USE_HEADERMAP')
87
-
88
- # If any of the aggregate target dependencies bring in any vendored dynamic artifacts we should ensure to
89
- # update the runpath search paths.
90
- vendored_dynamic_artifacts = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_dynamic_artifacts)
91
-
92
- symbol_type = target.user_targets.map(&:symbol_type).uniq.first
93
- test_bundle = symbol_type == :octest_bundle || symbol_type == :unit_test_bundle || symbol_type == :ui_test_bundle
94
- XCConfigHelper.generate_ld_runpath_search_paths(target, target.requires_host_target?, test_bundle, @xcconfig) if target.requires_frameworks? || vendored_dynamic_artifacts.count > 0
95
-
96
- @xcconfig
97
- end
98
-
99
- #---------------------------------------------------------------------#
100
-
101
- protected
102
-
103
- # @return String the SWIFT_VERSION of the target being integrated
104
- #
105
- def target_swift_version
106
- target.target_definition.swift_version unless target.target_definition.swift_version.blank?
107
- end
108
-
109
- EMBED_STANDARD_LIBRARIES_MINIMUM_VERSION = Gem::Version.new('2.3')
110
-
111
- # @return [Hash<String, String>] the build settings necessary for Swift
112
- # targets to be correctly embedded in their host.
113
- #
114
- def embedded_content_settings
115
- # For embedded targets, which live in a host target, CocoaPods
116
- # copies all of the embedded target's pod_targets its host
117
- # target. Therefore, this check will properly require the Swift
118
- # libs in the host target, if the embedded target has any pod targets
119
- # that use Swift. Setting this for the embedded target would
120
- # cause an App Store rejection because frameworks cannot be embedded
121
- # in embedded targets.
122
-
123
- swift_version = Gem::Version.new(target_swift_version)
124
- should_embed = !target.requires_host_target? && pod_targets.any?(&:uses_swift?)
125
- config = {}
126
- if should_embed
127
- if swift_version >= EMBED_STANDARD_LIBRARIES_MINIMUM_VERSION
128
- config['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'YES'
129
- else
130
- config['EMBEDDED_CONTENT_CONTAINS_SWIFT'] = 'YES'
131
- end
132
- end
133
- config
134
- end
135
-
136
- # @return [Hash<String, String>] the build settings necessary to import
137
- # the pod targets.
138
- #
139
- def settings_to_import_pod_targets
140
- if target.requires_frameworks?
141
- build_pod_targets = pod_targets.select(&:should_build?)
142
- framework_header_search_paths = build_pod_targets.map do |target|
143
- "#{target.build_product_path}/Headers"
144
- end
145
- build_settings = {
146
- # TODO: remove quote imports in CocoaPods 2.0
147
- # Make framework headers discoverable by `import "…"`
148
- 'OTHER_CFLAGS' => XCConfigHelper.quote(framework_header_search_paths, '-iquote'),
149
- }
150
- if pod_targets.any? { |t| !t.should_build? }
151
- # Make library headers discoverable by `#import "…"`
152
- library_header_search_paths = target.sandbox.public_headers.search_paths(target.platform)
153
- # TODO: remove quote imports in CocoaPods 2.0
154
- build_settings['HEADER_SEARCH_PATHS'] = XCConfigHelper.quote(library_header_search_paths)
155
- build_settings['OTHER_CFLAGS'] += ' ' + XCConfigHelper.quote(library_header_search_paths, '-isystem')
156
- end
157
- build_settings
158
- else
159
- # Make headers discoverable from $PODS_ROOT/Headers directory
160
- header_search_paths = target.sandbox.public_headers.search_paths(target.platform)
161
- {
162
- # TODO: remove quote imports in CocoaPods 2.0
163
- # by `#import "…"`
164
- 'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(header_search_paths),
165
- # by `#import <…>`
166
- 'OTHER_CFLAGS' => XCConfigHelper.quote(header_search_paths, '-isystem'),
167
- }
168
- end
169
- end
170
-
171
- private
172
-
173
- # Add build settings, which ensure that the pod targets can be imported from the integrating target.
174
- # For >= 1.5.0 we use modular (stricter) header search paths this means that the integrated target will only be
175
- # able to import public headers using `<>` or `@import` notation, but never import any private headers.
176
- #
177
- # For < 1.5.0 legacy header search paths the same rules apply: It's the wild west.
178
- #
179
- def generate_settings_to_import_pod_targets
180
- @xcconfig.merge! XCConfigHelper.search_paths_for_dependent_targets(target, pod_targets)
181
- @xcconfig.merge!(settings_to_import_pod_targets)
182
- target.search_paths_aggregate_targets.each do |search_paths_target|
183
- generator = AggregateXCConfig.new(search_paths_target, configuration_name)
184
- @xcconfig.merge! XCConfigHelper.search_paths_for_dependent_targets(nil, search_paths_target.pod_targets)
185
- @xcconfig.merge!(generator.settings_to_import_pod_targets)
186
- # Propagate any HEADER_SEARCH_PATHS settings from the search paths.
187
- XCConfigHelper.propagate_header_search_paths_from_search_paths(search_paths_target, @xcconfig)
188
- end
189
- end
190
-
191
- private
192
-
193
- #---------------------------------------------------------------------#
194
-
195
- # !@group Private Helpers
196
-
197
- # Returns the {PodTarget}s which are active for the current
198
- # configuration name.
199
- #
200
- # @return [Array<PodTarget>]
201
- #
202
- def pod_targets
203
- target.pod_targets_for_build_configuration(configuration_name)
204
- end
205
-
206
- # Returns the +user_target_xcconfig+ for all pod targets and their spec
207
- # consumers grouped by keys
208
- #
209
- # @return [Hash{String,Hash{Target,String}]
210
- #
211
- def user_target_xcconfig_values_by_consumer_by_key
212
- pod_targets.each_with_object({}) do |target, hash|
213
- target.spec_consumers.each do |spec_consumer|
214
- spec_consumer.user_target_xcconfig.each do |k, v|
215
- (hash[k] ||= {})[spec_consumer] = v
216
- end
217
- end
218
- end
219
- end
220
-
221
- # Merges the +user_target_xcconfig+ for all pod targets into the
222
- # #xcconfig and warns on conflicting definitions.
223
- #
224
- # @return [Hash{String, String}]
225
- #
226
- def merged_user_target_xcconfigs
227
- settings = user_target_xcconfig_values_by_consumer_by_key
228
- settings.each_with_object({}) do |(key, values_by_consumer), xcconfig|
229
- uniq_values = values_by_consumer.values.uniq
230
- values_are_bools = uniq_values.all? { |v| v =~ /^(yes|no)$/i }
231
- if values_are_bools
232
- # Boolean build settings
233
- if uniq_values.count > 1
234
- UI.warn 'Can\'t merge user_target_xcconfig for pod targets: ' \
235
- "#{values_by_consumer.keys.map(&:name)}. Boolean build "\
236
- "setting #{key} has different values."
237
- else
238
- xcconfig[key] = uniq_values.first
239
- end
240
- elsif key =~ /S$/
241
- # Plural build settings
242
- xcconfig[key] = uniq_values.join(' ')
243
- else
244
- # Singular build settings
245
- if uniq_values.count > 1
246
- UI.warn 'Can\'t merge user_target_xcconfig for pod targets: ' \
247
- "#{values_by_consumer.keys.map(&:name)}. Singular build "\
248
- "setting #{key} has different values."
249
- else
250
- xcconfig[key] = uniq_values.first
251
- end
252
- end
253
- end
254
- end
255
-
256
- #---------------------------------------------------------------------#
257
- end
258
- end
259
- end
260
- end
@@ -1,87 +0,0 @@
1
- module Pod
2
- module Generator
3
- module XCConfig
4
- # Generates the private xcconfigs for the pod targets.
5
- #
6
- # The xcconfig file for a Pod target merges the pod target
7
- # configuration values with the default configuration values
8
- # required by CocoaPods.
9
- #
10
- class PodXCConfig
11
- # @return [Target] the target represented by this xcconfig.
12
- #
13
- attr_reader :target
14
-
15
- # Initialize a new instance
16
- #
17
- # @param [Target] target @see target
18
- #
19
- # @param [Boolean] test_xcconfig
20
- # whether this is an xcconfig for a test native target.
21
- #
22
- def initialize(target, test_xcconfig = false)
23
- @target = target
24
- @test_xcconfig = test_xcconfig
25
- end
26
-
27
- # @return [Xcodeproj::Config] The generated xcconfig.
28
- #
29
- attr_reader :xcconfig
30
-
31
- # Generates and saves the xcconfig to the given path.
32
- #
33
- # @param [Pathname] path
34
- # the path where the prefix header should be stored.
35
- #
36
- # @return [void]
37
- #
38
- def save_as(path)
39
- generate.save_as(path)
40
- end
41
-
42
- # Generates the xcconfig.
43
- #
44
- # @return [Xcodeproj::Config]
45
- #
46
- def generate
47
- config = {
48
- 'FRAMEWORK_SEARCH_PATHS' => '$(inherited) ',
49
- 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
50
- 'HEADER_SEARCH_PATHS' => '$(inherited) ' + XCConfigHelper.quote(target.header_search_paths(@test_xcconfig)),
51
- 'LIBRARY_SEARCH_PATHS' => '$(inherited) ',
52
- 'OTHER_CFLAGS' => '$(inherited) ',
53
- 'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target, @test_xcconfig),
54
- 'OTHER_SWIFT_FLAGS' => '$(inherited) ',
55
- 'PODS_ROOT' => '${SRCROOT}',
56
- 'PODS_TARGET_SRCROOT' => target.pod_target_srcroot,
57
- 'PRODUCT_BUNDLE_IDENTIFIER' => 'org.cocoapods.${PRODUCT_NAME:rfc1034identifier}',
58
- 'SKIP_INSTALL' => 'YES',
59
- 'SWIFT_ACTIVE_COMPILATION_CONDITIONS' => '$(inherited) ',
60
- 'SWIFT_INCLUDE_PATHS' => '$(inherited) ',
61
- }
62
-
63
- @xcconfig = Xcodeproj::Config.new(config)
64
-
65
- XCConfigHelper.add_settings_for_file_accessors_of_target(nil, target, @xcconfig, true, @test_xcconfig)
66
- target.file_accessors.each do |file_accessor|
67
- @xcconfig.merge!(file_accessor.spec_consumer.pod_target_xcconfig) if @test_xcconfig == file_accessor.spec.test_specification?
68
- end
69
- XCConfigHelper.add_target_specific_settings(target, @xcconfig)
70
- recursive_dependent_targets = target.recursive_dependent_targets
71
- @xcconfig.merge! XCConfigHelper.search_paths_for_dependent_targets(target, recursive_dependent_targets, @test_xcconfig)
72
- XCConfigHelper.generate_vendored_build_settings(target, recursive_dependent_targets, @xcconfig, false, @test_xcconfig)
73
- if @test_xcconfig
74
- test_dependent_targets = [target, *target.recursive_test_dependent_targets].uniq
75
- @xcconfig.merge! XCConfigHelper.search_paths_for_dependent_targets(target, test_dependent_targets - recursive_dependent_targets, @test_xcconfig)
76
- XCConfigHelper.generate_vendored_build_settings(nil, target.all_dependent_targets, @xcconfig, true, @test_xcconfig)
77
- XCConfigHelper.generate_other_ld_flags(nil, target.all_dependent_targets, @xcconfig)
78
- XCConfigHelper.generate_ld_runpath_search_paths(target, false, true, @xcconfig)
79
- end
80
- @xcconfig
81
- end
82
-
83
- #-----------------------------------------------------------------------#
84
- end
85
- end
86
- end
87
- end