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
@@ -60,7 +60,7 @@ module Pod
60
60
  data[:author_email] = `git config --get user.email`.strip
61
61
  data[:source_url] = "http://EXAMPLE/#{name}.git"
62
62
  data[:ref_type] = ':tag'
63
- data[:ref] = '#{s.version}'
63
+ data[:ref] = '#{spec.version}'
64
64
  data
65
65
  end
66
66
 
@@ -100,8 +100,8 @@ module Pod
100
100
  else
101
101
  data[:ref_type] = ':tag'
102
102
  data[:ref] = versions_tags[version]
103
- data[:ref] = '#{s.version}' if "#{version}" == versions_tags[version]
104
- data[:ref] = 'v#{s.version}' if "v#{version}" == versions_tags[version]
103
+ data[:ref] = '#{spec.version}' if "#{version}" == versions_tags[version]
104
+ data[:ref] = 'v#{spec.version}' if "v#{version}" == versions_tags[version]
105
105
  end
106
106
  data
107
107
  end
@@ -112,11 +112,11 @@ module Pod
112
112
  # Be sure to run `pod spec lint #{data[:name]}.podspec' to ensure this is a
113
113
  # valid spec and to remove all comments including this before submitting the spec.
114
114
  #
115
- # To learn more about Podspec attributes see http://docs.cocoapods.org/specification.html
115
+ # To learn more about Podspec attributes see https://docs.cocoapods.org/specification.html
116
116
  # To see working Podspecs in the CocoaPods repo see https://github.com/CocoaPods/Specs/
117
117
  #
118
118
 
119
- Pod::Spec.new do |s|
119
+ Pod::Spec.new do |spec|
120
120
 
121
121
  # ――― Spec Metadata ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
122
122
  #
@@ -125,31 +125,31 @@ Pod::Spec.new do |s|
125
125
  # summary should be tweet-length, and the description more in depth.
126
126
  #
127
127
 
128
- s.name = "#{data[:name]}"
129
- s.version = "#{data[:version]}"
130
- s.summary = "#{data[:summary]}"
128
+ spec.name = "#{data[:name]}"
129
+ spec.version = "#{data[:version]}"
130
+ spec.summary = "#{data[:summary]}"
131
131
 
132
132
  # This description is used to generate tags and improve search results.
133
133
  # * Think: What does it do? Why did you write it? What is the focus?
134
134
  # * Try to keep it short, snappy and to the point.
135
135
  # * Write the description between the DESC delimiters below.
136
136
  # * Finally, don't worry about the indent, CocoaPods strips it!
137
- s.description = <<-DESC
137
+ spec.description = <<-DESC
138
138
  DESC
139
139
 
140
- s.homepage = "#{data[:homepage]}"
141
- # s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
140
+ spec.homepage = "#{data[:homepage]}"
141
+ # spec.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"
142
142
 
143
143
 
144
144
  # ――― Spec License ――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
145
145
  #
146
- # Licensing your code is important. See http://choosealicense.com for more info.
146
+ # Licensing your code is important. See https://choosealicense.com for more info.
147
147
  # CocoaPods will detect a license file if there is a named LICENSE*
148
148
  # Popular ones are 'MIT', 'BSD' and 'Apache License, Version 2.0'.
149
149
  #
150
150
 
151
- s.license = "MIT (example)"
152
- # s.license = { :type => "MIT", :file => "FILE_LICENSE" }
151
+ spec.license = "MIT (example)"
152
+ # spec.license = { :type => "MIT", :file => "FILE_LICENSE" }
153
153
 
154
154
 
155
155
  # ――― Author Metadata ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -162,10 +162,10 @@ Pod::Spec.new do |s|
162
162
  # profile URL.
163
163
  #
164
164
 
165
- s.author = { "#{data[:author_name]}" => "#{data[:author_email]}" }
166
- # Or just: s.author = "#{data[:author_name]}"
167
- # s.authors = { "#{data[:author_name]}" => "#{data[:author_email]}" }
168
- # s.social_media_url = "http://twitter.com/#{data[:author_name]}"
165
+ spec.author = { "#{data[:author_name]}" => "#{data[:author_email]}" }
166
+ # Or just: spec.author = "#{data[:author_name]}"
167
+ # spec.authors = { "#{data[:author_name]}" => "#{data[:author_email]}" }
168
+ # spec.social_media_url = "https://twitter.com/#{data[:author_name]}"
169
169
 
170
170
  # ――― Platform Specifics ――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
171
171
  #
@@ -173,14 +173,14 @@ Pod::Spec.new do |s|
173
173
  # the deployment target. You can optionally include the target after the platform.
174
174
  #
175
175
 
176
- # s.platform = :ios
177
- # s.platform = :ios, "5.0"
176
+ # spec.platform = :ios
177
+ # spec.platform = :ios, "5.0"
178
178
 
179
179
  # When using multiple platforms
180
- # s.ios.deployment_target = "5.0"
181
- # s.osx.deployment_target = "10.7"
182
- # s.watchos.deployment_target = "2.0"
183
- # s.tvos.deployment_target = "9.0"
180
+ # spec.ios.deployment_target = "5.0"
181
+ # spec.osx.deployment_target = "10.7"
182
+ # spec.watchos.deployment_target = "2.0"
183
+ # spec.tvos.deployment_target = "9.0"
184
184
 
185
185
 
186
186
  # ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -189,7 +189,7 @@ Pod::Spec.new do |s|
189
189
  # Supports git, hg, bzr, svn and HTTP.
190
190
  #
191
191
 
192
- s.source = { :git => "#{data[:source_url]}", #{data[:ref_type]} => "#{data[:ref]}" }
192
+ spec.source = { :git => "#{data[:source_url]}", #{data[:ref_type]} => "#{data[:ref]}" }
193
193
 
194
194
 
195
195
  # ――― Source Code ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -200,10 +200,10 @@ Pod::Spec.new do |s|
200
200
  # Not including the public_header_files will make all headers public.
201
201
  #
202
202
 
203
- s.source_files = "Classes", "Classes/**/*.{h,m}"
204
- s.exclude_files = "Classes/Exclude"
203
+ spec.source_files = "Classes", "Classes/**/*.{h,m}"
204
+ spec.exclude_files = "Classes/Exclude"
205
205
 
206
- # s.public_header_files = "Classes/**/*.h"
206
+ # spec.public_header_files = "Classes/**/*.h"
207
207
 
208
208
 
209
209
  # ――― Resources ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -214,10 +214,10 @@ Pod::Spec.new do |s|
214
214
  # non-essential files like tests, examples and documentation.
215
215
  #
216
216
 
217
- # s.resource = "icon.png"
218
- # s.resources = "Resources/*.png"
217
+ # spec.resource = "icon.png"
218
+ # spec.resources = "Resources/*.png"
219
219
 
220
- # s.preserve_paths = "FilesToSave", "MoreFilesToSave"
220
+ # spec.preserve_paths = "FilesToSave", "MoreFilesToSave"
221
221
 
222
222
 
223
223
  # ――― Project Linking ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -226,11 +226,11 @@ Pod::Spec.new do |s|
226
226
  # the lib prefix of their name.
227
227
  #
228
228
 
229
- # s.framework = "SomeFramework"
230
- # s.frameworks = "SomeFramework", "AnotherFramework"
229
+ # spec.framework = "SomeFramework"
230
+ # spec.frameworks = "SomeFramework", "AnotherFramework"
231
231
 
232
- # s.library = "iconv"
233
- # s.libraries = "iconv", "xml2"
232
+ # spec.library = "iconv"
233
+ # spec.libraries = "iconv", "xml2"
234
234
 
235
235
 
236
236
  # ――― Project Settings ――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
@@ -239,10 +239,10 @@ Pod::Spec.new do |s|
239
239
  # where they will only apply to your library. If you depend on other Podspecs
240
240
  # you can include multiple dependencies to ensure it works.
241
241
 
242
- # s.requires_arc = true
242
+ # spec.requires_arc = true
243
243
 
244
- # s.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
245
- # s.dependency "JSONKit", "~> 1.4"
244
+ # spec.xcconfig = { "HEADER_SEARCH_PATHS" => "$(SDKROOT)/usr/include/libxml2" }
245
+ # spec.dependency "JSONKit", "~> 1.4"
246
246
 
247
247
  end
248
248
  SPEC
@@ -259,7 +259,7 @@ CocoaPods is a tool for managing dependencies for OSX and iOS Xcode projects and
259
259
 
260
260
  However, #{repo} doesn't have any version tags. I’ve added the current HEAD as version 0.0.1, but a version tag will make dependency resolution much easier.
261
261
 
262
- [Semantic version](http://semver.org) tags (instead of plain commit hashes/revisions) allow for [resolution of cross-dependencies](https://github.com/CocoaPods/Specs/wiki/Cross-dependencies-resolution-example).
262
+ [Semantic version](https://semver.org) tags (instead of plain commit hashes/revisions) allow for [resolution of cross-dependencies](https://github.com/CocoaPods/Specs/wiki/Cross-dependencies-resolution-example).
263
263
 
264
264
  In case you didn’t know this yet; you can tag the current HEAD as, for instance, version 1.0.0, like so:
265
265
 
@@ -23,9 +23,13 @@ module Pod
23
23
  ['--no-clean', 'Lint leaves the build directory intact for inspection'],
24
24
  ['--fail-fast', 'Lint stops on the first failing platform or subspec'],
25
25
  ['--use-libraries', 'Lint uses static libraries to install the spec'],
26
+ ['--use-modular-headers', 'Lint uses modular headers during installation'],
26
27
  ['--sources=https://github.com/artsy/Specs,master', 'The sources from which to pull dependent pods ' \
27
28
  '(defaults to https://github.com/CocoaPods/Specs.git). ' \
28
29
  'Multiple sources must be comma-delimited.'],
30
+ ['--platforms=ios,macos', 'Lint against specific platforms' \
31
+ '(defaults to all platforms supported by the podspec).' \
32
+ 'Multiple platforms must be comma-delimited'],
29
33
  ['--private', 'Lint skips checks that apply only to public specs'],
30
34
  ['--swift-version=VERSION', 'The SWIFT_VERSION that should be used to lint the spec. ' \
31
35
  'This takes precedence over a .swift-version file.'],
@@ -42,7 +46,9 @@ module Pod
42
46
  @subspecs = argv.flag?('subspecs', true)
43
47
  @only_subspec = argv.option('subspec')
44
48
  @use_frameworks = !argv.flag?('use-libraries')
49
+ @use_modular_headers = argv.flag?('use-modular-headers')
45
50
  @source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
51
+ @platforms = argv.option('platforms', '').split(',')
46
52
  @private = argv.flag?('private', false)
47
53
  @swift_version = argv.option('swift-version', nil)
48
54
  @skip_import_validation = argv.flag?('skip-import-validation', false)
@@ -55,7 +61,7 @@ module Pod
55
61
  UI.puts
56
62
  failure_reasons = []
57
63
  podspecs_to_lint.each do |podspec|
58
- validator = Validator.new(podspec, @source_urls)
64
+ validator = Validator.new(podspec, @source_urls, @platforms)
59
65
  validator.quick = @quick
60
66
  validator.no_clean = !@clean
61
67
  validator.fail_fast = @fail_fast
@@ -63,6 +69,7 @@ module Pod
63
69
  validator.no_subspecs = !@subspecs || @only_subspec
64
70
  validator.only_subspec = @only_subspec
65
71
  validator.use_frameworks = @use_frameworks
72
+ validator.use_modular_headers = @use_modular_headers
66
73
  validator.ignore_public_only_results = @private
67
74
  validator.swift_version = @swift_version
68
75
  validator.skip_import_validation = @skip_import_validation
@@ -114,7 +114,9 @@ module Pod
114
114
  #
115
115
  def self.git_version
116
116
  raw_version = Executable.capture_command('git', ['--version']).first
117
- match = raw_version.scan(/\d+\.\d+\.\d+/).first
117
+ unless match = raw_version.scan(/\d+\.\d+\.\d+/).first
118
+ raise "Failed to extract git version from `git --version` (#{raw_version.inspect})"
119
+ end
118
120
  Gem::Version.new(match)
119
121
  end
120
122
 
@@ -100,11 +100,19 @@ module Pod
100
100
  def initialize(use_user_settings = true)
101
101
  configure_with(DEFAULTS)
102
102
 
103
+ unless ENV['CP_HOME_DIR'].nil?
104
+ @cache_root = home_dir + 'cache'
105
+ end
106
+
103
107
  if use_user_settings && user_settings_file.exist?
104
108
  require 'yaml'
105
109
  user_settings = YAML.load_file(user_settings_file)
106
110
  configure_with(user_settings)
107
111
  end
112
+
113
+ unless ENV['CP_CACHE_DIR'].nil?
114
+ @cache_root = Pathname.new(ENV['CP_CACHE_DIR']).expand_path
115
+ end
108
116
  end
109
117
 
110
118
  def verbose
@@ -127,7 +135,7 @@ module Pod
127
135
  # @return [Pathname] the directory where the CocoaPods sources are stored.
128
136
  #
129
137
  def repos_dir
130
- @repos_dir ||= Pathname.new(ENV['CP_REPOS_DIR'] || '~/.cocoapods/repos').expand_path
138
+ @repos_dir ||= Pathname.new(ENV['CP_REPOS_DIR'] || (home_dir + 'repos')).expand_path
131
139
  end
132
140
 
133
141
  attr_writer :repos_dir
@@ -140,7 +148,7 @@ module Pod
140
148
  # @return [Pathname] the directory where the CocoaPods templates are stored.
141
149
  #
142
150
  def templates_dir
143
- @templates_dir ||= Pathname.new(ENV['CP_TEMPLATES_DIR'] || '~/.cocoapods/templates').expand_path
151
+ @templates_dir ||= Pathname.new(ENV['CP_TEMPLATES_DIR'] || (home_dir + 'templates')).expand_path
144
152
  end
145
153
 
146
154
  # @return [Pathname] the root of the CocoaPods installation where the
@@ -268,6 +276,9 @@ module Pod
268
276
  def configure_with(values_by_key)
269
277
  return unless values_by_key
270
278
  values_by_key.each do |key, value|
279
+ if key == :cache_root
280
+ value = Pathname.new(value).expand_path
281
+ end
271
282
  instance_variable_set("@#{key}", value)
272
283
  end
273
284
  end
@@ -180,7 +180,7 @@ module Pod
180
180
  tmpdir = Pathname(Dir.mktmpdir)
181
181
  blk.call(tmpdir)
182
182
  ensure
183
- FileUtils.remove_entry(tmpdir) if tmpdir && tmpdir.exist?
183
+ FileUtils.remove_entry(tmpdir, :force => true) if tmpdir && tmpdir.exist?
184
184
  end
185
185
 
186
186
  # Copies the `source` directory to `destination`, cleaning the directory
@@ -177,7 +177,7 @@ module Pod
177
177
  output << (string << separator)
178
178
  end
179
179
  end
180
- rescue EOFError
180
+ rescue EOFError, IOError
181
181
  output << (buf << $/) unless buf.empty?
182
182
  end
183
183
  end
@@ -191,11 +191,11 @@ module Pod
191
191
  class Indenter < ::Array
192
192
  # @return [Fixnum] The indentation level of the UI.
193
193
  #
194
- attr_accessor :indent
194
+ attr_reader :indent
195
195
 
196
196
  # @return [IO] the {IO} to which the output should be printed.
197
197
  #
198
- attr_accessor :io
198
+ attr_reader :io
199
199
 
200
200
  # Init a new Indenter
201
201
  #
@@ -19,20 +19,21 @@ module Pod
19
19
 
20
20
  # @return [Boolean] Whether the source is allowed to touch the cache.
21
21
  #
22
- attr_accessor :can_cache
22
+ attr_reader :can_cache
23
23
  alias_method :can_cache?, :can_cache
24
24
 
25
25
  # Initialize a new instance
26
26
  #
27
- # @param [String] name @see name
28
- # @param [Hash] params @see params
29
- # @param [String] podfile_path @see podfile_path
27
+ # @param [String] name @see #name
28
+ # @param [Hash] params @see #params
29
+ # @param [String] podfile_path @see #podfile_path
30
+ # @param [Boolean] can_cache @see #can_cache
30
31
  #
31
- def initialize(name, params, podfile_path)
32
+ def initialize(name, params, podfile_path, can_cache = true)
32
33
  @name = name
33
34
  @params = params
34
35
  @podfile_path = podfile_path
35
- @can_cache = true
36
+ @can_cache = can_cache
36
37
  end
37
38
 
38
39
  # @return [Bool] whether an external source source is equal to another
@@ -115,13 +116,17 @@ module Pod
115
116
  download_result = Downloader.download(download_request, target, :can_cache => can_cache)
116
117
  rescue Pod::DSLError => e
117
118
  raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
118
- rescue => _
119
- raise Informative, "Failed to download '#{name}'."
119
+ rescue => e
120
+ raise Informative, "Failed to download '#{name}': #{e.message}"
120
121
  end
121
- spec = download_result.spec
122
122
 
123
+ spec = download_result.spec
123
124
  raise Informative, "Unable to find a specification for '#{name}'." unless spec
124
125
 
126
+ # since the podspec might be cleaned, we want the checksum to refer
127
+ # to the json in the sandbox
128
+ spec.defined_in_file = nil
129
+
125
130
  store_podspec(sandbox, spec)
126
131
  sandbox.store_pre_downloaded_pod(name)
127
132
  sandbox.store_checkout_source(name, download_result.checkout_options)
@@ -160,7 +165,7 @@ module Pod
160
165
  when String
161
166
  path = "#{name}.podspec"
162
167
  path << '.json' if json
163
- Specification.from_string(spec, path)
168
+ Specification.from_string(spec, path).tap { |s| s.defined_in_file = nil }
164
169
  when Specification
165
170
  spec.dup
166
171
  else
@@ -169,12 +174,15 @@ module Pod
169
174
  rescue Pod::DSLError => e
170
175
  raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
171
176
  end
172
- spec.defined_in_file = nil
177
+
173
178
  validate_podspec(spec)
174
- sandbox.store_podspec(name, spec.to_pretty_json, true, true)
179
+ sandbox.store_podspec(name, spec, true, true)
175
180
  end
176
181
 
177
182
  def validate_podspec(podspec)
183
+ defined_in_file = podspec.defined_in_file
184
+ podspec.defined_in_file = nil
185
+
178
186
  validator = validator_for_podspec(podspec)
179
187
  validator.quick = true
180
188
  validator.allow_warnings = true
@@ -185,10 +193,12 @@ module Pod
185
193
  unless validator.validated?
186
194
  raise Informative, "The `#{name}` pod failed to validate due to #{validator.failure_reason}:\n#{validator.results_message}"
187
195
  end
196
+ ensure
197
+ podspec.defined_in_file = defined_in_file
188
198
  end
189
199
 
190
200
  def validator_for_podspec(podspec)
191
- Validator.new(podspec, [])
201
+ Validator.new(podspec, [], [])
192
202
  end
193
203
  end
194
204
  end
@@ -16,18 +16,21 @@ module Pod
16
16
  # @param [String] podfile_path
17
17
  # @see AbstractExternalSource#podfile_path
18
18
  #
19
+ # @param [Boolean] can_cache
20
+ # @see AbstractExternalSource#can_cache
21
+ #
19
22
  # @return [AbstractExternalSource] an initialized instance of the concrete
20
23
  # external source class associated with the option specified in the
21
24
  # hash.
22
25
  #
23
- def self.from_dependency(dependency, podfile_path)
24
- from_params(dependency.external_source, dependency, podfile_path)
26
+ def self.from_dependency(dependency, podfile_path, can_cache)
27
+ from_params(dependency.external_source, dependency, podfile_path, can_cache)
25
28
  end
26
29
 
27
- def self.from_params(params, dependency, podfile_path)
30
+ def self.from_params(params, dependency, podfile_path, can_cache)
28
31
  name = dependency.root_name
29
32
  if klass = concrete_class_from_params(params)
30
- klass.new(name, params, podfile_path)
33
+ klass.new(name, params, podfile_path, can_cache)
31
34
  else
32
35
  msg = "Unknown external source parameters for `#{name}`: `#{params}`"
33
36
  raise Informative, msg
@@ -1,5 +1,5 @@
1
1
  module Pod
2
2
  # The version of the CocoaPods command line tool.
3
3
  #
4
- VERSION = '1.5.2'.freeze unless defined? Pod::VERSION
4
+ VERSION = '1.6.1'.freeze unless defined? Pod::VERSION
5
5
  end
@@ -11,6 +11,12 @@ module Pod
11
11
  file.close
12
12
  end
13
13
 
14
+ # @return [String] The contents of the acknowledgements in Markdown format.
15
+ #
16
+ def generate
17
+ licenses
18
+ end
19
+
14
20
  def title_from_string(string, level)
15
21
  unless string.empty?
16
22
  '#' * level << " #{string}"
@@ -1,3 +1,5 @@
1
+ require 'stringio'
2
+
1
3
  module Pod
2
4
  module Generator
3
5
  class Plist < Acknowledgements
@@ -6,10 +8,19 @@ module Pod
6
8
  end
7
9
 
8
10
  def save_as(path)
9
- Xcodeproj::Plist.write_to_path(plist, path)
11
+ Xcodeproj::Plist.write_to_path(plist_hash, path)
12
+ end
13
+
14
+ # @return [String] The contents of the plist
15
+ #
16
+ def generate
17
+ plist = Nanaimo::Plist.new(plist_hash, :xml)
18
+ contents = StringIO.new
19
+ Nanaimo::Writer::XMLWriter.new(plist, :pretty => true, :output => contents, :strict => false).write
20
+ contents.string
10
21
  end
11
22
 
12
- def plist
23
+ def plist_hash
13
24
  {
14
25
  :Title => plist_title,
15
26
  :StringsTable => plist_title,