cocoapods-core 0.33.1 → 0.34.0.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cocoapods-core/dependency.rb +1 -1
- data/lib/cocoapods-core/gem_version.rb +1 -1
- data/lib/cocoapods-core/http.rb +4 -3
- data/lib/cocoapods-core/lockfile.rb +16 -15
- data/lib/cocoapods-core/podfile/dsl.rb +61 -3
- data/lib/cocoapods-core/podfile/target_definition.rb +100 -1
- data/lib/cocoapods-core/podfile.rb +9 -2
- data/lib/cocoapods-core/requirement.rb +1 -1
- data/lib/cocoapods-core/source/abstract_data_provider.rb +3 -3
- data/lib/cocoapods-core/source/aggregate.rb +17 -31
- data/lib/cocoapods-core/specification/consumer.rb +2 -2
- data/lib/cocoapods-core/specification/dsl/attribute_support.rb +4 -4
- data/lib/cocoapods-core/specification/dsl/deprecations.rb +0 -37
- data/lib/cocoapods-core/specification/dsl.rb +11 -19
- data/lib/cocoapods-core/specification/json.rb +2 -2
- data/lib/cocoapods-core/specification/linter/analyzer.rb +89 -20
- data/lib/cocoapods-core/specification/linter/result.rb +1 -1
- data/lib/cocoapods-core/specification/linter.rb +19 -2
- data/lib/cocoapods-core/specification/root_attribute_accessors.rb +7 -0
- data/lib/cocoapods-core/specification/set/presenter.rb +22 -0
- data/lib/cocoapods-core/specification/set/statistics.rb +3 -3
- data/lib/cocoapods-core/specification/set.rb +1 -1
- data/lib/cocoapods-core/specification.rb +5 -5
- data/lib/cocoapods-core/yaml_helper.rb +72 -11
- data/lib/cocoapods-core.rb +1 -1
- metadata +27 -27
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0c766e4a992ce00a3c5e383dfb5ce948ac9f2415
|
4
|
+
data.tar.gz: d651129ce2d932f29abe25534aac47e3207388d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 50cfb988efe23be79ddcf97e5bcd4dee9b54d8b4237e5745b7702d673a3462b8a971cfb07bb3af946f773b94a04401a1703d577680ab41d6977c7097a75164fd
|
7
|
+
data.tar.gz: 788e5574fdf5c4ea4557e353c4a4b9957e3212ce396baae8972ddec0945cb15de1d1a5380a1c264910b8791de569831350ef18d8b05661d086669ddc1ffdb7d8
|
@@ -179,7 +179,7 @@ module Pod
|
|
179
179
|
return false unless head? == other.head?
|
180
180
|
return false unless external_source == other.external_source
|
181
181
|
|
182
|
-
other.requirement.requirements.all? do |
|
182
|
+
other.requirement.requirements.all? do | _operator, version |
|
183
183
|
requirement.satisfied_by? Version.new(version)
|
184
184
|
end
|
185
185
|
end
|
data/lib/cocoapods-core/http.rb
CHANGED
@@ -42,7 +42,7 @@ module Pod
|
|
42
42
|
begin
|
43
43
|
url = get_actual_url(url)
|
44
44
|
resp = perform_head_request(url)
|
45
|
-
rescue SocketError
|
45
|
+
rescue SocketError, URI::InvalidURIError, REST::Error
|
46
46
|
resp = nil
|
47
47
|
end
|
48
48
|
|
@@ -60,16 +60,17 @@ module Pod
|
|
60
60
|
def self.perform_head_request(url)
|
61
61
|
require 'rest'
|
62
62
|
|
63
|
-
resp = ::REST.head(url)
|
63
|
+
resp = ::REST.head(url, 'User-Agent' => USER_AGENT)
|
64
64
|
|
65
65
|
if resp.status_code >= 400
|
66
|
-
resp = ::REST.get(url)
|
66
|
+
resp = ::REST.get(url, 'User-Agent' => USER_AGENT)
|
67
67
|
end
|
68
68
|
|
69
69
|
resp
|
70
70
|
end
|
71
71
|
|
72
72
|
MAX_HTTP_REDIRECTS = 3
|
73
|
+
USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10) AppleWebKit/538.43.40 (KHTML, like Gecko) Version/8.0 Safari/538.43.40'
|
73
74
|
|
74
75
|
#-------------------------------------------------------------------------#
|
75
76
|
end
|
@@ -38,7 +38,7 @@ module Pod
|
|
38
38
|
def self.from_file(path)
|
39
39
|
return nil unless path.exist?
|
40
40
|
require 'yaml'
|
41
|
-
hash =
|
41
|
+
hash = YAMLHelper.load_file(path)
|
42
42
|
unless hash && hash.is_a?(Hash)
|
43
43
|
raise Informative, "Invalid Lockfile in `#{path}`"
|
44
44
|
end
|
@@ -133,20 +133,21 @@ module Pod
|
|
133
133
|
#
|
134
134
|
# @raise If there is no version stored for the given name.
|
135
135
|
#
|
136
|
-
# @return [Dependency] the generated dependency.
|
136
|
+
# @return [Array<Dependency>] the generated dependency.
|
137
137
|
#
|
138
|
-
def
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
unless dep && version
|
143
|
-
raise StandardError, "Attempt to lock the `#{name}` Pod without an " \
|
138
|
+
def dependencies_to_lock_pod_named(name)
|
139
|
+
deps = dependencies.select { |d| d.root_name == name }
|
140
|
+
if deps.empty?
|
141
|
+
raise StandardError, "Attempt to lock the `#{name}` Pod without a " \
|
144
142
|
'known dependency.'
|
145
143
|
end
|
146
144
|
|
147
|
-
|
148
|
-
|
149
|
-
|
145
|
+
deps.map do |dep|
|
146
|
+
version = version(dep.name)
|
147
|
+
locked_dependency = dep.dup
|
148
|
+
locked_dependency.specific_version = version
|
149
|
+
locked_dependency
|
150
|
+
end
|
150
151
|
end
|
151
152
|
|
152
153
|
# @return [Version] The version of CocoaPods which generated this lockfile.
|
@@ -233,8 +234,8 @@ module Pod
|
|
233
234
|
[:added, :changed, :removed, :unchanged].each { |k| result[k] = [] }
|
234
235
|
|
235
236
|
installed_deps = dependencies.map do |dep|
|
236
|
-
|
237
|
-
end
|
237
|
+
dependencies_to_lock_pod_named(dep.root_name)
|
238
|
+
end.flatten
|
238
239
|
all_dep_names = (dependencies + podfile.dependencies).map(&:name).uniq
|
239
240
|
all_dep_names.each do |name|
|
240
241
|
installed_dep = installed_deps.find { |d| d.name == name }
|
@@ -393,7 +394,7 @@ module Pod
|
|
393
394
|
# @return [Array] the generated data.
|
394
395
|
#
|
395
396
|
def generate_dependencies_data(podfile)
|
396
|
-
podfile.dependencies.map
|
397
|
+
podfile.dependencies.map(&:to_s).sort
|
397
398
|
end
|
398
399
|
|
399
400
|
# Generates the information of the external sources.
|
@@ -431,7 +432,7 @@ module Pod
|
|
431
432
|
#
|
432
433
|
def generate_checksums(specs)
|
433
434
|
checksums = {}
|
434
|
-
specs.select
|
435
|
+
specs.select(&:defined_in_file).each do |spec|
|
435
436
|
checksums[spec.root.name] = spec.checksum
|
436
437
|
end
|
437
438
|
checksums
|
@@ -89,6 +89,26 @@ module Pod
|
|
89
89
|
#
|
90
90
|
# ------
|
91
91
|
#
|
92
|
+
# ### Build configurations
|
93
|
+
#
|
94
|
+
# *IMPORTANT*: the following syntax is tentative and might change without
|
95
|
+
# notice in future. This feature is released in this state due to
|
96
|
+
# the strong demand for it. You can use it but you might need to change
|
97
|
+
# your Podfile to use future versions of CocoaPods. Anyway a clear and
|
98
|
+
# simple upgrade path will be provided.
|
99
|
+
#
|
100
|
+
# By default dependencies are installed on all the build configurations
|
101
|
+
# of the target. For debug purposes or for other reasons, they can be
|
102
|
+
# enabled only on a given list of build configuration names.
|
103
|
+
#
|
104
|
+
# pod 'PonyDebugger', :configurations => ['Release', 'App Store']
|
105
|
+
#
|
106
|
+
# Alternatively you can white-list only a single build configuration.
|
107
|
+
#
|
108
|
+
# pod 'PonyDebugger', :configuration => ['Release']
|
109
|
+
#
|
110
|
+
# ------
|
111
|
+
#
|
92
112
|
# Dependencies can be obtained also from external sources.
|
93
113
|
#
|
94
114
|
#
|
@@ -145,7 +165,7 @@ module Pod
|
|
145
165
|
# @note This method allow a nil name and the raises to be more
|
146
166
|
# informative.
|
147
167
|
#
|
148
|
-
|
168
|
+
# @note Support for inline podspecs has been deprecated.
|
149
169
|
#
|
150
170
|
# @return [void]
|
151
171
|
#
|
@@ -448,6 +468,44 @@ module Pod
|
|
448
468
|
|
449
469
|
#-----------------------------------------------------------------------#
|
450
470
|
|
471
|
+
# @!group Sources
|
472
|
+
#
|
473
|
+
# The Podfile retrieves specs from a given list of sources (repos).
|
474
|
+
#
|
475
|
+
# Sources are __global__ and they are not stored per target definition.
|
476
|
+
|
477
|
+
#-----------------------------------------------------------------------#
|
478
|
+
|
479
|
+
# Specifies the location of specs
|
480
|
+
#
|
481
|
+
# -----
|
482
|
+
#
|
483
|
+
# By default, the github Cocoapods/specs repository is used. Use this
|
484
|
+
# method to specify (an) other(s) source(s). The order of the sources is
|
485
|
+
# relevant. CocoaPods will use the highest version of a Pod of the first
|
486
|
+
# source which includes the Pod (regardless whether other sources have a
|
487
|
+
# higher version).
|
488
|
+
#
|
489
|
+
# @param [String] source
|
490
|
+
# The name of a specs repo. Previously specified by user
|
491
|
+
# via pod repo add command
|
492
|
+
#
|
493
|
+
# @example Specifying to use first `my_private_repo` and then the
|
494
|
+
# CocoaPods Master Repo
|
495
|
+
#
|
496
|
+
# source 'my_private_repo'
|
497
|
+
# source 'master'
|
498
|
+
#
|
499
|
+
# @return [void]
|
500
|
+
#
|
501
|
+
def source(source)
|
502
|
+
hash_sources = get_hash_value('sources') || []
|
503
|
+
hash_sources << source
|
504
|
+
set_hash_value('sources', hash_sources.uniq)
|
505
|
+
end
|
506
|
+
|
507
|
+
#-----------------------------------------------------------------------#
|
508
|
+
|
451
509
|
# @!group Hooks
|
452
510
|
# The Podfile provides hooks that will be called during the
|
453
511
|
# installation process.
|
@@ -460,7 +518,7 @@ module Pod
|
|
460
518
|
# been downloaded but before they are installed.
|
461
519
|
#
|
462
520
|
# It receives the
|
463
|
-
# [`Pod::Hooks::InstallerRepresentation`](http://
|
521
|
+
# [`Pod::Hooks::InstallerRepresentation`](http://rubydoc.info/gems/cocoapods/Pod/Hooks/InstallerRepresentation/)
|
464
522
|
# as its only argument.
|
465
523
|
#
|
466
524
|
# @example Defining a pre install hook in a Podfile.
|
@@ -479,7 +537,7 @@ module Pod
|
|
479
537
|
# to perform.
|
480
538
|
#
|
481
539
|
# It receives the
|
482
|
-
# [`Pod::Hooks::InstallerRepresentation`](http://
|
540
|
+
# [`Pod::Hooks::InstallerRepresentation`](http://rubydoc.info/gems/cocoapods/Pod/Hooks/InstallerRepresentation/)
|
483
541
|
# as its only argument.
|
484
542
|
#
|
485
543
|
# @example Customizing the `OTHER_LDFLAGS` of all targets
|
@@ -316,6 +316,67 @@ module Pod
|
|
316
316
|
|
317
317
|
#--------------------------------------#
|
318
318
|
|
319
|
+
# Whether a specific pod should be linked to the target when building for
|
320
|
+
# a specific configuration. If a pod has not been explicitly whitelisted
|
321
|
+
# for any configuration, it is implicitly whitelisted.
|
322
|
+
#
|
323
|
+
# @param [String] pod_name
|
324
|
+
# The pod that we're querying about inclusion for in the given
|
325
|
+
# configuration.
|
326
|
+
#
|
327
|
+
# @param [String] configuration_name
|
328
|
+
# The configuration that we're querying about inclusion of the
|
329
|
+
# pod in.
|
330
|
+
#
|
331
|
+
# @note Build configurations are case compared case-insensitively in
|
332
|
+
# CocoaPods.
|
333
|
+
#
|
334
|
+
# @return [Bool] flag
|
335
|
+
# Whether the pod should be linked with the target
|
336
|
+
#
|
337
|
+
def pod_whitelisted_for_configuration?(pod_name, configuration_name)
|
338
|
+
found = false
|
339
|
+
configuration_pod_whitelist.each do |configuration, pods|
|
340
|
+
if pods.include?(pod_name)
|
341
|
+
found = true
|
342
|
+
if configuration.downcase == configuration_name.to_s.downcase
|
343
|
+
return true
|
344
|
+
end
|
345
|
+
end
|
346
|
+
end
|
347
|
+
!found
|
348
|
+
end
|
349
|
+
|
350
|
+
# Whitelists a pod for a specific configuration. If a pod is whitelisted
|
351
|
+
# for any configuration, it will only be linked with the target in the
|
352
|
+
# configuration(s) specified. If it is not whitelisted for any
|
353
|
+
# configuration, it is implicitly included in all configurations.
|
354
|
+
#
|
355
|
+
# @param [String] pod_name
|
356
|
+
# The pod that should be included in the given configuration.
|
357
|
+
#
|
358
|
+
# @param [String, Symbol] configuration_name
|
359
|
+
# The configuration that the pod should be included in
|
360
|
+
#
|
361
|
+
# @note Build configurations are stored as a String.
|
362
|
+
#
|
363
|
+
# @return [void]
|
364
|
+
#
|
365
|
+
def whitelist_pod_for_configuration(pod_name, configuration_name)
|
366
|
+
configuration_name = configuration_name.to_s
|
367
|
+
configuration_pod_whitelist[configuration_name] ||= []
|
368
|
+
configuration_pod_whitelist[configuration_name] << pod_name
|
369
|
+
end
|
370
|
+
|
371
|
+
# @return [Array<String>] unique list of all configurations for which
|
372
|
+
# pods have been whitelisted.
|
373
|
+
#
|
374
|
+
def all_whitelisted_configurations
|
375
|
+
configuration_pod_whitelist.keys.uniq
|
376
|
+
end
|
377
|
+
|
378
|
+
#--------------------------------------#
|
379
|
+
|
319
380
|
# @return [Platform] the platform of the target definition.
|
320
381
|
#
|
321
382
|
# @note If no deployment target has been specified a default value is
|
@@ -384,6 +445,7 @@ module Pod
|
|
384
445
|
#
|
385
446
|
def store_pod(name, *requirements)
|
386
447
|
parse_inhibit_warnings(name, requirements)
|
448
|
+
parse_configuration_whitelist(name, requirements)
|
387
449
|
|
388
450
|
if requirements && !requirements.empty?
|
389
451
|
pod = { name => requirements }
|
@@ -444,6 +506,7 @@ module Pod
|
|
444
506
|
build_configurations
|
445
507
|
dependencies
|
446
508
|
children
|
509
|
+
configuration_pod_whitelist
|
447
510
|
).freeze
|
448
511
|
|
449
512
|
# @return [Hash] The hash representation of the target definition.
|
@@ -537,6 +600,16 @@ module Pod
|
|
537
600
|
get_hash_value('inhibit_warnings', {})
|
538
601
|
end
|
539
602
|
|
603
|
+
# Returns the configuration_pod_whitelist hash
|
604
|
+
#
|
605
|
+
# @return [Hash<String, Array>] Hash with configuration name as key,
|
606
|
+
# array of pod names to be linked in builds with that configuration
|
607
|
+
# as value.
|
608
|
+
#
|
609
|
+
def configuration_pod_whitelist
|
610
|
+
get_hash_value('configuration_pod_whitelist', {})
|
611
|
+
end
|
612
|
+
|
540
613
|
# @return [Array<Dependency>] The dependencies specified by the user for
|
541
614
|
# this target definition.
|
542
615
|
#
|
@@ -558,7 +631,7 @@ module Pod
|
|
558
631
|
# @note The podspec directive is intended include the dependencies of a
|
559
632
|
# spec in the project where it is developed. For this reason the
|
560
633
|
# spec, or any of it subspecs, cannot be included in the
|
561
|
-
# dependencies. Otherwise it would generate
|
634
|
+
# dependencies. Otherwise it would generate a chicken-and-egg
|
562
635
|
# problem.
|
563
636
|
#
|
564
637
|
def podspec_dependencies
|
@@ -619,6 +692,32 @@ module Pod
|
|
619
692
|
requirements.pop if options.empty?
|
620
693
|
end
|
621
694
|
|
695
|
+
# Removes :configurations or :configuration from the requirements list,
|
696
|
+
# and adds the pod's name into the internal hash for which pods should be
|
697
|
+
# linked in which configuration only.
|
698
|
+
#
|
699
|
+
# @param [String] pod name
|
700
|
+
#
|
701
|
+
# @param [Array] requirements
|
702
|
+
# If :configurations is the only key in the hash, the hash
|
703
|
+
# should be destroyed because it confuses Gem::Dependency.
|
704
|
+
#
|
705
|
+
# @return [void]
|
706
|
+
#
|
707
|
+
def parse_configuration_whitelist(name, requirements)
|
708
|
+
options = requirements.last
|
709
|
+
return requirements unless options.is_a?(Hash)
|
710
|
+
|
711
|
+
configurations = options.delete(:configurations)
|
712
|
+
configurations ||= options.delete(:configuration)
|
713
|
+
if configurations
|
714
|
+
Array(configurations).each do |configuration|
|
715
|
+
whitelist_pod_for_configuration(name, configuration)
|
716
|
+
end
|
717
|
+
end
|
718
|
+
requirements.pop if options.empty?
|
719
|
+
end
|
720
|
+
|
622
721
|
#-----------------------------------------------------------------------#
|
623
722
|
end
|
624
723
|
end
|
@@ -95,6 +95,12 @@ module Pod
|
|
95
95
|
|
96
96
|
# @!group Attributes
|
97
97
|
|
98
|
+
# @return [Array<String>] The name of the sources.
|
99
|
+
#
|
100
|
+
def sources
|
101
|
+
get_hash_value('sources') || []
|
102
|
+
end
|
103
|
+
|
98
104
|
# @return [String] the path of the workspace if specified by the user.
|
99
105
|
#
|
100
106
|
def workspace_path
|
@@ -173,6 +179,7 @@ module Pod
|
|
173
179
|
HASH_KEYS = %w(
|
174
180
|
target_definitions
|
175
181
|
workspace
|
182
|
+
sources
|
176
183
|
generate_bridge_support
|
177
184
|
set_arc_compatibility_flag
|
178
185
|
).freeze
|
@@ -239,7 +246,7 @@ module Pod
|
|
239
246
|
# rubocop:disable Eval
|
240
247
|
eval(string, nil, path.to_s)
|
241
248
|
# rubocop:enable Eval
|
242
|
-
rescue
|
249
|
+
rescue => e
|
243
250
|
message = "Invalid `#{path.basename}` file: #{e.message}"
|
244
251
|
raise DSLError.new(message, path, e.backtrace)
|
245
252
|
end
|
@@ -264,7 +271,7 @@ module Pod
|
|
264
271
|
if string.respond_to?(:encoding) && string.encoding.name != 'UTF-8'
|
265
272
|
string.encode!('UTF-8')
|
266
273
|
end
|
267
|
-
hash = YAMLHelper.
|
274
|
+
hash = YAMLHelper.load_string(string)
|
268
275
|
from_hash(hash, path)
|
269
276
|
end
|
270
277
|
|
@@ -45,7 +45,7 @@ module Pod
|
|
45
45
|
new('>= 0')
|
46
46
|
end
|
47
47
|
|
48
|
-
# Parses the given object returning
|
48
|
+
# Parses the given object returning a tuple where the first entry is an
|
49
49
|
# operator and the second a version. If not operator is provided it
|
50
50
|
# defaults to `=`.
|
51
51
|
#
|
@@ -33,7 +33,7 @@ module Pod
|
|
33
33
|
# @param [String] name
|
34
34
|
# The name of the Pod.
|
35
35
|
#
|
36
|
-
def versions(
|
36
|
+
def versions(_name)
|
37
37
|
raise StandardError, 'Abstract method.'
|
38
38
|
end
|
39
39
|
|
@@ -45,7 +45,7 @@ module Pod
|
|
45
45
|
# @param [String] version
|
46
46
|
# The version of the Pod.
|
47
47
|
#
|
48
|
-
def specification(
|
48
|
+
def specification(_name, _version)
|
49
49
|
raise StandardError, 'Abstract method.'
|
50
50
|
end
|
51
51
|
|
@@ -58,7 +58,7 @@ module Pod
|
|
58
58
|
# @param [String] version
|
59
59
|
# the version of the Pod.
|
60
60
|
#
|
61
|
-
def specification_contents(
|
61
|
+
def specification_contents(_name, _version)
|
62
62
|
raise StandardError, 'Abstract method.'
|
63
63
|
end
|
64
64
|
|
@@ -3,38 +3,38 @@ module Pod
|
|
3
3
|
# The Aggregate manages a directory of sources repositories.
|
4
4
|
#
|
5
5
|
class Aggregate
|
6
|
-
# @return [Pathname]
|
6
|
+
# @return [Array<Pathname>] The ordered list of source directories.
|
7
7
|
#
|
8
|
-
attr_reader :
|
8
|
+
attr_reader :directories
|
9
9
|
|
10
|
-
# @param
|
10
|
+
# @param [Array<Pathname>] repos_dirs @see directories
|
11
11
|
#
|
12
|
-
def initialize(
|
13
|
-
@
|
12
|
+
def initialize(repos_dirs)
|
13
|
+
@directories = Array(repos_dirs)
|
14
14
|
end
|
15
15
|
|
16
|
-
# @return [Array<Source>]
|
16
|
+
# @return [Array<Source>] The ordered list of the sources.
|
17
17
|
#
|
18
|
-
def
|
19
|
-
@sources ||=
|
18
|
+
def sources
|
19
|
+
@sources ||= directories.map { |repo| Source.new(repo) }
|
20
20
|
end
|
21
21
|
|
22
22
|
# @return [Array<String>] the names of all the pods available.
|
23
23
|
#
|
24
24
|
def all_pods
|
25
|
-
|
25
|
+
sources.map(&:pods).flatten.uniq
|
26
26
|
end
|
27
27
|
|
28
|
-
# @return [Array<Set>]
|
28
|
+
# @return [Array<Set>] The sets for all the pods available.
|
29
29
|
#
|
30
30
|
# @note Implementation detail: The sources don't cache their values
|
31
31
|
# because they might change in response to an update. Therefore
|
32
|
-
# this method to
|
32
|
+
# this method to preserve performance caches the values before
|
33
33
|
# processing them.
|
34
34
|
#
|
35
35
|
def all_sets
|
36
36
|
pods_by_source = {}
|
37
|
-
|
37
|
+
sources.each do |source|
|
38
38
|
pods_by_source[source] = source.pods
|
39
39
|
end
|
40
40
|
sources = pods_by_source.keys
|
@@ -47,20 +47,6 @@ module Pod
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
|
50
|
-
# @return [Array<Pathname>] the directories where the sources are stored.
|
51
|
-
#
|
52
|
-
# @note If the repos dir doesn't exits this will return an empty array.
|
53
|
-
#
|
54
|
-
# @raise If the repos dir doesn't exits.
|
55
|
-
#
|
56
|
-
def dirs
|
57
|
-
if repos_dir.exist?
|
58
|
-
repos_dir.children.select(&:directory?)
|
59
|
-
else
|
60
|
-
[]
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
50
|
# Returns a set configured with the source which contains the highest
|
65
51
|
# version in the aggregate.
|
66
52
|
#
|
@@ -73,7 +59,7 @@ module Pod
|
|
73
59
|
def representative_set(name)
|
74
60
|
representative_source = nil
|
75
61
|
highest_version = nil
|
76
|
-
|
62
|
+
sources.each do |source|
|
77
63
|
source_versions = source.versions(name)
|
78
64
|
if source_versions
|
79
65
|
source_version = source_versions.first
|
@@ -100,9 +86,9 @@ module Pod
|
|
100
86
|
# @see Source#search
|
101
87
|
#
|
102
88
|
def search(dependency)
|
103
|
-
|
104
|
-
unless
|
105
|
-
Specification::Set.new(dependency.root_name,
|
89
|
+
found_sources = sources.select { |s| s.search(dependency) }
|
90
|
+
unless found_sources.empty?
|
91
|
+
Specification::Set.new(dependency.root_name, found_sources)
|
106
92
|
end
|
107
93
|
end
|
108
94
|
|
@@ -117,7 +103,7 @@ module Pod
|
|
117
103
|
def search_by_name(query, full_text_search = false)
|
118
104
|
pods_by_source = {}
|
119
105
|
result = []
|
120
|
-
|
106
|
+
sources.each do |s|
|
121
107
|
source_pods = s.search_by_name(query, full_text_search)
|
122
108
|
pods_by_source[s] = source_pods.map(&:name)
|
123
109
|
end
|
@@ -180,8 +180,8 @@ module Pod
|
|
180
180
|
def value_for_attribute(attr_name)
|
181
181
|
attr = Specification::DSL.attributes[attr_name]
|
182
182
|
value = value_with_inheritance(spec, attr)
|
183
|
-
value
|
184
|
-
value
|
183
|
+
value = attr.default(platform_name) if value.nil?
|
184
|
+
value = attr.container.new if value.nil? && attr.container
|
185
185
|
value
|
186
186
|
end
|
187
187
|
|
@@ -3,8 +3,8 @@ module Pod
|
|
3
3
|
module DSL
|
4
4
|
# @return [Array<Attribute>] The attributes of the class.
|
5
5
|
#
|
6
|
-
|
7
|
-
|
6
|
+
class << self
|
7
|
+
attr_reader :attributes
|
8
8
|
end
|
9
9
|
|
10
10
|
# This module provides support for storing the runtime information of the
|
@@ -14,7 +14,7 @@ module Pod
|
|
14
14
|
# Defines a root attribute for the extended class.
|
15
15
|
#
|
16
16
|
# Root attributes make sense only in root specification, they never are
|
17
|
-
#
|
17
|
+
# multi-platform, they don't have inheritance, and they never have a
|
18
18
|
# default value.
|
19
19
|
#
|
20
20
|
# @param [String] name
|
@@ -33,7 +33,7 @@ module Pod
|
|
33
33
|
|
34
34
|
# Defines an attribute for the extended class.
|
35
35
|
#
|
36
|
-
# Regular attributes in general support inheritance and multi
|
36
|
+
# Regular attributes in general support inheritance and multi-platform
|
37
37
|
# values, so resolving them for a given specification is not trivial.
|
38
38
|
#
|
39
39
|
# @param [String] name
|
@@ -9,43 +9,6 @@ module Pod
|
|
9
9
|
CoreUI.warn "[#{self}] `preferred_dependency` has been renamed "\
|
10
10
|
'to `default_subspecs`.'
|
11
11
|
end
|
12
|
-
|
13
|
-
def singleton_method_added(method)
|
14
|
-
if method == :header_mappings
|
15
|
-
raise Informative, "[#{self}] The use of the `header_mappings` " \
|
16
|
-
"hook has been deprecated.\n Use the `header_dir` and the " \
|
17
|
-
'`header_mappings_dir` attributes.'
|
18
|
-
|
19
|
-
elsif method == :copy_header_mapping
|
20
|
-
raise Informative, "[#{self}] The use of the " \
|
21
|
-
"`copy_header_mapping` hook has been deprecated.\nUse" \
|
22
|
-
'the `header_dir` and the `header_mappings_dir` attributes.'
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def documentation=(value)
|
27
|
-
CoreUI.warn "[#{self}] The `documentation` DSL directive of the " \
|
28
|
-
'podspec format has been deprecated.'
|
29
|
-
end
|
30
|
-
|
31
|
-
def clean_paths=(value)
|
32
|
-
raise Informative, "[#{self}] Clean paths are deprecated. " \
|
33
|
-
'CocoaPods now cleans unused files by default. Use the ' \
|
34
|
-
'`preserve_paths` attribute if needed.'
|
35
|
-
end
|
36
|
-
|
37
|
-
DEPRECATED_METHODS = [
|
38
|
-
:part_of_dependency=,
|
39
|
-
:part_of=,
|
40
|
-
:exclude_header_search_paths=,
|
41
|
-
]
|
42
|
-
|
43
|
-
DEPRECATED_METHODS.each do |method|
|
44
|
-
define_method method do |value|
|
45
|
-
raise Informative, "[#{self}] Attribute "\
|
46
|
-
"`#{method.to_s[0..-2]}` has been deprecated."
|
47
|
-
end
|
48
|
-
end
|
49
12
|
end
|
50
13
|
end
|
51
14
|
end
|