cocoapods-tt 0.0.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 (124) hide show
  1. checksums.yaml +7 -0
  2. data/lib/cocoapods-tt/command/native/install.rb +56 -0
  3. data/lib/cocoapods-tt/command/native/update.rb +157 -0
  4. data/lib/cocoapods-tt/command/tt/make.rb +92 -0
  5. data/lib/cocoapods-tt/command/tt.rb +115 -0
  6. data/lib/cocoapods-tt/command.rb +1 -0
  7. data/lib/cocoapods-tt/gem_version.rb +3 -0
  8. data/lib/cocoapods-tt/native/command.rb +185 -0
  9. data/lib/cocoapods-tt/native/config.rb +366 -0
  10. data/lib/cocoapods-tt/native/core_overrides.rb +1 -0
  11. data/lib/cocoapods-tt/native/downloader/cache.rb +322 -0
  12. data/lib/cocoapods-tt/native/downloader/request.rb +86 -0
  13. data/lib/cocoapods-tt/native/downloader/response.rb +16 -0
  14. data/lib/cocoapods-tt/native/downloader.rb +192 -0
  15. data/lib/cocoapods-tt/native/executable.rb +247 -0
  16. data/lib/cocoapods-tt/native/external_sources/abstract_external_source.rb +205 -0
  17. data/lib/cocoapods-tt/native/external_sources/downloader_source.rb +30 -0
  18. data/lib/cocoapods-tt/native/external_sources/path_source.rb +55 -0
  19. data/lib/cocoapods-tt/native/external_sources/podspec_source.rb +54 -0
  20. data/lib/cocoapods-tt/native/external_sources.rb +57 -0
  21. data/lib/cocoapods-tt/native/gem_version.rb +5 -0
  22. data/lib/cocoapods-tt/native/generator/acknowledgements/markdown.rb +44 -0
  23. data/lib/cocoapods-tt/native/generator/acknowledgements/plist.rb +94 -0
  24. data/lib/cocoapods-tt/native/generator/acknowledgements.rb +107 -0
  25. data/lib/cocoapods-tt/native/generator/app_target_helper.rb +363 -0
  26. data/lib/cocoapods-tt/native/generator/bridge_support.rb +22 -0
  27. data/lib/cocoapods-tt/native/generator/constant.rb +19 -0
  28. data/lib/cocoapods-tt/native/generator/copy_dsyms_script.rb +56 -0
  29. data/lib/cocoapods-tt/native/generator/copy_resources_script.rb +223 -0
  30. data/lib/cocoapods-tt/native/generator/copy_xcframework_script.rb +227 -0
  31. data/lib/cocoapods-tt/native/generator/dummy_source.rb +31 -0
  32. data/lib/cocoapods-tt/native/generator/embed_frameworks_script.rb +196 -0
  33. data/lib/cocoapods-tt/native/generator/file_list.rb +39 -0
  34. data/lib/cocoapods-tt/native/generator/header.rb +103 -0
  35. data/lib/cocoapods-tt/native/generator/info_plist_file.rb +128 -0
  36. data/lib/cocoapods-tt/native/generator/module_map.rb +99 -0
  37. data/lib/cocoapods-tt/native/generator/prefix_header.rb +60 -0
  38. data/lib/cocoapods-tt/native/generator/script_phase_constants.rb +100 -0
  39. data/lib/cocoapods-tt/native/generator/umbrella_header.rb +46 -0
  40. data/lib/cocoapods-tt/native/hooks_manager.rb +132 -0
  41. data/lib/cocoapods-tt/native/installer/analyzer/analysis_result.rb +87 -0
  42. data/lib/cocoapods-tt/native/installer/analyzer/locking_dependency_analyzer.rb +103 -0
  43. data/lib/cocoapods-tt/native/installer/analyzer/pod_variant.rb +87 -0
  44. data/lib/cocoapods-tt/native/installer/analyzer/pod_variant_set.rb +175 -0
  45. data/lib/cocoapods-tt/native/installer/analyzer/podfile_dependency_cache.rb +55 -0
  46. data/lib/cocoapods-tt/native/installer/analyzer/sandbox_analyzer.rb +268 -0
  47. data/lib/cocoapods-tt/native/installer/analyzer/specs_state.rb +108 -0
  48. data/lib/cocoapods-tt/native/installer/analyzer/target_inspection_result.rb +58 -0
  49. data/lib/cocoapods-tt/native/installer/analyzer/target_inspector.rb +258 -0
  50. data/lib/cocoapods-tt/native/installer/analyzer.rb +1204 -0
  51. data/lib/cocoapods-tt/native/installer/base_install_hooks_context.rb +135 -0
  52. data/lib/cocoapods-tt/native/installer/installation_options.rb +195 -0
  53. data/lib/cocoapods-tt/native/installer/pod_source_installer.rb +224 -0
  54. data/lib/cocoapods-tt/native/installer/pod_source_preparer.rb +77 -0
  55. data/lib/cocoapods-tt/native/installer/podfile_validator.rb +168 -0
  56. data/lib/cocoapods-tt/native/installer/post_install_hooks_context.rb +9 -0
  57. data/lib/cocoapods-tt/native/installer/post_integrate_hooks_context.rb +9 -0
  58. data/lib/cocoapods-tt/native/installer/pre_install_hooks_context.rb +51 -0
  59. data/lib/cocoapods-tt/native/installer/pre_integrate_hooks_context.rb +9 -0
  60. data/lib/cocoapods-tt/native/installer/project_cache/project_cache.rb +11 -0
  61. data/lib/cocoapods-tt/native/installer/project_cache/project_cache_analysis_result.rb +53 -0
  62. data/lib/cocoapods-tt/native/installer/project_cache/project_cache_analyzer.rb +200 -0
  63. data/lib/cocoapods-tt/native/installer/project_cache/project_cache_version.rb +43 -0
  64. data/lib/cocoapods-tt/native/installer/project_cache/project_installation_cache.rb +103 -0
  65. data/lib/cocoapods-tt/native/installer/project_cache/project_metadata_cache.rb +73 -0
  66. data/lib/cocoapods-tt/native/installer/project_cache/target_cache_key.rb +176 -0
  67. data/lib/cocoapods-tt/native/installer/project_cache/target_metadata.rb +74 -0
  68. data/lib/cocoapods-tt/native/installer/sandbox_dir_cleaner.rb +105 -0
  69. data/lib/cocoapods-tt/native/installer/sandbox_header_paths_installer.rb +45 -0
  70. data/lib/cocoapods-tt/native/installer/source_provider_hooks_context.rb +34 -0
  71. data/lib/cocoapods-tt/native/installer/target_uuid_generator.rb +34 -0
  72. data/lib/cocoapods-tt/native/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +179 -0
  73. data/lib/cocoapods-tt/native/installer/user_project_integrator/target_integrator.rb +815 -0
  74. data/lib/cocoapods-tt/native/installer/user_project_integrator.rb +280 -0
  75. data/lib/cocoapods-tt/native/installer/xcode/multi_pods_project_generator.rb +82 -0
  76. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/aggregate_target_dependency_installer.rb +66 -0
  77. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/aggregate_target_installer.rb +192 -0
  78. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/app_host_installer.rb +154 -0
  79. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/file_references_installer.rb +329 -0
  80. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/pod_target_dependency_installer.rb +195 -0
  81. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/pod_target_installer.rb +1239 -0
  82. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/pod_target_integrator.rb +312 -0
  83. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/pods_project_writer.rb +90 -0
  84. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/project_generator.rb +120 -0
  85. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/target_installation_result.rb +140 -0
  86. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/target_installer.rb +257 -0
  87. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator/target_installer_helper.rb +110 -0
  88. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator.rb +291 -0
  89. data/lib/cocoapods-tt/native/installer/xcode/pods_project_generator_result.rb +54 -0
  90. data/lib/cocoapods-tt/native/installer/xcode/single_pods_project_generator.rb +38 -0
  91. data/lib/cocoapods-tt/native/installer/xcode/target_validator.rb +170 -0
  92. data/lib/cocoapods-tt/native/installer/xcode.rb +11 -0
  93. data/lib/cocoapods-tt/native/installer.rb +1044 -0
  94. data/lib/cocoapods-tt/native/native_target_extension.rb +60 -0
  95. data/lib/cocoapods-tt/native/open-uri.rb +33 -0
  96. data/lib/cocoapods-tt/native/podfile.rb +13 -0
  97. data/lib/cocoapods-tt/native/project.rb +544 -0
  98. data/lib/cocoapods-tt/native/resolver/lazy_specification.rb +88 -0
  99. data/lib/cocoapods-tt/native/resolver/resolver_specification.rb +41 -0
  100. data/lib/cocoapods-tt/native/resolver.rb +600 -0
  101. data/lib/cocoapods-tt/native/sandbox/file_accessor.rb +532 -0
  102. data/lib/cocoapods-tt/native/sandbox/headers_store.rb +163 -0
  103. data/lib/cocoapods-tt/native/sandbox/path_list.rb +242 -0
  104. data/lib/cocoapods-tt/native/sandbox/pod_dir_cleaner.rb +71 -0
  105. data/lib/cocoapods-tt/native/sandbox/podspec_finder.rb +23 -0
  106. data/lib/cocoapods-tt/native/sandbox.rb +470 -0
  107. data/lib/cocoapods-tt/native/sources_manager.rb +221 -0
  108. data/lib/cocoapods-tt/native/target/aggregate_target.rb +558 -0
  109. data/lib/cocoapods-tt/native/target/build_settings.rb +1385 -0
  110. data/lib/cocoapods-tt/native/target/pod_target.rb +1168 -0
  111. data/lib/cocoapods-tt/native/target.rb +378 -0
  112. data/lib/cocoapods-tt/native/user_interface/error_report.rb +204 -0
  113. data/lib/cocoapods-tt/native/user_interface/inspector_reporter.rb +102 -0
  114. data/lib/cocoapods-tt/native/user_interface.rb +463 -0
  115. data/lib/cocoapods-tt/native/validator.rb +1170 -0
  116. data/lib/cocoapods-tt/native/version_metadata.rb +26 -0
  117. data/lib/cocoapods-tt/native/xcode/framework_paths.rb +54 -0
  118. data/lib/cocoapods-tt/native/xcode/linkage_analyzer.rb +22 -0
  119. data/lib/cocoapods-tt/native/xcode/xcframework/xcframework_slice.rb +138 -0
  120. data/lib/cocoapods-tt/native/xcode/xcframework.rb +99 -0
  121. data/lib/cocoapods-tt/native/xcode.rb +7 -0
  122. data/lib/cocoapods-tt.rb +1 -0
  123. data/lib/cocoapods_plugin.rb +17 -0
  124. metadata +193 -0
@@ -0,0 +1,558 @@
1
+ require 'cocoapods/xcode/framework_paths'
2
+ require 'cocoapods/xcode/xcframework'
3
+
4
+ module Pod
5
+ # Stores the information relative to the target used to cluster the targets
6
+ # of the single Pods. The client targets will then depend on this one.
7
+ #
8
+ class AggregateTarget < Target
9
+ # Product types where the product's frameworks must be embedded in a host target
10
+ #
11
+ EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :static_library, :messages_extension,
12
+ :watch_extension, :xpc_service].freeze
13
+
14
+ # @return [TargetDefinition] the target definition of the Podfile that
15
+ # generated this target.
16
+ #
17
+ attr_reader :target_definition
18
+
19
+ # @return [Pathname] the folder where the client is stored used for
20
+ # computing the relative paths. If integrating it should be the
21
+ # folder where the user project is stored, otherwise it should
22
+ # be the installation root.
23
+ #
24
+ attr_reader :client_root
25
+
26
+ # @return [Xcodeproj::Project] the user project that this target will
27
+ # integrate as identified by the analyzer.
28
+ #
29
+ attr_reader :user_project
30
+
31
+ # @return [Array<String>] the list of the UUIDs of the user targets that
32
+ # will be integrated by this target as identified by the analyzer.
33
+ #
34
+ # @note The target instances are not stored to prevent editing different
35
+ # instances.
36
+ #
37
+ attr_reader :user_target_uuids
38
+
39
+ # @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
40
+ # configuration file for the target
41
+ #
42
+ # @note The configurations are generated by the {TargetInstaller} and
43
+ # used by {UserProjectIntegrator} to check for any overridden
44
+ # values.
45
+ #
46
+ attr_reader :xcconfigs
47
+
48
+ # @return [Array<PodTarget>] The dependencies for this target.
49
+ #
50
+ attr_reader :pod_targets
51
+
52
+ # @return [Array<AggregateTarget>] The aggregate targets whose pods this
53
+ # target must be able to import, but will not directly link against.
54
+ #
55
+ attr_reader :search_paths_aggregate_targets
56
+
57
+ # Initialize a new instance
58
+ #
59
+ # @param [Sandbox] sandbox @see Target#sandbox
60
+ # @param [BuildType] build_type @see Target#build_type
61
+ # @param [Hash{String=>Symbol}] user_build_configurations @see Target#user_build_configurations
62
+ # @param [Array<String>] archs @see Target#archs
63
+ # @param [Platform] platform @see #Target#platform
64
+ # @param [TargetDefinition] target_definition @see #target_definition
65
+ # @param [Pathname] client_root @see #client_root
66
+ # @param [Xcodeproj::Project] user_project @see #user_project
67
+ # @param [Array<String>] user_target_uuids @see #user_target_uuids
68
+ # @param [Hash{String=>Array<PodTarget>}] pod_targets_for_build_configuration @see #pod_targets_for_build_configuration
69
+ #
70
+ def initialize(sandbox, build_type, user_build_configurations, archs, platform, target_definition, client_root,
71
+ user_project, user_target_uuids, pod_targets_for_build_configuration)
72
+ super(sandbox, build_type, user_build_configurations, archs, platform)
73
+ raise "Can't initialize an AggregateTarget without a TargetDefinition!" if target_definition.nil?
74
+ raise "Can't initialize an AggregateTarget with an abstract TargetDefinition!" if target_definition.abstract?
75
+ @target_definition = target_definition
76
+ @client_root = client_root
77
+ @user_project = user_project
78
+ @user_target_uuids = user_target_uuids
79
+ @pod_targets_for_build_configuration = pod_targets_for_build_configuration
80
+ @pod_targets = pod_targets_for_build_configuration.values.flatten.uniq
81
+ @search_paths_aggregate_targets = []
82
+ @xcconfigs = {}
83
+ end
84
+
85
+ # Merges this aggregate target with additional pod targets that are part of embedded aggregate targets.
86
+ #
87
+ # @param [Hash{String=>Array<PodTarget>}] embedded_pod_targets_for_build_configuration
88
+ # The pod targets to merge with.
89
+ #
90
+ # @return [AggregateTarget] a new instance of this aggregate target with additional pod targets to be used from
91
+ # pod targets of embedded aggregate targets.
92
+ #
93
+ def merge_embedded_pod_targets(embedded_pod_targets_for_build_configuration)
94
+ merged = @pod_targets_for_build_configuration.merge(embedded_pod_targets_for_build_configuration) do |_, before, after|
95
+ (before + after).uniq
96
+ end
97
+ AggregateTarget.new(sandbox, build_type, user_build_configurations, archs, platform,
98
+ target_definition, client_root, user_project, user_target_uuids, merged).tap do |aggregate_target|
99
+ aggregate_target.search_paths_aggregate_targets.concat(search_paths_aggregate_targets).freeze
100
+ aggregate_target.mark_application_extension_api_only if application_extension_api_only
101
+ aggregate_target.mark_build_library_for_distribution if build_library_for_distribution
102
+ end
103
+ end
104
+
105
+ def build_settings(configuration_name = nil)
106
+ if configuration_name
107
+ @build_settings[configuration_name] ||
108
+ raise(ArgumentError, "#{self} does not contain a build setting for the #{configuration_name.inspect} configuration, only #{@build_settings.keys.inspect}")
109
+ else
110
+ @build_settings.each_value.first ||
111
+ raise(ArgumentError, "#{self} does not contain any build settings")
112
+ end
113
+ end
114
+
115
+ # @return [Boolean] True if the user_target refers to a
116
+ # library (framework, static or dynamic lib).
117
+ #
118
+ def library?
119
+ # Without a user_project, we can't say for sure
120
+ # that this is a library
121
+ return false if user_project.nil?
122
+ symbol_types = user_targets.map(&:symbol_type).uniq
123
+ unless symbol_types.count == 1
124
+ raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}."
125
+ end
126
+ [:framework, :dynamic_library, :static_library].include? symbol_types.first
127
+ end
128
+
129
+ # @return [Boolean] True if the user_target's pods are
130
+ # for an extension and must be embedded in a host,
131
+ # target, otherwise false.
132
+ #
133
+ def requires_host_target?
134
+ # If we don't have a user_project, then we can't
135
+ # glean any info about how this target is going to
136
+ # be integrated, so return false since we can't know
137
+ # for sure that this target refers to an extension
138
+ # target that would require a host target
139
+ return false if user_project.nil?
140
+ symbol_types = user_targets.map(&:symbol_type).uniq
141
+ unless symbol_types.count == 1
142
+ raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}."
143
+ end
144
+ EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES.include?(symbol_types[0])
145
+ end
146
+
147
+ # @return [String] the label for the target.
148
+ #
149
+ def label
150
+ target_definition.label.to_s
151
+ end
152
+
153
+ # @return [Podfile] The podfile which declares the dependency
154
+ #
155
+ def podfile
156
+ target_definition.podfile
157
+ end
158
+
159
+ # @return [Pathname] the path of the user project that this target will
160
+ # integrate as identified by the analyzer.
161
+ #
162
+ def user_project_path
163
+ user_project.path if user_project
164
+ end
165
+
166
+ # List all user targets that will be integrated by this #target.
167
+ #
168
+ # @return [Array<PBXNativeTarget>]
169
+ #
170
+ def user_targets
171
+ return [] unless user_project
172
+ user_target_uuids.map do |uuid|
173
+ native_target = user_project.objects_by_uuid[uuid]
174
+ unless native_target
175
+ raise Informative, '[Bug] Unable to find the target with ' \
176
+ "the `#{uuid}` UUID for the `#{self}` integration library"
177
+ end
178
+ native_target
179
+ end
180
+ end
181
+
182
+ # @param [String] build_configuration The build configuration for which the
183
+ # the pod targets should be returned.
184
+ #
185
+ # @return [Array<PodTarget>] the pod targets for the given build
186
+ # configuration.
187
+ #
188
+ def pod_targets_for_build_configuration(build_configuration)
189
+ @pod_targets_for_build_configuration[build_configuration] || []
190
+ end
191
+
192
+ # @return [Array<Specification>] The specifications used by this aggregate target.
193
+ #
194
+ def specs
195
+ pod_targets.flat_map(&:specs)
196
+ end
197
+
198
+ # @return [Hash{Symbol => Array<Specification>}] The pod targets for each
199
+ # build configuration.
200
+ #
201
+ def specs_by_build_configuration
202
+ result = {}
203
+ user_build_configurations.each_key do |build_configuration|
204
+ result[build_configuration] = pod_targets_for_build_configuration(build_configuration).
205
+ flat_map(&:specs)
206
+ end
207
+ result
208
+ end
209
+
210
+ # @return [Array<Specification::Consumer>] The consumers of the Pod.
211
+ #
212
+ def spec_consumers
213
+ specs.map { |spec| spec.consumer(platform) }
214
+ end
215
+
216
+ # @return [Boolean] Whether the target uses Swift code
217
+ #
218
+ def uses_swift?
219
+ pod_targets.any?(&:uses_swift?)
220
+ end
221
+
222
+ # @return [Boolean] Whether the target contains any resources
223
+ #
224
+ def includes_resources?
225
+ !resource_paths_by_config.each_value.all?(&:empty?)
226
+ end
227
+
228
+ # @return [Boolean] Whether the target contains any on demand resources
229
+ #
230
+ def includes_on_demand_resources?
231
+ !on_demand_resources.empty?
232
+ end
233
+
234
+ # @return [Boolean] Whether the target contains frameworks to be embedded into
235
+ # the user target
236
+ #
237
+ def includes_frameworks?
238
+ !framework_paths_by_config.each_value.all?(&:empty?)
239
+ end
240
+
241
+ # @return [Boolean] Whether the target contains xcframeworks to be embedded into
242
+ # the user target
243
+ #
244
+ def includes_xcframeworks?
245
+ !xcframeworks_by_config.each_value.all?(&:empty?)
246
+ end
247
+
248
+ # @return [Hash{String => Array<FrameworkPaths>}] The vendored dynamic artifacts and framework target
249
+ # input and output paths grouped by config
250
+ #
251
+ def framework_paths_by_config
252
+ @framework_paths_by_config ||= begin
253
+ framework_paths_by_config = {}
254
+ user_build_configurations.each_key do |config|
255
+ relevant_pod_targets = pod_targets_for_build_configuration(config)
256
+ framework_paths_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
257
+ library_specs = pod_target.library_specs.map(&:name)
258
+ pod_target.framework_paths.values_at(*library_specs).flatten.compact.uniq
259
+ end
260
+ end
261
+ framework_paths_by_config
262
+ end
263
+ end
264
+
265
+ # @return [Hash{String => Array<Xcode::XCFramework>}] The vendored dynamic artifacts and framework target
266
+ # input and output paths grouped by config
267
+ #
268
+ def xcframeworks_by_config
269
+ @xcframeworks_by_config ||= begin
270
+ xcframeworks_by_config = {}
271
+ user_build_configurations.each_key do |config|
272
+ relevant_pod_targets = pod_targets_for_build_configuration(config)
273
+ xcframeworks_by_config[config] = relevant_pod_targets.flat_map do |pod_target|
274
+ library_specs = pod_target.library_specs.map(&:name)
275
+ pod_target.xcframeworks.values_at(*library_specs).flatten.compact.uniq
276
+ end
277
+ end
278
+ xcframeworks_by_config
279
+ end
280
+ end
281
+
282
+ # @return [Array<Pathname>] Uniqued On Demand Resources for this target.
283
+ #
284
+ # @note On Demand Resources are not separated by config as they are integrated directly into the users target via
285
+ # the resources build phase.
286
+ #
287
+ def on_demand_resources
288
+ @on_demand_resources ||= begin
289
+ pod_targets.flat_map do |pod_target|
290
+ library_file_accessors = pod_target.file_accessors.select { |fa| fa.spec.library_specification? }
291
+ library_file_accessors.flat_map(&:on_demand_resources_files)
292
+ end.uniq
293
+ end
294
+ end
295
+
296
+ # @return [Hash{String => Array<String>}] Uniqued Resources grouped by config
297
+ #
298
+ def resource_paths_by_config
299
+ @resource_paths_by_config ||= begin
300
+ relevant_pod_targets = pod_targets.reject do |pod_target|
301
+ pod_target.should_build? && pod_target.build_as_dynamic_framework?
302
+ end
303
+ user_build_configurations.each_key.each_with_object({}) do |config, resources_by_config|
304
+ targets = relevant_pod_targets & pod_targets_for_build_configuration(config)
305
+ resources_by_config[config] = targets.flat_map do |pod_target|
306
+ library_specs = pod_target.library_specs.map(&:name)
307
+ resource_paths = pod_target.resource_paths.values_at(*library_specs).flatten
308
+
309
+ if pod_target.build_as_static_framework?
310
+ built_product_dir = Pathname.new(pod_target.build_product_path('${BUILT_PRODUCTS_DIR}'))
311
+ resource_paths = resource_paths.map do |resource_path|
312
+ extname = File.extname(resource_path)
313
+ if self.class.resource_extension_compilable?(extname)
314
+ output_extname = self.class.output_extension_for_resource(extname)
315
+ output_path_components = Pathname(resource_path).each_filename.select { |component| File.extname(component) == '.lproj' }
316
+ output_path_components << File.basename(resource_path)
317
+ built_product_dir.join(*output_path_components).sub_ext(output_extname).to_s
318
+ else
319
+ resource_path
320
+ end
321
+ end
322
+ end
323
+
324
+ resource_paths << bridge_support_file
325
+ resource_paths.compact.uniq
326
+ end
327
+ end
328
+ end
329
+ end
330
+
331
+ # @return [Pathname] the path of the bridge support file relative to the
332
+ # sandbox or `nil` if bridge support is disabled.
333
+ #
334
+ def bridge_support_file
335
+ bridge_support_path.relative_path_from(sandbox.root) if podfile.generate_bridge_support?
336
+ end
337
+
338
+ #-------------------------------------------------------------------------#
339
+
340
+ # @!group Support files
341
+
342
+ # @return [Pathname] The absolute path of acknowledgements file.
343
+ #
344
+ # @note The acknowledgements generators add the extension according to
345
+ # the file type.
346
+ #
347
+ def acknowledgements_basepath
348
+ support_files_dir + "#{label}-acknowledgements"
349
+ end
350
+
351
+ # @return [Pathname] The absolute path of the copy resources script.
352
+ #
353
+ def copy_resources_script_path
354
+ support_files_dir + "#{label}-resources.sh"
355
+ end
356
+
357
+ # @return [Pathname] The absolute path of the embed frameworks script.
358
+ #
359
+ def embed_frameworks_script_path
360
+ support_files_dir + "#{label}-frameworks.sh"
361
+ end
362
+
363
+ # @param [String] configuration the configuration this path is for.
364
+ #
365
+ # @return [Pathname] The absolute path of the copy resources script input file list.
366
+ #
367
+ def copy_resources_script_input_files_path(configuration)
368
+ support_files_dir + "#{label}-resources-#{configuration}-input-files.xcfilelist"
369
+ end
370
+
371
+ # @param [String] configuration the configuration this path is for.
372
+ #
373
+ # @return [Pathname] The absolute path of the copy resources script output file list.
374
+ #
375
+ def copy_resources_script_output_files_path(configuration)
376
+ support_files_dir + "#{label}-resources-#{configuration}-output-files.xcfilelist"
377
+ end
378
+
379
+ # @param [String] configuration the configuration this path is for.
380
+ #
381
+ # @return [Pathname] The absolute path of the embed frameworks script input file list.
382
+ #
383
+ def embed_frameworks_script_input_files_path(configuration)
384
+ support_files_dir + "#{label}-frameworks-#{configuration}-input-files.xcfilelist"
385
+ end
386
+
387
+ # @param [String] configuration the configuration this path is for.
388
+ #
389
+ # @return [Pathname] The absolute path of the embed frameworks script output file list.
390
+ #
391
+ def embed_frameworks_script_output_files_path(configuration)
392
+ support_files_dir + "#{label}-frameworks-#{configuration}-output-files.xcfilelist"
393
+ end
394
+
395
+ # @param [String] configuration the configuration this path is for.
396
+ #
397
+ # @return [Pathname] The absolute path of the prepare artifacts script input file list.
398
+ #
399
+ # @deprecated
400
+ #
401
+ # @todo Remove in 2.0
402
+ #
403
+ def prepare_artifacts_script_input_files_path(configuration)
404
+ support_files_dir + "#{label}-artifacts-#{configuration}-input-files.xcfilelist"
405
+ end
406
+
407
+ # @param [String] configuration the configuration this path is for.
408
+ #
409
+ # @return [Pathname] The absolute path of the prepare artifacts script output file list.
410
+ #
411
+ # @deprecated
412
+ #
413
+ # @todo Remove in 2.0
414
+ #
415
+ def prepare_artifacts_script_output_files_path(configuration)
416
+ support_files_dir + "#{label}-artifacts-#{configuration}-output-files.xcfilelist"
417
+ end
418
+
419
+ # @return [String] The output file path fo the check manifest lock script.
420
+ #
421
+ def check_manifest_lock_script_output_file_path
422
+ "$(DERIVED_FILE_DIR)/#{label}-checkManifestLockResult.txt"
423
+ end
424
+
425
+ # @return [Pathname] The relative path of the Pods directory from user project's directory.
426
+ #
427
+ def relative_pods_root_path
428
+ sandbox.root.relative_path_from(client_root)
429
+ end
430
+
431
+ # @return [String] The xcconfig path of the root from the `$(SRCROOT)`
432
+ # variable of the user's project.
433
+ #
434
+ def relative_pods_root
435
+ "${SRCROOT}/#{relative_pods_root_path}"
436
+ end
437
+
438
+ # @return [String] The path of the Podfile directory relative to the
439
+ # root of the user project.
440
+ #
441
+ def podfile_dir_relative_path
442
+ podfile_path = target_definition.podfile.defined_in_file
443
+ return "${SRCROOT}/#{podfile_path.relative_path_from(client_root).dirname}" unless podfile_path.nil?
444
+ # Fallback to the standard path if the Podfile is not represented by a file.
445
+ '${PODS_ROOT}/..'
446
+ end
447
+
448
+ # @param [String] config_name The build configuration name to get the xcconfig for
449
+ # @return [String] The path of the xcconfig file relative to the root of
450
+ # the user project.
451
+ #
452
+ def xcconfig_relative_path(config_name)
453
+ xcconfig_path(config_name).relative_path_from(client_root).to_s
454
+ end
455
+
456
+ # @return [String] The path of the copy resources script relative to the
457
+ # root of the Pods project.
458
+ #
459
+ def copy_resources_script_relative_path
460
+ "${PODS_ROOT}/#{relative_to_pods_root(copy_resources_script_path)}"
461
+ end
462
+
463
+ # @return [String] The path of the copy resources script input file list
464
+ # relative to the root of the Pods project.
465
+ #
466
+ def copy_resources_script_input_files_relative_path
467
+ "${PODS_ROOT}/#{relative_to_pods_root(copy_resources_script_input_files_path('${CONFIGURATION}'))}"
468
+ end
469
+
470
+ # @return [String] The path of the copy resources script output file list
471
+ # relative to the root of the Pods project.
472
+ #
473
+ def copy_resources_script_output_files_relative_path
474
+ "${PODS_ROOT}/#{relative_to_pods_root(copy_resources_script_output_files_path('${CONFIGURATION}'))}"
475
+ end
476
+
477
+ # @return [String] The path of the embed frameworks relative to the
478
+ # root of the Pods project.
479
+ #
480
+ def embed_frameworks_script_relative_path
481
+ "${PODS_ROOT}/#{relative_to_pods_root(embed_frameworks_script_path)}"
482
+ end
483
+
484
+ # @return [String] The path of the embed frameworks script input file list
485
+ # relative to the root of the Pods project.
486
+ #
487
+ def embed_frameworks_script_input_files_relative_path
488
+ "${PODS_ROOT}/#{relative_to_pods_root(embed_frameworks_script_input_files_path('${CONFIGURATION}'))}"
489
+ end
490
+
491
+ # @return [String] The path of the embed frameworks script output file list
492
+ # relative to the root of the Pods project.
493
+ #
494
+ def embed_frameworks_script_output_files_relative_path
495
+ "${PODS_ROOT}/#{relative_to_pods_root(embed_frameworks_script_output_files_path('${CONFIGURATION}'))}"
496
+ end
497
+
498
+ # @return [String] The path of the prepare artifacts script relative to the
499
+ # root of the Pods project.
500
+ #
501
+ # @deprecated
502
+ #
503
+ # @todo Remove in 2.0
504
+ #
505
+ def prepare_artifacts_script_relative_path
506
+ "${PODS_ROOT}/#{relative_to_pods_root(prepare_artifacts_script_path)}"
507
+ end
508
+
509
+ # @return [String] The path of the prepare artifacts script input file list
510
+ # relative to the root of the Pods project.
511
+ #
512
+ # @deprecated
513
+ #
514
+ # @todo Remove in 2.0
515
+ #
516
+ def prepare_artifacts_script_input_files_relative_path
517
+ "${PODS_ROOT}/#{relative_to_pods_root(prepare_artifacts_script_input_files_path('${CONFIGURATION}'))}"
518
+ end
519
+
520
+ # @return [String] The path of the prepare artifacts script output file list
521
+ # relative to the root of the Pods project.
522
+ #
523
+ # @deprecated
524
+ #
525
+ # @todo Remove in 2.0
526
+ #
527
+ def prepare_artifacts_script_output_files_relative_path
528
+ "${PODS_ROOT}/#{relative_to_pods_root(prepare_artifacts_script_output_files_path('${CONFIGURATION}'))}"
529
+ end
530
+
531
+ private
532
+
533
+ # @!group Private Helpers
534
+ #-------------------------------------------------------------------------#
535
+
536
+ # Computes the relative path of a sandboxed file from the `$(PODS_ROOT)`
537
+ # variable of the Pods's project.
538
+ #
539
+ # @param [Pathname] path
540
+ # A relative path from the root of the sandbox.
541
+ #
542
+ # @return [String] The computed path.
543
+ #
544
+ def relative_to_pods_root(path)
545
+ path.relative_path_from(sandbox.root).to_s
546
+ end
547
+
548
+ def create_build_settings
549
+ settings = {}
550
+
551
+ user_build_configurations.each do |configuration_name, configuration|
552
+ settings[configuration_name] = BuildSettings::AggregateTargetSettings.new(self, configuration_name, :configuration => configuration)
553
+ end
554
+
555
+ settings
556
+ end
557
+ end
558
+ end