cocoapods 0.34.4 → 0.35.0.rc1
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 +4 -4
- data/CHANGELOG.md +108 -1
- data/bin/pod +20 -2
- data/lib/cocoapods.rb +1 -0
- data/lib/cocoapods/command.rb +17 -11
- data/lib/cocoapods/command/repo/push.rb +1 -1
- data/lib/cocoapods/command/search.rb +1 -0
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/acknowledgements/plist.rb +4 -10
- data/lib/cocoapods/generator/header.rb +75 -0
- data/lib/cocoapods/generator/prefix_header.rb +15 -34
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +2 -2
- data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +4 -1
- data/lib/cocoapods/hooks/library_representation.rb +1 -1
- data/lib/cocoapods/installer.rb +3 -3
- data/lib/cocoapods/installer/analyzer.rb +35 -37
- data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +72 -0
- data/lib/cocoapods/installer/file_references_installer.rb +10 -9
- data/lib/cocoapods/installer/target_installer.rb +21 -21
- data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +17 -17
- data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +19 -19
- data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +7 -3
- data/lib/cocoapods/project.rb +1 -1
- data/lib/cocoapods/resolver.rb +235 -98
- data/lib/cocoapods/resolver/lazy_specification.rb +60 -0
- data/lib/cocoapods/sandbox.rb +2 -1
- data/lib/cocoapods/sandbox/file_accessor.rb +26 -19
- data/lib/cocoapods/sandbox/headers_store.rb +12 -7
- data/lib/cocoapods/sources_manager.rb +6 -6
- data/lib/cocoapods/target.rb +1 -1
- data/lib/cocoapods/target/pod_target.rb +2 -2
- data/lib/cocoapods/user_interface.rb +1 -1
- data/lib/cocoapods/user_interface/error_report.rb +3 -0
- data/lib/cocoapods/validator.rb +2 -2
- metadata +21 -26
- data/lib/cocoapods/command/push.rb +0 -21
@@ -47,11 +47,11 @@ module Pod
|
|
47
47
|
# @return [Xcodeproj::Config]
|
48
48
|
#
|
49
49
|
def generate
|
50
|
-
header_search_path_flags = target.sandbox.public_headers.search_paths
|
50
|
+
header_search_path_flags = target.sandbox.public_headers.search_paths(target.platform)
|
51
51
|
@xcconfig = Xcodeproj::Config.new(
|
52
52
|
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
|
53
53
|
'OTHER_LIBTOOLFLAGS' => '$(OTHER_LDFLAGS)',
|
54
|
-
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(
|
54
|
+
'HEADER_SEARCH_PATHS' => XCConfigHelper.quote(header_search_path_flags),
|
55
55
|
'PODS_ROOT' => target.relative_pods_root,
|
56
56
|
'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) COCOAPODS=1',
|
57
57
|
'OTHER_CFLAGS' => '$(inherited) ' + XCConfigHelper.quote(header_search_path_flags, '-isystem')
|
@@ -45,7 +45,10 @@ module Pod
|
|
45
45
|
# @return [Xcodeproj::Config]
|
46
46
|
#
|
47
47
|
def generate
|
48
|
-
|
48
|
+
target_search_paths = target.build_headers.search_paths(target.platform)
|
49
|
+
sandbox_search_paths = target.sandbox.public_headers.search_paths(target.platform)
|
50
|
+
search_paths = target_search_paths.concat(sandbox_search_paths).uniq
|
51
|
+
|
49
52
|
config = {
|
50
53
|
'OTHER_LDFLAGS' => XCConfigHelper.default_ld_flags(target),
|
51
54
|
'PODS_ROOT' => '${SRCROOT}',
|
data/lib/cocoapods/installer.rb
CHANGED
@@ -418,7 +418,7 @@ module Pod
|
|
418
418
|
pod_targets.sort_by(&:name).each do |pod_target|
|
419
419
|
pod_target.file_accessors.each do |file_accessor|
|
420
420
|
file_accessor.spec_consumer.frameworks.each do |framework|
|
421
|
-
pod_target.
|
421
|
+
pod_target.native_target.add_system_framework(framework)
|
422
422
|
end
|
423
423
|
end
|
424
424
|
end
|
@@ -428,7 +428,7 @@ module Pod
|
|
428
428
|
def set_target_dependencies
|
429
429
|
aggregate_targets.each do |aggregate_target|
|
430
430
|
aggregate_target.pod_targets.each do |pod_target|
|
431
|
-
aggregate_target.
|
431
|
+
aggregate_target.native_target.add_dependency(pod_target.native_target)
|
432
432
|
pod_target.dependencies.each do |dep|
|
433
433
|
|
434
434
|
unless dep == pod_target.pod_name
|
@@ -437,7 +437,7 @@ module Pod
|
|
437
437
|
unless pod_dependency_target
|
438
438
|
puts "[BUG] DEP: #{dep}"
|
439
439
|
end
|
440
|
-
pod_target.
|
440
|
+
pod_target.native_target.add_dependency(pod_dependency_target.native_target)
|
441
441
|
end
|
442
442
|
end
|
443
443
|
end
|
@@ -8,6 +8,8 @@ module Pod
|
|
8
8
|
|
9
9
|
autoload :SandboxAnalyzer, 'cocoapods/installer/analyzer/sandbox_analyzer'
|
10
10
|
|
11
|
+
autoload :LockingDependencyAnalyzer, 'cocoapods/installer/analyzer/locking_dependency_analyzer'
|
12
|
+
|
11
13
|
# @return [Sandbox] The sandbox where the Pods should be installed.
|
12
14
|
#
|
13
15
|
attr_reader :sandbox
|
@@ -149,17 +151,13 @@ module Pod
|
|
149
151
|
pods_state = nil
|
150
152
|
UI.section 'Finding Podfile changes' do
|
151
153
|
pods_by_state = lockfile.detect_changes_with_podfile(podfile)
|
152
|
-
pods_by_state.dup.each do |state, full_names|
|
153
|
-
pods = full_names.map { |fn| Specification.root_name(fn) }.uniq
|
154
|
-
pods_by_state[state] = pods
|
155
|
-
end
|
156
154
|
pods_state = SpecsState.new(pods_by_state)
|
157
155
|
pods_state.print
|
158
156
|
end
|
159
157
|
pods_state
|
160
158
|
else
|
161
159
|
state = SpecsState.new
|
162
|
-
state.added.concat(podfile.dependencies.map(&:
|
160
|
+
state.added.concat(podfile.dependencies.map(&:name).uniq)
|
163
161
|
state
|
164
162
|
end
|
165
163
|
end
|
@@ -231,21 +229,17 @@ module Pod
|
|
231
229
|
# is in update mode, to prevent it from upgrading the Pods that weren't
|
232
230
|
# changed in the {Podfile}.
|
233
231
|
#
|
234
|
-
# @return [
|
235
|
-
# that prevent the resolver to update
|
232
|
+
# @return [Molinillo::DependencyGraph<Dependency>] the dependencies
|
233
|
+
# generated by the lockfile that prevent the resolver to update
|
234
|
+
# a Pod.
|
236
235
|
#
|
237
236
|
def generate_version_locking_dependencies
|
238
|
-
if update_mode == :all
|
239
|
-
|
237
|
+
if update_mode == :all || !lockfile
|
238
|
+
LockingDependencyAnalyzer.unlocked_dependency_graph
|
240
239
|
else
|
241
|
-
|
242
|
-
if update_mode == :selected
|
243
|
-
|
244
|
-
locking_pods = locking_pods.select { |pod| !update[:pods].include?(pod) }
|
245
|
-
end
|
246
|
-
locking_pods.map do |pod|
|
247
|
-
lockfile.dependencies_to_lock_pod_named(pod)
|
248
|
-
end.flatten
|
240
|
+
pods_to_update = result.podfile_state.changed + result.podfile_state.deleted
|
241
|
+
pods_to_update += update[:pods] if update_mode == :selected
|
242
|
+
LockingDependencyAnalyzer.generate_version_locking_dependencies(lockfile, pods_to_update)
|
249
243
|
end
|
250
244
|
end
|
251
245
|
|
@@ -274,6 +268,11 @@ module Pod
|
|
274
268
|
deps_to_fetch_if_needed = []
|
275
269
|
deps_with_external_source = podfile.dependencies.select(&:external_source)
|
276
270
|
|
271
|
+
deps_with_different_sources = podfile.dependencies.group_by(&:root_name).select { |_root_name, dependencies| dependencies.map(&:external_source).uniq.count > 1 }
|
272
|
+
deps_with_different_sources.each do |root_name, dependencies|
|
273
|
+
raise Informative, "There are multiple dependencies with different sources for `#{root_name}` in #{UI.path podfile.defined_in_file}:\n\n- #{dependencies.map(&:to_s).join("\n- ")}"
|
274
|
+
end
|
275
|
+
|
277
276
|
if update_mode == :all
|
278
277
|
deps_to_fetch = deps_with_external_source
|
279
278
|
else
|
@@ -281,14 +280,14 @@ module Pod
|
|
281
280
|
if update_mode == :selected
|
282
281
|
pods_to_fetch += update[:pods]
|
283
282
|
end
|
284
|
-
deps_to_fetch = deps_with_external_source.select { |dep| pods_to_fetch.include?(dep.
|
285
|
-
deps_to_fetch_if_needed = deps_with_external_source.select { |dep| result.podfile_state.unchanged.include?(dep.
|
286
|
-
deps_to_fetch += deps_to_fetch_if_needed.select { |dep| sandbox.specification(dep.
|
283
|
+
deps_to_fetch = deps_with_external_source.select { |dep| pods_to_fetch.include?(dep.name) }
|
284
|
+
deps_to_fetch_if_needed = deps_with_external_source.select { |dep| result.podfile_state.unchanged.include?(dep.name) }
|
285
|
+
deps_to_fetch += deps_to_fetch_if_needed.select { |dep| sandbox.specification(dep.name).nil? || !dep.external_source[:local].nil? || !dep.external_source[:path].nil? || !sandbox.pod_dir(dep.name).directory? }
|
287
286
|
end
|
288
287
|
|
289
288
|
unless deps_to_fetch.empty?
|
290
289
|
UI.section 'Fetching external sources' do
|
291
|
-
deps_to_fetch.uniq.sort.each do |dependency|
|
290
|
+
deps_to_fetch.uniq(&:root_name).sort.each do |dependency|
|
292
291
|
source = ExternalSources.from_dependency(dependency, podfile.defined_in_file)
|
293
292
|
source.fetch(sandbox)
|
294
293
|
end
|
@@ -316,6 +315,13 @@ module Pod
|
|
316
315
|
# grouped by target.
|
317
316
|
#
|
318
317
|
def resolve_dependencies
|
318
|
+
duplicate_dependencies = podfile.dependencies.group_by(&:name).
|
319
|
+
select { |_name, dependencies| dependencies.count > 1 }
|
320
|
+
duplicate_dependencies.each do |name, dependencies|
|
321
|
+
UI.warn "There are duplicate dependencies on `#{name}` in #{UI.path podfile.defined_in_file}:\n\n" \
|
322
|
+
"- #{dependencies.map(&:to_s).join("\n- ")}"
|
323
|
+
end
|
324
|
+
|
319
325
|
specs_by_target = nil
|
320
326
|
UI.section "Resolving dependencies of #{UI.path podfile.defined_in_file}" do
|
321
327
|
resolver = Resolver.new(sandbox, podfile, locked_dependencies, sources)
|
@@ -352,8 +358,9 @@ module Pod
|
|
352
358
|
|
353
359
|
# @!group Analysis internal products
|
354
360
|
|
355
|
-
# @return [
|
356
|
-
# that prevent the resolver to update a
|
361
|
+
# @return [Molinillo::DependencyGraph<Dependency>] the dependencies
|
362
|
+
# generated by the lockfile that prevent the resolver to update a
|
363
|
+
# Pod.
|
357
364
|
#
|
358
365
|
attr_reader :locked_dependencies
|
359
366
|
|
@@ -363,23 +370,17 @@ module Pod
|
|
363
370
|
|
364
371
|
# Returns the sources used to query for specifications
|
365
372
|
#
|
366
|
-
#
|
367
|
-
#
|
368
|
-
# sources is deprecated.
|
373
|
+
# When no explicit Podfile sources are defined, this defaults to all
|
374
|
+
# available sources ({SourcesManager.all}).
|
369
375
|
#
|
370
376
|
# @return [Array<Source>] the sources to be used in finding
|
371
|
-
# specifications, as specified by the {#podfile}.
|
377
|
+
# specifications, as specified by the {#podfile} or all sources.
|
372
378
|
#
|
373
379
|
def sources
|
374
380
|
@sources ||= begin
|
375
381
|
sources = podfile.sources
|
376
382
|
if sources.empty?
|
377
|
-
SourcesManager.all
|
378
|
-
UI.warn all.reduce("The use of implicit sources has been " \
|
379
|
-
"deprecated. To continue using all of the sources currently " \
|
380
|
-
"on your machine, add the following to the top of your " \
|
381
|
-
"Podfile:\n") { |w, s| w << "\n source '#{s.url}'" } + "\n"
|
382
|
-
end
|
383
|
+
SourcesManager.all
|
383
384
|
else
|
384
385
|
sources.map do |url|
|
385
386
|
SourcesManager.find_or_create_source_with_url(url)
|
@@ -604,7 +605,7 @@ module Pod
|
|
604
605
|
#
|
605
606
|
class SpecsState
|
606
607
|
# @param [Hash{Symbol=>String}] pods_by_state
|
607
|
-
# The
|
608
|
+
# The name of the pods grouped by their state
|
608
609
|
# (`:added`, `:removed`, `:changed` or `:unchanged`).
|
609
610
|
#
|
610
611
|
def initialize(pods_by_state = nil)
|
@@ -656,12 +657,9 @@ module Pod
|
|
656
657
|
# @param [Symbol]
|
657
658
|
# the state of the Pod.
|
658
659
|
#
|
659
|
-
# @raise If there is an attempt to add the name of a subspec.
|
660
|
-
#
|
661
660
|
# @return [void]
|
662
661
|
#
|
663
662
|
def add_name(name, state)
|
664
|
-
raise '[Bug] Attempt to add subspec to the pods state' if name.include?('/')
|
665
663
|
send(state) << name
|
666
664
|
end
|
667
665
|
end
|
@@ -0,0 +1,72 @@
|
|
1
|
+
require 'molinillo/dependency_graph'
|
2
|
+
|
3
|
+
module Pod
|
4
|
+
class Installer
|
5
|
+
class Analyzer
|
6
|
+
# Generates dependencies that require the specific version of the Pods
|
7
|
+
# that haven't changed in the {Lockfile}.
|
8
|
+
module LockingDependencyAnalyzer
|
9
|
+
# Generates dependencies that require the specific version of the Pods
|
10
|
+
# that haven't changed in the {Lockfile}.
|
11
|
+
#
|
12
|
+
# These dependencies are passed to the {Resolver}, unless the installer
|
13
|
+
# is in update mode, to prevent it from upgrading the Pods that weren't
|
14
|
+
# changed in the {Podfile}.
|
15
|
+
#
|
16
|
+
# @return [Molinillo::DependencyGraph<Dependency>] the dependencies
|
17
|
+
# generated by the lockfile that prevent the resolver to update
|
18
|
+
# a Pod.
|
19
|
+
#
|
20
|
+
def self.generate_version_locking_dependencies(lockfile, pods_to_update)
|
21
|
+
dependency_graph = Molinillo::DependencyGraph.new
|
22
|
+
|
23
|
+
if lockfile
|
24
|
+
explicit_dependencies = lockfile.to_hash['DEPENDENCIES'] || []
|
25
|
+
explicit_dependencies.each do |string|
|
26
|
+
dependency = Dependency.new(string)
|
27
|
+
dependency_graph.add_root_vertex(dependency.name, nil)
|
28
|
+
end
|
29
|
+
|
30
|
+
pods = lockfile.to_hash['PODS'] || []
|
31
|
+
pods.each do |pod|
|
32
|
+
add_to_dependency_graph(pod, [], dependency_graph)
|
33
|
+
end
|
34
|
+
|
35
|
+
pods_to_update.each { |u| dependency_graph.detach_vertex_named(u) }
|
36
|
+
end
|
37
|
+
|
38
|
+
dependency_graph
|
39
|
+
end
|
40
|
+
|
41
|
+
# Generates a completely 'unlocked' dependency graph.
|
42
|
+
#
|
43
|
+
# @return [Molinillo::DependencyGraph<Dependency>] an empty dependency
|
44
|
+
# graph
|
45
|
+
#
|
46
|
+
def self.unlocked_dependency_graph
|
47
|
+
Molinillo::DependencyGraph.new
|
48
|
+
end
|
49
|
+
|
50
|
+
private
|
51
|
+
|
52
|
+
def self.add_child_vertex_to_graph(dependency_string, parents, dependency_graph)
|
53
|
+
dependency = Dependency.from_string(dependency_string)
|
54
|
+
dependency_graph.add_child_vertex(dependency.name, parents.empty? ? dependency : nil, parents, nil)
|
55
|
+
dependency
|
56
|
+
end
|
57
|
+
|
58
|
+
def self.add_to_dependency_graph(object, parents, dependency_graph)
|
59
|
+
case object
|
60
|
+
when String
|
61
|
+
add_child_vertex_to_graph(object, parents, dependency_graph)
|
62
|
+
when Hash
|
63
|
+
object.each do |key, value|
|
64
|
+
dependency = add_child_vertex_to_graph(key, parents, dependency_graph)
|
65
|
+
value.each { |v| add_to_dependency_graph(v, [dependency.name], dependency_graph) }
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
end
|
72
|
+
end
|
@@ -8,7 +8,7 @@ module Pod
|
|
8
8
|
#
|
9
9
|
attr_reader :sandbox
|
10
10
|
|
11
|
-
# @return [Array<
|
11
|
+
# @return [Array<PodTarget>] The libraries of the installation.
|
12
12
|
#
|
13
13
|
attr_reader :libraries
|
14
14
|
|
@@ -17,7 +17,7 @@ module Pod
|
|
17
17
|
attr_reader :pods_project
|
18
18
|
|
19
19
|
# @param [Sandbox] sandbox @see sandbox
|
20
|
-
# @param [Array<
|
20
|
+
# @param [Array<PodTarget>] libraries @see libraries
|
21
21
|
# @param [Project] libraries @see libraries
|
22
22
|
#
|
23
23
|
def initialize(sandbox, libraries, pods_project)
|
@@ -114,15 +114,15 @@ module Pod
|
|
114
114
|
libraries.each do |library|
|
115
115
|
library.file_accessors.each do |file_accessor|
|
116
116
|
headers_sandbox = Pathname.new(file_accessor.spec.root.name)
|
117
|
-
library.build_headers.add_search_path(headers_sandbox)
|
118
|
-
sandbox.public_headers.add_search_path(headers_sandbox)
|
117
|
+
library.build_headers.add_search_path(headers_sandbox, library.platform)
|
118
|
+
sandbox.public_headers.add_search_path(headers_sandbox, library.platform)
|
119
119
|
|
120
120
|
header_mappings(headers_sandbox, file_accessor, file_accessor.headers).each do |namespaced_path, files|
|
121
|
-
library.build_headers.add_files(namespaced_path, files)
|
121
|
+
library.build_headers.add_files(namespaced_path, files, library.platform)
|
122
122
|
end
|
123
123
|
|
124
124
|
header_mappings(headers_sandbox, file_accessor, file_accessor.public_headers).each do |namespaced_path, files|
|
125
|
-
sandbox.public_headers.add_files(namespaced_path, files)
|
125
|
+
sandbox.public_headers.add_files(namespaced_path, files, library.platform)
|
126
126
|
end
|
127
127
|
end
|
128
128
|
end
|
@@ -167,11 +167,12 @@ module Pod
|
|
167
167
|
# Computes the destination sub-directory in the sandbox
|
168
168
|
#
|
169
169
|
# @param [Pathname] headers_sandbox
|
170
|
-
# The sandbox where the
|
170
|
+
# The sandbox where the header links should be stored for this
|
171
171
|
# Pod.
|
172
172
|
#
|
173
|
-
# @param [
|
174
|
-
# The consumer for which the headers need to be
|
173
|
+
# @param [Sandbox::FileAccessor] file_accessor
|
174
|
+
# The consumer file accessor for which the headers need to be
|
175
|
+
# linked.
|
175
176
|
#
|
176
177
|
# @param [Array<Pathname>] headers
|
177
178
|
# The absolute paths of the headers which need to be mapped.
|
@@ -10,16 +10,16 @@ module Pod
|
|
10
10
|
#
|
11
11
|
attr_reader :sandbox
|
12
12
|
|
13
|
-
# @return [
|
13
|
+
# @return [Target] The library whose target needs to be generated.
|
14
14
|
#
|
15
|
-
attr_reader :
|
15
|
+
attr_reader :target
|
16
16
|
|
17
17
|
# @param [Project] project @see project
|
18
|
-
# @param [
|
18
|
+
# @param [Target] target @see target
|
19
19
|
#
|
20
|
-
def initialize(sandbox,
|
20
|
+
def initialize(sandbox, target)
|
21
21
|
@sandbox = sandbox
|
22
|
-
@
|
22
|
+
@target = target
|
23
23
|
end
|
24
24
|
|
25
25
|
private
|
@@ -36,31 +36,31 @@ module Pod
|
|
36
36
|
# @return [void]
|
37
37
|
#
|
38
38
|
def add_target
|
39
|
-
name =
|
40
|
-
platform =
|
41
|
-
deployment_target =
|
42
|
-
@
|
39
|
+
name = target.label
|
40
|
+
platform = target.platform.name
|
41
|
+
deployment_target = target.platform.deployment_target.to_s
|
42
|
+
@native_target = project.new_target(:static_library, name, platform, deployment_target)
|
43
43
|
|
44
|
-
|
45
|
-
configuration = @
|
44
|
+
target.user_build_configurations.each do |bc_name, type|
|
45
|
+
configuration = @native_target.add_build_configuration(bc_name, type)
|
46
46
|
end
|
47
47
|
|
48
48
|
settings = { 'OTHER_LDFLAGS' => '', 'OTHER_LIBTOOLFLAGS' => '' }
|
49
|
-
if
|
50
|
-
settings['ARCHS'] =
|
49
|
+
if target.archs
|
50
|
+
settings['ARCHS'] = target.archs
|
51
51
|
end
|
52
52
|
|
53
|
-
@
|
53
|
+
@native_target.build_configurations.each do |configuration|
|
54
54
|
configuration.build_settings.merge!(settings)
|
55
55
|
end
|
56
56
|
|
57
|
-
|
57
|
+
target.native_target = @native_target
|
58
58
|
end
|
59
59
|
|
60
60
|
# Creates the directory where to store the support files of the target.
|
61
61
|
#
|
62
62
|
def create_support_files_dir
|
63
|
-
|
63
|
+
target.support_files_dir.mkdir
|
64
64
|
end
|
65
65
|
|
66
66
|
# Generates a dummy source file for each target so libraries that contain
|
@@ -69,11 +69,11 @@ module Pod
|
|
69
69
|
# @return [void]
|
70
70
|
#
|
71
71
|
def create_dummy_source
|
72
|
-
path =
|
73
|
-
generator = Generator::DummySource.new(
|
72
|
+
path = target.dummy_source_path
|
73
|
+
generator = Generator::DummySource.new(target.label)
|
74
74
|
generator.save_as(path)
|
75
75
|
file_reference = add_file_to_support_group(path)
|
76
|
-
|
76
|
+
native_target.source_build_phase.add_file_reference(file_reference)
|
77
77
|
end
|
78
78
|
|
79
79
|
# @return [PBXNativeTarget] the target generated by the installation
|
@@ -81,7 +81,7 @@ module Pod
|
|
81
81
|
#
|
82
82
|
# @note Generated by the {#add_target} step.
|
83
83
|
#
|
84
|
-
attr_reader :
|
84
|
+
attr_reader :native_target
|
85
85
|
|
86
86
|
private
|
87
87
|
|
@@ -98,7 +98,7 @@ module Pod
|
|
98
98
|
# @return [TargetDefinition] the target definition of the library.
|
99
99
|
#
|
100
100
|
def target_definition
|
101
|
-
|
101
|
+
target.target_definition
|
102
102
|
end
|
103
103
|
|
104
104
|
# @return [PBXGroup] the group where the file references to the support
|
@@ -9,7 +9,7 @@ module Pod
|
|
9
9
|
# @return [void]
|
10
10
|
#
|
11
11
|
def install!
|
12
|
-
UI.message "- Installing target `#{
|
12
|
+
UI.message "- Installing target `#{target.name}` #{target.platform}" do
|
13
13
|
add_target
|
14
14
|
create_support_files_dir
|
15
15
|
create_suport_files_group
|
@@ -33,8 +33,8 @@ module Pod
|
|
33
33
|
#
|
34
34
|
def create_suport_files_group
|
35
35
|
parent = project.support_files_group
|
36
|
-
name =
|
37
|
-
dir =
|
36
|
+
name = target.name
|
37
|
+
dir = target.support_files_dir
|
38
38
|
@support_files_group = parent.new_group(name, dir)
|
39
39
|
end
|
40
40
|
|
@@ -43,11 +43,11 @@ module Pod
|
|
43
43
|
# @return [void]
|
44
44
|
#
|
45
45
|
def create_xcconfig_file
|
46
|
-
|
47
|
-
path =
|
48
|
-
gen = Generator::XCConfig::AggregateXCConfig.new(
|
46
|
+
native_target.build_configurations.each do |configuration|
|
47
|
+
path = target.xcconfig_path(configuration.name)
|
48
|
+
gen = Generator::XCConfig::AggregateXCConfig.new(target, configuration.name)
|
49
49
|
gen.save_as(path)
|
50
|
-
|
50
|
+
target.xcconfigs[configuration.name] = gen.xcconfig
|
51
51
|
xcconfig_file_ref = add_file_to_support_group(path)
|
52
52
|
configuration.base_configuration_reference = xcconfig_file_ref
|
53
53
|
end
|
@@ -57,8 +57,8 @@ module Pod
|
|
57
57
|
# pods and the installed specifications of a pod.
|
58
58
|
#
|
59
59
|
def create_target_environment_header
|
60
|
-
path =
|
61
|
-
generator = Generator::TargetEnvironmentHeader.new(
|
60
|
+
path = target.target_environment_header_path
|
61
|
+
generator = Generator::TargetEnvironmentHeader.new(target.specs_by_build_configuration)
|
62
62
|
generator.save_as(path)
|
63
63
|
add_file_to_support_group(path)
|
64
64
|
end
|
@@ -66,15 +66,15 @@ module Pod
|
|
66
66
|
# Generates the bridge support metadata if requested by the {Podfile}.
|
67
67
|
#
|
68
68
|
# @note The bridge support metadata is added to the resources of the
|
69
|
-
#
|
69
|
+
# target because it is needed for environments interpreted at
|
70
70
|
# runtime.
|
71
71
|
#
|
72
72
|
# @return [void]
|
73
73
|
#
|
74
74
|
def create_bridge_support_file
|
75
75
|
if target_definition.podfile.generate_bridge_support?
|
76
|
-
path =
|
77
|
-
headers =
|
76
|
+
path = target.bridge_support_path
|
77
|
+
headers = native_target.headers_build_phase.files.map { |bf| sandbox.root + bf.file_ref.path }
|
78
78
|
generator = Generator::BridgeSupport.new(headers)
|
79
79
|
generator.save_as(path)
|
80
80
|
add_file_to_support_group(path)
|
@@ -91,15 +91,15 @@ module Pod
|
|
91
91
|
# @return [void]
|
92
92
|
#
|
93
93
|
def create_copy_resources_script
|
94
|
-
path =
|
95
|
-
file_accessors =
|
94
|
+
path = target.copy_resources_script_path
|
95
|
+
file_accessors = target.pod_targets.map(&:file_accessors).flatten
|
96
96
|
resource_paths = file_accessors.map { |accessor| accessor.resources.flatten.map { |res| res.relative_path_from(project.path.dirname) } }.flatten
|
97
97
|
resource_bundles = file_accessors.map { |accessor| accessor.resource_bundles.keys.map { |name| "${BUILT_PRODUCTS_DIR}/#{name}.bundle" } }.flatten
|
98
98
|
resources = []
|
99
99
|
resources.concat(resource_paths)
|
100
100
|
resources.concat(resource_bundles)
|
101
101
|
resources << bridge_support_file if bridge_support_file
|
102
|
-
generator = Generator::CopyResourcesScript.new(resources,
|
102
|
+
generator = Generator::CopyResourcesScript.new(resources, target.platform)
|
103
103
|
generator.save_as(path)
|
104
104
|
add_file_to_support_group(path)
|
105
105
|
end
|
@@ -109,10 +109,10 @@ module Pod
|
|
109
109
|
# @return [void]
|
110
110
|
#
|
111
111
|
def create_acknowledgements
|
112
|
-
basepath =
|
112
|
+
basepath = target.acknowledgements_basepath
|
113
113
|
Generator::Acknowledgements.generators.each do |generator_class|
|
114
114
|
path = generator_class.path_from_basepath(basepath)
|
115
|
-
file_accessors =
|
115
|
+
file_accessors = target.pod_targets.map(&:file_accessors).flatten
|
116
116
|
generator = generator_class.new(file_accessors)
|
117
117
|
generator.save_as(path)
|
118
118
|
add_file_to_support_group(path)
|