cocoapods-core 0.30.0 → 1.15.2

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 (50) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +7 -10
  3. data/lib/cocoapods-core/build_type.rb +121 -0
  4. data/lib/cocoapods-core/cdn_source.rb +501 -0
  5. data/lib/cocoapods-core/core_ui.rb +4 -3
  6. data/lib/cocoapods-core/dependency.rb +100 -73
  7. data/lib/cocoapods-core/gem_version.rb +1 -2
  8. data/lib/cocoapods-core/github.rb +32 -5
  9. data/lib/cocoapods-core/http.rb +86 -0
  10. data/lib/cocoapods-core/lockfile.rb +161 -56
  11. data/lib/cocoapods-core/metrics.rb +47 -0
  12. data/lib/cocoapods-core/platform.rb +99 -11
  13. data/lib/cocoapods-core/podfile/dsl.rb +623 -124
  14. data/lib/cocoapods-core/podfile/target_definition.rb +662 -109
  15. data/lib/cocoapods-core/podfile.rb +138 -65
  16. data/lib/cocoapods-core/requirement.rb +37 -8
  17. data/lib/cocoapods-core/source/acceptor.rb +16 -13
  18. data/lib/cocoapods-core/source/aggregate.rb +79 -103
  19. data/lib/cocoapods-core/source/health_reporter.rb +9 -18
  20. data/lib/cocoapods-core/source/manager.rb +488 -0
  21. data/lib/cocoapods-core/source/metadata.rb +79 -0
  22. data/lib/cocoapods-core/source.rb +241 -70
  23. data/lib/cocoapods-core/specification/consumer.rb +187 -47
  24. data/lib/cocoapods-core/specification/dsl/attribute.rb +49 -85
  25. data/lib/cocoapods-core/specification/dsl/attribute_support.rb +6 -8
  26. data/lib/cocoapods-core/specification/dsl/deprecations.rb +9 -126
  27. data/lib/cocoapods-core/specification/dsl/platform_proxy.rb +30 -20
  28. data/lib/cocoapods-core/specification/dsl.rb +943 -296
  29. data/lib/cocoapods-core/specification/json.rb +64 -23
  30. data/lib/cocoapods-core/specification/linter/analyzer.rb +218 -0
  31. data/lib/cocoapods-core/specification/linter/result.rb +128 -0
  32. data/lib/cocoapods-core/specification/linter.rb +310 -309
  33. data/lib/cocoapods-core/specification/root_attribute_accessors.rb +90 -39
  34. data/lib/cocoapods-core/specification/set/presenter.rb +35 -71
  35. data/lib/cocoapods-core/specification/set.rb +42 -96
  36. data/lib/cocoapods-core/specification.rb +368 -130
  37. data/lib/cocoapods-core/standard_error.rb +45 -24
  38. data/lib/cocoapods-core/trunk_source.rb +14 -0
  39. data/lib/cocoapods-core/vendor/requirement.rb +133 -53
  40. data/lib/cocoapods-core/vendor/version.rb +197 -156
  41. data/lib/cocoapods-core/vendor.rb +1 -5
  42. data/lib/cocoapods-core/version.rb +137 -42
  43. data/lib/cocoapods-core/yaml_helper.rb +334 -0
  44. data/lib/cocoapods-core.rb +10 -4
  45. metadata +100 -27
  46. data/lib/cocoapods-core/source/abstract_data_provider.rb +0 -71
  47. data/lib/cocoapods-core/source/file_system_data_provider.rb +0 -150
  48. data/lib/cocoapods-core/source/github_data_provider.rb +0 -143
  49. data/lib/cocoapods-core/specification/set/statistics.rb +0 -266
  50. data/lib/cocoapods-core/yaml_converter.rb +0 -192
@@ -1,136 +1,19 @@
1
1
  module Pod
2
2
  class Specification
3
3
  module DSL
4
-
5
4
  # Provides warning and errors for the deprecated attributes of the DSL.
6
5
  #
7
6
  module Deprecations
8
-
9
- def preferred_dependency=(name)
10
- self.default_subspec = name
11
- CoreUI.warn "[#{self}] `preferred_dependency` has been renamed "\
12
- "to `default_subspec`."
13
- end
14
-
15
- def singleton_method_added(method)
16
- if method == :pre_install
17
- CoreUI.warn "[#{self}] The use of `#{method}` by overriding " \
18
- "the method is deprecated."
19
- @pre_install_callback = Proc.new do |pod, target_definition|
20
- pre_install(pod, target_definition)
21
- end
22
-
23
- elsif method == :post_install
24
- CoreUI.warn "[#{self}] The use of `#{method}` by overriding the " \
25
- "method is deprecated."
26
- @post_install_callback = Proc.new do |target_installer|
27
- post_install(target_installer)
28
- end
29
-
30
- elsif method == :header_mappings
31
- raise Informative, "[#{self}] The use of the `header_mappings` " \
32
- "hook has been deprecated.\n Use the `header_dir` and the " \
33
- "`header_mappings_dir` attributes."
34
-
35
- elsif method == :copy_header_mapping
36
- raise Informative, "[#{self}] The use of the " \
37
- "`copy_header_mapping` hook has been deprecated.\nUse" \
38
- "the `header_dir` and the `header_mappings_dir` attributes."
39
- end
40
- end
41
-
42
- def documentation=(value)
43
- CoreUI.warn "[#{self}] The `documentation` DSL directive of the " \
44
- "podspec format has been deprecated."
45
- end
46
-
47
- def clean_paths=(value)
48
- raise Informative, "[#{self}] Clean paths are deprecated. " \
49
- "CocoaPods now cleans unused files by default. Use the " \
50
- "`preserve_paths` attribute if needed."
7
+ DSL.attribute :xcconfig,
8
+ :container => Hash,
9
+ :inherited => true
10
+
11
+ def xcconfig=(value)
12
+ self.pod_target_xcconfig = value
13
+ self.user_target_xcconfig = value
14
+ CoreUI.warn "[#{self}] `xcconfig` has been split into "\
15
+ '`pod_target_xcconfig` and `user_target_xcconfig`.'
51
16
  end
52
-
53
- DEPRECATED_METHODS = [
54
- :part_of_dependency=,
55
- :part_of=,
56
- :exclude_header_search_paths=,
57
- ]
58
-
59
- DEPRECATED_METHODS.each do |method|
60
- define_method method do |value|
61
- raise Informative, "[#{self}] Attribute "\
62
- "`#{method.to_s[0..-2]}` has been deprecated."
63
- end
64
- end
65
-
66
- # @!group Hooks
67
- #
68
- # The specification class provides hooks which are called by
69
- # CocoaPods when a Pod is installed.
70
-
71
- #-----------------------------------------------------------------------#
72
-
73
- # This is a convenience method which gets called after all pods have
74
- # been downloaded but before they have been installed, and the Xcode
75
- # project and related files have been generated. Note that this hook is
76
- # called for each Pods library and only for installations where the Pod
77
- # is installed.
78
- #
79
- # This hook should be used to generate and modify the files of the Pod.
80
- #
81
- # It receives the
82
- # [`Pod::Hooks::PodRepresentation`](http://docs.cocoapods.org/cocoapods/pod/hooks/podrepresentation/)
83
- # and the
84
- # [`Pod::Hooks::LibraryRepresentation`](http://docs.cocoapods.org/cocoapods/pod/hooks/libraryrepresentation/)
85
- # instances.
86
- #
87
- # Override this to, for instance, to run any build script.
88
- #
89
- # @example
90
- #
91
- # spec.pre_install do |pod, target_definition|
92
- # Dir.chdir(pod.root){ `sh make.sh` }
93
- # end
94
- #
95
- def pre_install(&block)
96
- CoreUI.warn "[#{self}] The pre install hook of the specification " \
97
- "DSL has been deprecated, use the `resource_bundles` or the " \
98
- "`prepare_command` attributes."
99
- @pre_install_callback = block
100
- end
101
-
102
- # This is a convenience method which gets called after all pods have been
103
- # downloaded, installed, and the Xcode project and related files have
104
- # been generated. Note that this hook is called for each Pods library and
105
- # only for installations where the Pod is installed.
106
- #
107
- # To modify and generate files for the Pod the pre install hook should be
108
- # used instead of this one.
109
- #
110
- # It receives a
111
- # [`Pod::Hooks::LibraryRepresentation`](http://docs.cocoapods.org/cocoapods/pod/hooks/libraryrepresentation/)
112
- # instance for the current target.
113
- #
114
- # Override this to, for instance, add to the prefix header.
115
- #
116
- # @example
117
- #
118
- # spec.post_install do |library_representation|
119
- # prefix_header = library_representation.prefix_header_path
120
- # prefix_header.open('a') do |file|
121
- # file.puts('#ifdef __OBJC__\n#import "SSToolkitDefines.h"\n#endif')
122
- # end
123
- # end
124
- #
125
- def post_install(&block)
126
- CoreUI.warn "[#{self}] The post install hook of the specification " \
127
- "DSL has been deprecated, use the `resource_bundles` or the " \
128
- "`prepare_command` attributes."
129
- @post_install_callback = block
130
- end
131
-
132
- #-----------------------------------------------------------------------#
133
-
134
17
  end
135
18
  end
136
19
  end
@@ -1,12 +1,10 @@
1
1
  module Pod
2
2
  class Specification
3
3
  module DSL
4
-
5
4
  # The PlatformProxy works in conjunction with Specification#_on_platform.
6
5
  # It provides support for a syntax like `spec.ios.source_files = 'file'`.
7
6
  #
8
7
  class PlatformProxy
9
-
10
8
  # @return [Specification] the specification for this platform proxy.
11
9
  #
12
10
  attr_accessor :spec
@@ -14,13 +12,14 @@ module Pod
14
12
  # @return [Symbol] the platform described by this proxy. Can be either
15
13
  # `:ios` or `:osx`.
16
14
  #
17
- attr_accessor :platform
15
+ attr_reader :platform
18
16
 
19
17
  # @param [Specification] spec @see spec
20
18
  # @param [Symbol] platform @see platform
21
19
  #
22
20
  def initialize(spec, platform)
23
- @spec, @platform = spec, platform
21
+ @spec = spec
22
+ @platform = platform
24
23
  end
25
24
 
26
25
  # Defines a setter method for each attribute of the specification
@@ -30,18 +29,16 @@ module Pod
30
29
  # @return [void]
31
30
  #
32
31
  def method_missing(meth, *args, &block)
33
- attribute = Specification::DSL.attributes.values.find do |attr|
34
- if attr.writer_name.to_sym == meth
35
- true
36
- elsif attr.writer_singular_form
37
- attr.writer_singular_form.to_sym == meth
38
- end
39
- end
40
- if attribute && attribute.multi_platform?
41
- spec.store_attribute(attribute.name, args.first, platform)
42
- else
43
- super
44
- end
32
+ return super unless attribute = attribute_for_method(meth)
33
+ raise NoMethodError, "#{attribute} cannot be set per-platform" unless attribute.multi_platform?
34
+ spec.store_attribute(attribute.name, args.first, platform)
35
+ end
36
+
37
+ # @!visibility private
38
+ #
39
+ def respond_to_missing?(method, include_all)
40
+ attribute = attribute_for_method(method)
41
+ (attribute && attribute.multi_platform?) || super
45
42
  end
46
43
 
47
44
  # Allows to add dependency for the platform.
@@ -52,8 +49,8 @@ module Pod
52
49
  name, *version_requirements = args
53
50
  platform_name = platform.to_s
54
51
  platform_hash = spec.attributes_hash[platform_name] || {}
55
- platform_hash["dependencies"] ||= {}
56
- platform_hash["dependencies"][name] = version_requirements
52
+ platform_hash['dependencies'] ||= {}
53
+ platform_hash['dependencies'][name] = version_requirements
57
54
  spec.attributes_hash[platform_name] = platform_hash
58
55
  end
59
56
 
@@ -63,8 +60,21 @@ module Pod
63
60
  #
64
61
  def deployment_target=(value)
65
62
  platform_name = platform.to_s
66
- spec.attributes_hash["platforms"] ||= {}
67
- spec.attributes_hash["platforms"][platform_name] = value
63
+ spec.attributes_hash['platforms'] ||= {}
64
+ spec.attributes_hash['platforms'][platform_name] = value
65
+ end
66
+
67
+ private
68
+
69
+ def attribute_for_method(method)
70
+ method = method.to_sym
71
+ Specification::DSL.attributes.values.find do |attribute|
72
+ if attribute.writer_name.to_sym == method
73
+ true
74
+ elsif attribute.writer_singular_form
75
+ attribute.writer_singular_form.to_sym == method
76
+ end
77
+ end
68
78
  end
69
79
  end
70
80
  end