cocoapods-core 1.9.1 → 1.10.0.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -2
- data/lib/cocoapods-core/cdn_source.rb +13 -5
- data/lib/cocoapods-core/gem_version.rb +1 -1
- data/lib/cocoapods-core/podfile.rb +17 -0
- data/lib/cocoapods-core/podfile/dsl.rb +50 -0
- data/lib/cocoapods-core/specification/dsl.rb +5 -3
- data/lib/cocoapods-core/specification/linter.rb +14 -0
- data/lib/cocoapods-core/version.rb +2 -1
- metadata +39 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0a07277aaf2c3d222a9eebb1bfb75ff5c0952e17886f30a0632b26f770c91e45
|
4
|
+
data.tar.gz: c24f4c13fb9c94e8edc10ccac147bb21673a1c752cf4130fd44e1f2e2747e38b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f104993e125cfb1c689be005954276a1028aefd0cb71914039fce92e6a61a03b5a2169bf3ed8a36c2bedc0f8b7dfb09d4a701fbef41a30cc666c1444f73b6b48
|
7
|
+
data.tar.gz: e9e285cc61a963e059b4ba311fa16d4c9b6e66ceabd1919101ea110528da5c0d4f4bf77d2e5ff167452a565c1605ec1c91ce5660ea7863ed31148b35d72968aa
|
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# CocoaPods Core
|
2
2
|
|
3
3
|
[![Build Status](https://img.shields.io/travis/CocoaPods/Core/master.svg?style=flat)](https://travis-ci.org/CocoaPods/Core)
|
4
|
-
[![Coverage](https://
|
5
|
-
[![
|
4
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/91a2d70b9ed977815c66/test_coverage)](https://codeclimate.com/github/CocoaPods/Core/test_coverage)
|
5
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/91a2d70b9ed977815c66/maintainability)](https://codeclimate.com/github/CocoaPods/Core/maintainability)
|
6
6
|
|
7
7
|
The CocoaPods-Core gem provides support to work with the models of CocoaPods.
|
8
8
|
It is intended to be used in place of the CocoaPods gem when the installation
|
@@ -1,8 +1,8 @@
|
|
1
1
|
require 'cocoapods-core/source'
|
2
2
|
require 'rest'
|
3
3
|
require 'concurrent'
|
4
|
-
require 'typhoeus'
|
5
4
|
require 'netrc'
|
5
|
+
require 'addressable'
|
6
6
|
|
7
7
|
module Pod
|
8
8
|
# Subclass of Pod::Source to provide support for CDN-based Specs repositories
|
@@ -315,6 +315,11 @@ module Pod
|
|
315
315
|
metadata.path_fragment(pod_name)[0..-2]
|
316
316
|
end
|
317
317
|
|
318
|
+
def local_file_okay?(partial_url)
|
319
|
+
file_path = repo.join(partial_url)
|
320
|
+
File.exist?(file_path) && File.size(file_path) > 0
|
321
|
+
end
|
322
|
+
|
318
323
|
def local_file(partial_url)
|
319
324
|
file_path = repo.join(partial_url)
|
320
325
|
File.open(file_path) do |file|
|
@@ -334,10 +339,11 @@ module Pod
|
|
334
339
|
end
|
335
340
|
|
336
341
|
def download_file_async(partial_url)
|
337
|
-
file_remote_url = URI.encode(url + partial_url.to_s)
|
342
|
+
file_remote_url = Addressable::URI.encode(url + partial_url.to_s)
|
338
343
|
path = repo + partial_url
|
339
344
|
|
340
|
-
|
345
|
+
file_okay = local_file_okay?(partial_url)
|
346
|
+
if file_okay
|
341
347
|
if @startup_time < File.mtime(path)
|
342
348
|
debug "CDN: #{name} Relative path: #{partial_url} modified during this run! Returning local"
|
343
349
|
return Promises.fulfilled_future(partial_url, HYDRA_EXECUTOR)
|
@@ -353,7 +359,7 @@ module Pod
|
|
353
359
|
|
354
360
|
etag_path = path.sub_ext(path.extname + '.etag')
|
355
361
|
|
356
|
-
etag = File.read(etag_path) if File.exist?(etag_path)
|
362
|
+
etag = File.read(etag_path) if file_okay && File.exist?(etag_path)
|
357
363
|
debug "CDN: #{name} Relative path: #{partial_url}, has ETag? #{etag}" unless etag.nil?
|
358
364
|
|
359
365
|
download_and_save_with_retries_async(partial_url, file_remote_url, etag)
|
@@ -376,7 +382,7 @@ module Pod
|
|
376
382
|
FileUtils.touch path
|
377
383
|
partial_url
|
378
384
|
when 200
|
379
|
-
File.open(path, 'w') { |f| f.write(response.response_body) }
|
385
|
+
File.open(path, 'w') { |f| f.write(response.response_body.force_encoding('UTF-8')) }
|
380
386
|
|
381
387
|
etag_new = response.headers['etag'] unless response.headers.nil?
|
382
388
|
debug "CDN: #{name} Relative path downloaded: #{partial_url}, save ETag: #{etag_new}"
|
@@ -431,6 +437,8 @@ module Pod
|
|
431
437
|
end
|
432
438
|
|
433
439
|
def download_typhoeus_impl_async(file_remote_url, etag)
|
440
|
+
require 'typhoeus'
|
441
|
+
|
434
442
|
# Create a prefereably HTTP/2 request - the protocol is ultimately responsible for picking
|
435
443
|
# the maximum supported protocol
|
436
444
|
# When debugging with proxy, use the following extra options:
|
@@ -183,6 +183,23 @@ module Pod
|
|
183
183
|
end
|
184
184
|
end
|
185
185
|
|
186
|
+
# Calls the post integrate callback if defined.
|
187
|
+
#
|
188
|
+
# @param [Pod::Installer] installer
|
189
|
+
# the installer that is performing the installation.
|
190
|
+
#
|
191
|
+
# @return [Bool] whether a post install callback was specified and it was
|
192
|
+
# called.
|
193
|
+
#
|
194
|
+
def post_integrate!(installer)
|
195
|
+
if @post_integrate_callback
|
196
|
+
@post_integrate_callback.call(installer)
|
197
|
+
true
|
198
|
+
else
|
199
|
+
false
|
200
|
+
end
|
201
|
+
end
|
202
|
+
|
186
203
|
#-------------------------------------------------------------------------#
|
187
204
|
|
188
205
|
public
|
@@ -71,6 +71,35 @@ module Pod
|
|
71
71
|
set_hash_value('installation_method', 'name' => installation_method, 'options' => options)
|
72
72
|
end
|
73
73
|
|
74
|
+
# Raises a warning when CocoaPods is run using the Global Gemset.
|
75
|
+
# A Semantic version can be supplied to warn if the bundler version
|
76
|
+
# does not match the required version.
|
77
|
+
#
|
78
|
+
# @param [String] version
|
79
|
+
# The required bundler version, in semantic version format.
|
80
|
+
#
|
81
|
+
# @example
|
82
|
+
#
|
83
|
+
# ensure_bundler!
|
84
|
+
#
|
85
|
+
# @example
|
86
|
+
#
|
87
|
+
# ensure_bundler! '~> 2.0.0'
|
88
|
+
#
|
89
|
+
# @return [void]
|
90
|
+
#
|
91
|
+
def ensure_bundler!(version = nil)
|
92
|
+
unless current_target_definition.root?
|
93
|
+
raise Informative, 'The Ensure Bundler check can only be set at the root level of the Podfile.'
|
94
|
+
end
|
95
|
+
unless %w(BUNDLE_BIN_PATH BUNDLE_GEMFILE).all? { |key| ENV.key?(key) }
|
96
|
+
raise Informative, "CocoaPods was invoked from Global Gemset.\nPlease re-run using: `bundle exec pod #{ARGV.join(' ')}`"
|
97
|
+
end
|
98
|
+
unless ENV['BUNDLER_VERSION'].nil? || Requirement.create(version).satisfied_by?(Version.new(ENV['BUNDLER_VERSION']))
|
99
|
+
raise Informative, "The installed Bundler version: #{ENV['BUNDLER_VERSION']} does not match the required version: #{version}"
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
74
103
|
#-----------------------------------------------------------------------#
|
75
104
|
|
76
105
|
# @!group Dependencies
|
@@ -112,6 +141,7 @@ module Pod
|
|
112
141
|
# specify in your version requirement. The example is equal to
|
113
142
|
# `>= 0.1.2` combined with `< 0.2.0` and will always match the
|
114
143
|
# latest known version matching your requirements.
|
144
|
+
# * `~> 0` Version 0 and the versions up to 1, not including 1.
|
115
145
|
# * `~> 0.1.3-beta.0` Beta and release versions for 0.1.3, release versions
|
116
146
|
# up to 0.2 excluding 0.2. Components separated by a dash (-)
|
117
147
|
# will not be considered for the version requirement.
|
@@ -930,6 +960,26 @@ module Pod
|
|
930
960
|
raise Informative, 'Specifying multiple `post_install` hooks is unsupported.' if @post_install_callback
|
931
961
|
@post_install_callback = block
|
932
962
|
end
|
963
|
+
|
964
|
+
# This hook allows you to make changes after the project is written
|
965
|
+
# to disk.
|
966
|
+
#
|
967
|
+
# It receives the
|
968
|
+
# [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
|
969
|
+
# as its only argument.
|
970
|
+
#
|
971
|
+
# @example Customising the build settings of all targets
|
972
|
+
#
|
973
|
+
# post_integrate do |installer|
|
974
|
+
# # some change after project write to disk
|
975
|
+
# end
|
976
|
+
#
|
977
|
+
# @return [void]
|
978
|
+
#
|
979
|
+
def post_integrate(&block)
|
980
|
+
raise Informative, 'Specifying multiple `post_integrate` hooks is unsupported.' if @post_integrate_callback
|
981
|
+
@post_integrate_callback = block
|
982
|
+
end
|
933
983
|
end
|
934
984
|
end
|
935
985
|
end
|
@@ -1261,7 +1261,8 @@ module Pod
|
|
1261
1261
|
|
1262
1262
|
# @!method vendored_frameworks=(*frameworks)
|
1263
1263
|
#
|
1264
|
-
# The paths of the framework bundles that come shipped with the Pod.
|
1264
|
+
# The paths of the framework bundles that come shipped with the Pod. Supports both `.framework` and `.xcframework` bundles.
|
1265
|
+
# The frameworks will be made available to the Pod and to the consumers of the pod.
|
1265
1266
|
#
|
1266
1267
|
# @example
|
1267
1268
|
#
|
@@ -1269,7 +1270,7 @@ module Pod
|
|
1269
1270
|
#
|
1270
1271
|
# @example
|
1271
1272
|
#
|
1272
|
-
# spec.vendored_frameworks = 'MyFramework.framework', 'TheirFramework.
|
1273
|
+
# spec.vendored_frameworks = 'MyFramework.framework', 'TheirFramework.xcframework'
|
1273
1274
|
#
|
1274
1275
|
# @param [String, Array<String>] vendored_frameworks
|
1275
1276
|
# A list of framework bundles paths.
|
@@ -1283,7 +1284,8 @@ module Pod
|
|
1283
1284
|
|
1284
1285
|
# @!method vendored_libraries=(*frameworks)
|
1285
1286
|
#
|
1286
|
-
# The paths of the libraries that come shipped with the Pod.
|
1287
|
+
# The paths of the libraries that come shipped with the Pod. The libraries will be available to the Pod and the
|
1288
|
+
# consumers of the Pod.
|
1287
1289
|
#
|
1288
1290
|
# @example
|
1289
1291
|
#
|
@@ -288,6 +288,7 @@ module Pod
|
|
288
288
|
# Performs validations related to the `homepage` attribute.
|
289
289
|
#
|
290
290
|
def _validate_homepage(h)
|
291
|
+
return unless h.is_a?(String)
|
291
292
|
if h =~ %r{http://EXAMPLE}
|
292
293
|
results.add_warning('homepage', 'The homepage has not been updated' \
|
293
294
|
' from default')
|
@@ -336,6 +337,19 @@ module Pod
|
|
336
337
|
end
|
337
338
|
end
|
338
339
|
|
340
|
+
# Performs validations related to the `vendored_libraries` attribute.
|
341
|
+
#
|
342
|
+
# @param [Array<String>] vendored_libraries the values specified in the `vendored_libraries` attribute
|
343
|
+
#
|
344
|
+
def _validate_vendored_libraries(vendored_libraries)
|
345
|
+
vendored_libraries.each do |lib|
|
346
|
+
lib_name = lib.downcase
|
347
|
+
unless lib_name.end_with?('.a') && lib_name.start_with?('lib')
|
348
|
+
results.add_warning('vendored_libraries', "`#{File.basename(lib)}` does not match the expected static library name format `lib[name].a`")
|
349
|
+
end
|
350
|
+
end
|
351
|
+
end
|
352
|
+
|
339
353
|
# Performs validations related to the `license` attribute.
|
340
354
|
#
|
341
355
|
def _validate_license(l)
|
@@ -69,7 +69,8 @@ module Pod
|
|
69
69
|
#
|
70
70
|
def prerelease?
|
71
71
|
return @prerelease if defined?(@prerelease)
|
72
|
-
|
72
|
+
comparable_version = @version.sub(/#{METADATA_PATTERN}$/, '')
|
73
|
+
@prerelease = comparable_version =~ /[a-zA-Z\-]/
|
73
74
|
end
|
74
75
|
|
75
76
|
# @return [Bool] Whether a string representation is correct.
|
metadata
CHANGED
@@ -1,23 +1,23 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.10.0.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
8
8
|
- Fabio Pelosin
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2020-
|
12
|
+
date: 2020-09-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- - "
|
18
|
+
- - ">"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version:
|
20
|
+
version: '5.0'
|
21
21
|
- - "<"
|
22
22
|
- !ruby/object:Gem::Version
|
23
23
|
version: '6'
|
@@ -25,9 +25,9 @@ dependencies:
|
|
25
25
|
prerelease: false
|
26
26
|
version_requirements: !ruby/object:Gem::Requirement
|
27
27
|
requirements:
|
28
|
-
- - "
|
28
|
+
- - ">"
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
version:
|
30
|
+
version: '5.0'
|
31
31
|
- - "<"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '6'
|
@@ -115,6 +115,34 @@ dependencies:
|
|
115
115
|
- - "~>"
|
116
116
|
- !ruby/object:Gem::Version
|
117
117
|
version: '0.11'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: addressable
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '2.6'
|
125
|
+
type: :runtime
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '2.6'
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: public_suffix
|
134
|
+
requirement: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
type: :runtime
|
140
|
+
prerelease: false
|
141
|
+
version_requirements: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - ">="
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '0'
|
118
146
|
- !ruby/object:Gem::Dependency
|
119
147
|
name: bacon
|
120
148
|
requirement: !ruby/object:Gem::Requirement
|
@@ -188,7 +216,7 @@ homepage: https://github.com/CocoaPods/CocoaPods
|
|
188
216
|
licenses:
|
189
217
|
- MIT
|
190
218
|
metadata: {}
|
191
|
-
post_install_message:
|
219
|
+
post_install_message:
|
192
220
|
rdoc_options: []
|
193
221
|
require_paths:
|
194
222
|
- lib
|
@@ -196,15 +224,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
196
224
|
requirements:
|
197
225
|
- - ">="
|
198
226
|
- !ruby/object:Gem::Version
|
199
|
-
version: 2.
|
227
|
+
version: 2.3.3
|
200
228
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
201
229
|
requirements:
|
202
230
|
- - ">="
|
203
231
|
- !ruby/object:Gem::Version
|
204
232
|
version: '0'
|
205
233
|
requirements: []
|
206
|
-
rubygems_version: 3.0.
|
207
|
-
signing_key:
|
234
|
+
rubygems_version: 3.0.6
|
235
|
+
signing_key:
|
208
236
|
specification_version: 3
|
209
237
|
summary: The models of CocoaPods
|
210
238
|
test_files: []
|