cocoapods 1.5.2 → 1.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/CHANGELOG.md +365 -1
- data/bin/pod +1 -1
- data/lib/cocoapods/command/cache/clean.rb +1 -1
- data/lib/cocoapods/command/init.rb +4 -2
- data/lib/cocoapods/command/install.rb +7 -0
- data/lib/cocoapods/command/lib/lint.rb +8 -1
- data/lib/cocoapods/command/outdated.rb +4 -9
- data/lib/cocoapods/command/repo/add.rb +1 -1
- data/lib/cocoapods/command/repo/list.rb +1 -1
- data/lib/cocoapods/command/repo/push.rb +17 -12
- data/lib/cocoapods/command/repo/remove.rb +1 -1
- data/lib/cocoapods/command/repo/update.rb +1 -1
- data/lib/cocoapods/command/setup.rb +1 -1
- data/lib/cocoapods/command/spec/create.rb +39 -39
- data/lib/cocoapods/command/spec/lint.rb +8 -1
- data/lib/cocoapods/command.rb +3 -1
- data/lib/cocoapods/config.rb +13 -2
- data/lib/cocoapods/downloader/cache.rb +1 -1
- data/lib/cocoapods/executable.rb +3 -3
- data/lib/cocoapods/external_sources/abstract_external_source.rb +23 -13
- data/lib/cocoapods/external_sources.rb +7 -4
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/acknowledgements/markdown.rb +6 -0
- data/lib/cocoapods/generator/acknowledgements/plist.rb +13 -2
- data/lib/cocoapods/generator/app_target_helper.rb +141 -17
- data/lib/cocoapods/generator/copy_resources_script.rb +14 -3
- data/lib/cocoapods/generator/dummy_source.rb +14 -5
- data/lib/cocoapods/generator/embed_frameworks_script.rb +37 -20
- data/lib/cocoapods/generator/header.rb +1 -1
- data/lib/cocoapods/generator/info_plist_file.rb +12 -4
- data/lib/cocoapods/generator/prefix_header.rb +2 -2
- data/lib/cocoapods/hooks_manager.rb +28 -17
- data/lib/cocoapods/installer/analyzer/analysis_result.rb +52 -22
- data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +14 -6
- data/lib/cocoapods/installer/analyzer/pod_variant.rb +4 -5
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +3 -14
- data/lib/cocoapods/installer/analyzer/specs_state.rb +28 -4
- data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +27 -14
- data/lib/cocoapods/installer/analyzer/target_inspector.rb +17 -11
- data/lib/cocoapods/installer/analyzer.rb +391 -284
- data/lib/cocoapods/installer/installation_options.rb +2 -0
- data/lib/cocoapods/installer/pod_source_installer.rb +31 -43
- data/lib/cocoapods/installer/post_install_hooks_context.rb +72 -47
- data/lib/cocoapods/installer/pre_install_hooks_context.rb +22 -13
- data/lib/cocoapods/installer/source_provider_hooks_context.rb +3 -1
- data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +44 -11
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +69 -29
- data/lib/cocoapods/installer/user_project_integrator.rb +6 -4
- data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +25 -16
- data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +104 -0
- data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +23 -50
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +296 -177
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +51 -33
- data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +93 -0
- data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +62 -69
- data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb +72 -0
- data/lib/cocoapods/installer/xcode/pods_project_generator.rb +130 -122
- data/lib/cocoapods/installer/xcode/target_validator.rb +15 -9
- data/lib/cocoapods/installer.rb +140 -63
- data/lib/cocoapods/project.rb +16 -14
- data/lib/cocoapods/resolver/resolver_specification.rb +41 -0
- data/lib/cocoapods/resolver.rb +79 -98
- data/lib/cocoapods/sandbox/file_accessor.rb +11 -6
- data/lib/cocoapods/sandbox/headers_store.rb +9 -8
- data/lib/cocoapods/sandbox/path_list.rb +5 -8
- data/lib/cocoapods/sandbox.rb +31 -43
- data/lib/cocoapods/sources_manager.rb +1 -1
- data/lib/cocoapods/target/aggregate_target.rb +143 -85
- data/lib/cocoapods/target/build_settings.rb +1124 -0
- data/lib/cocoapods/target/framework_paths.rb +36 -0
- data/lib/cocoapods/target/pod_target.rb +198 -295
- data/lib/cocoapods/target.rb +92 -37
- data/lib/cocoapods/user_interface.rb +5 -0
- data/lib/cocoapods/validator.rb +149 -44
- data/lib/cocoapods.rb +0 -1
- metadata +31 -23
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +0 -260
- data/lib/cocoapods/generator/xcconfig/pod_xcconfig.rb +0 -87
- data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +0 -558
- 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] = '#{
|
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] = '#{
|
104
|
-
data[:ref] = 'v#{
|
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
|
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 |
|
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
|
-
|
129
|
-
|
130
|
-
|
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
|
-
|
137
|
+
spec.description = <<-DESC
|
138
138
|
DESC
|
139
139
|
|
140
|
-
|
141
|
-
#
|
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
|
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
|
-
|
152
|
-
#
|
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
|
-
|
166
|
-
# Or just:
|
167
|
-
#
|
168
|
-
#
|
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
|
-
#
|
177
|
-
#
|
176
|
+
# spec.platform = :ios
|
177
|
+
# spec.platform = :ios, "5.0"
|
178
178
|
|
179
179
|
# When using multiple platforms
|
180
|
-
#
|
181
|
-
#
|
182
|
-
#
|
183
|
-
#
|
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
|
-
|
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
|
-
|
204
|
-
|
203
|
+
spec.source_files = "Classes", "Classes/**/*.{h,m}"
|
204
|
+
spec.exclude_files = "Classes/Exclude"
|
205
205
|
|
206
|
-
#
|
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
|
-
#
|
218
|
-
#
|
217
|
+
# spec.resource = "icon.png"
|
218
|
+
# spec.resources = "Resources/*.png"
|
219
219
|
|
220
|
-
#
|
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
|
-
#
|
230
|
-
#
|
229
|
+
# spec.framework = "SomeFramework"
|
230
|
+
# spec.frameworks = "SomeFramework", "AnotherFramework"
|
231
231
|
|
232
|
-
#
|
233
|
-
#
|
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
|
-
#
|
242
|
+
# spec.requires_arc = true
|
243
243
|
|
244
|
-
#
|
245
|
-
#
|
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](
|
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
|
data/lib/cocoapods/command.rb
CHANGED
@@ -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
|
|
data/lib/cocoapods/config.rb
CHANGED
@@ -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'] || '
|
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'] || '
|
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
|
data/lib/cocoapods/executable.rb
CHANGED
@@ -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
|
-
|
194
|
+
attr_reader :indent
|
195
195
|
|
196
196
|
# @return [IO] the {IO} to which the output should be printed.
|
197
197
|
#
|
198
|
-
|
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
|
-
|
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 =
|
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
|
-
|
177
|
+
|
173
178
|
validate_podspec(spec)
|
174
|
-
sandbox.store_podspec(name, spec
|
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
|
@@ -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(
|
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
|
23
|
+
def plist_hash
|
13
24
|
{
|
14
25
|
:Title => plist_title,
|
15
26
|
:StringsTable => plist_title,
|