cocoapods-core 0.37.2 → 0.38.0.beta.1
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/gem_version.rb +1 -1
- data/lib/cocoapods-core/platform.rb +5 -0
- data/lib/cocoapods-core/podfile.rb +19 -9
- data/lib/cocoapods-core/podfile/dsl.rb +10 -10
- data/lib/cocoapods-core/podfile/target_definition.rb +5 -3
- data/lib/cocoapods-core/specification.rb +12 -0
- data/lib/cocoapods-core/specification/consumer.rb +13 -2
- data/lib/cocoapods-core/specification/dsl.rb +64 -7
- data/lib/cocoapods-core/specification/dsl/deprecations.rb +11 -0
- data/lib/cocoapods-core/specification/linter.rb +3 -1
- data/lib/cocoapods-core/specification/root_attribute_accessors.rb +6 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6424a1ddf29f5d1f2c1e0c105be4021f69e6bf79
|
4
|
+
data.tar.gz: f8b56bedf50e57284d111f8dc3199b8aa7ca7c7c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 58ec6a75d9be566df2a5c513263132cca2f51b19906a030ac1247ee86172871ee770b082989e94bd320d4b3cb1759507a7a053aa637309e46e9b1f73352e8aa1
|
7
|
+
data.tar.gz: 5496cd625328c5c1d6dc3a21a1db91c71cbb67fd36cf3ef6b999a56324d2e8ea6839d17efe037690cc6cd28e76d2be6caf3b074e23a96edfa27a4292571b10df
|
@@ -67,6 +67,10 @@ module Pod
|
|
67
67
|
new :osx
|
68
68
|
end
|
69
69
|
|
70
|
+
def self.watchos
|
71
|
+
new :watchos
|
72
|
+
end
|
73
|
+
|
70
74
|
# Checks if a platform is equivalent to another one or to a symbol
|
71
75
|
# representation.
|
72
76
|
#
|
@@ -188,6 +192,7 @@ module Pod
|
|
188
192
|
case symbolic_name
|
189
193
|
when :ios then 'iOS'
|
190
194
|
when :osx then 'OS X'
|
195
|
+
when :watchos then 'watchOS'
|
191
196
|
else symbolic_name.to_s end
|
192
197
|
end
|
193
198
|
end
|
@@ -234,29 +234,39 @@ module Pod
|
|
234
234
|
|
235
235
|
# Configures a new Podfile from the given ruby string.
|
236
236
|
#
|
237
|
-
# @param [String] string
|
238
|
-
# The ruby string which will configure the podfile with the DSL.
|
239
|
-
#
|
240
237
|
# @param [Pathname] path
|
241
238
|
# The path from which the Podfile is loaded.
|
242
239
|
#
|
240
|
+
# @param [String] contents
|
241
|
+
# The ruby string which will configure the podfile with the DSL.
|
242
|
+
#
|
243
243
|
# @return [Podfile] the new Podfile
|
244
244
|
#
|
245
|
-
def self.from_ruby(path)
|
246
|
-
|
245
|
+
def self.from_ruby(path, contents = nil)
|
246
|
+
contents ||= File.open(path, 'r:utf-8') { |f| f.read }
|
247
|
+
|
247
248
|
# Work around for Rubinius incomplete encoding in 1.9 mode
|
248
|
-
if
|
249
|
-
|
249
|
+
if contents.respond_to?(:encoding) && contents.encoding.name != 'UTF-8'
|
250
|
+
contents.encode!('UTF-8')
|
250
251
|
end
|
252
|
+
|
253
|
+
if contents.tr!('“”‘’‛', %(""'''))
|
254
|
+
# Changes have been made
|
255
|
+
CoreUI.warn "Your #{path.basename} has had smart quotes sanitised. " \
|
256
|
+
'To avoid issues in the future, you should not use ' \
|
257
|
+
'TextEdit for editing it. If you are not using TextEdit, ' \
|
258
|
+
'you should turn off smart quotes in your editor of choice.'
|
259
|
+
end
|
260
|
+
|
251
261
|
podfile = Podfile.new(path) do
|
252
262
|
# rubocop:disable Lint/RescueException
|
253
263
|
begin
|
254
264
|
# rubocop:disable Eval
|
255
|
-
eval(
|
265
|
+
eval(contents, nil, path.to_s)
|
256
266
|
# rubocop:enable Eval
|
257
267
|
rescue Exception => e
|
258
268
|
message = "Invalid `#{path.basename}` file: #{e.message}"
|
259
|
-
raise DSLError.new(message, path, e.backtrace,
|
269
|
+
raise DSLError.new(message, path, e.backtrace, contents)
|
260
270
|
end
|
261
271
|
# rubocop:enable Lint/RescueException
|
262
272
|
end
|
@@ -311,17 +311,17 @@ module Pod
|
|
311
311
|
|
312
312
|
#-----------------------------------------------------------------------#
|
313
313
|
|
314
|
-
# Specifies the platform for which a static library should be
|
314
|
+
# Specifies the platform for which a static library should be built.
|
315
315
|
#
|
316
316
|
# CocoaPods provides a default deployment target if one is not specified.
|
317
|
-
# The current default values are `4.3` for iOS
|
317
|
+
# The current default values are `4.3` for iOS, `10.6` for OS X and `2.0` for watchOS.
|
318
318
|
#
|
319
319
|
# If the deployment target requires it (iOS < `4.3`), `armv6`
|
320
320
|
# architecture will be added to `ARCHS`.
|
321
321
|
#
|
322
322
|
# @param [Symbol] name
|
323
|
-
# the name of platform, can be either `:osx` for OS X
|
324
|
-
# for iOS.
|
323
|
+
# the name of platform, can be either `:osx` for OS X, `:ios`
|
324
|
+
# for iOS or `:watchos` for watchOS.
|
325
325
|
#
|
326
326
|
# @param [String, Version] target
|
327
327
|
# The optional deployment. If not provided a default value
|
@@ -583,12 +583,12 @@ module Pod
|
|
583
583
|
# been downloaded but before they are installed.
|
584
584
|
#
|
585
585
|
# It receives the
|
586
|
-
# [`Pod::
|
586
|
+
# [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
|
587
587
|
# as its only argument.
|
588
588
|
#
|
589
589
|
# @example Defining a pre install hook in a Podfile.
|
590
590
|
#
|
591
|
-
# pre_install do |
|
591
|
+
# pre_install do |installer|
|
592
592
|
# # Do something fancy!
|
593
593
|
# end
|
594
594
|
#
|
@@ -602,13 +602,13 @@ module Pod
|
|
602
602
|
# to perform.
|
603
603
|
#
|
604
604
|
# It receives the
|
605
|
-
# [`Pod::
|
605
|
+
# [`Pod::Installer`](http://rubydoc.info/gems/cocoapods/Pod/Installer/)
|
606
606
|
# as its only argument.
|
607
607
|
#
|
608
|
-
# @example Customising the
|
608
|
+
# @example Customising the build settings of all targets
|
609
609
|
#
|
610
|
-
# post_install do |
|
611
|
-
#
|
610
|
+
# post_install do |installer|
|
611
|
+
# installer.pods_project.targets.each do |target|
|
612
612
|
# target.build_configurations.each do |config|
|
613
613
|
# config.build_settings['GCC_ENABLE_OBJC_GC'] = 'supported'
|
614
614
|
# end
|
@@ -401,6 +401,8 @@ module Pod
|
|
401
401
|
|
402
402
|
#--------------------------------------#
|
403
403
|
|
404
|
+
PLATFORM_DEFAULTS = { :ios => '4.3', :osx => '10.6', :watchos => '2.0' }.freeze
|
405
|
+
|
404
406
|
# @return [Platform] the platform of the target definition.
|
405
407
|
#
|
406
408
|
# @note If no deployment target has been specified a default value is
|
@@ -415,7 +417,7 @@ module Pod
|
|
415
417
|
else
|
416
418
|
name = name_or_hash.to_sym
|
417
419
|
end
|
418
|
-
target ||=
|
420
|
+
target ||= PLATFORM_DEFAULTS[name]
|
419
421
|
Platform.new(name, target)
|
420
422
|
else
|
421
423
|
parent.platform unless root?
|
@@ -435,9 +437,9 @@ module Pod
|
|
435
437
|
# @return [void]
|
436
438
|
#
|
437
439
|
def set_platform(name, target = nil)
|
438
|
-
unless [:ios, :osx].include?(name)
|
440
|
+
unless [:ios, :osx, :watchos].include?(name)
|
439
441
|
raise StandardError, "Unsupported platform `#{name}`. Platform " \
|
440
|
-
'must be `:ios
|
442
|
+
'must be `:ios`, `:osx`, or `:watchos`.'
|
441
443
|
end
|
442
444
|
|
443
445
|
if target
|
@@ -583,6 +583,18 @@ module Pod
|
|
583
583
|
end
|
584
584
|
@defined_in_file = file
|
585
585
|
end
|
586
|
+
|
587
|
+
# @!group Validation
|
588
|
+
|
589
|
+
# Validates the cocoapods_version in the specification against the current version of Core.
|
590
|
+
# It will raise an Informative error if the version is not satisfied.
|
591
|
+
#
|
592
|
+
def validate_cocoapods_version
|
593
|
+
unless cocoapods_version.satisfied_by?(Version.create(CORE_VERSION))
|
594
|
+
raise Informative, "`#{name}` requires CocoaPods version `#{cocoapods_version}`, " \
|
595
|
+
"which is not satisified by your current version, `#{CORE_VERSION}`."
|
596
|
+
end
|
597
|
+
end
|
586
598
|
end
|
587
599
|
|
588
600
|
#---------------------------------------------------------------------------#
|
@@ -88,9 +88,20 @@ module Pod
|
|
88
88
|
spec_attr_accessor :compiler_flags
|
89
89
|
|
90
90
|
# @return [Hash{String => String}] the xcconfig flags for the current
|
91
|
-
# specification.
|
91
|
+
# specification for the pod target.
|
92
92
|
#
|
93
|
-
|
93
|
+
def pod_target_xcconfig
|
94
|
+
attr = Specification::DSL.attributes[:pod_target_xcconfig]
|
95
|
+
merge_values(attr, value_for_attribute(:xcconfig), value_for_attribute(:pod_target_xcconfig))
|
96
|
+
end
|
97
|
+
|
98
|
+
# @return [Hash{String => String}] the xcconfig flags for the current
|
99
|
+
# specification for the user target.
|
100
|
+
#
|
101
|
+
def user_target_xcconfig
|
102
|
+
attr = Specification::DSL.attributes[:user_target_xcconfig]
|
103
|
+
merge_values(attr, value_for_attribute(:xcconfig), value_for_attribute(:user_target_xcconfig))
|
104
|
+
end
|
94
105
|
|
95
106
|
# @return [String] The contents of the prefix header.
|
96
107
|
#
|
@@ -1,7 +1,6 @@
|
|
1
1
|
require 'cocoapods-core/specification/dsl/attribute_support'
|
2
2
|
require 'cocoapods-core/specification/dsl/attribute'
|
3
3
|
require 'cocoapods-core/specification/dsl/platform_proxy'
|
4
|
-
require 'cocoapods-core/specification/dsl/deprecations'
|
5
4
|
|
6
5
|
module Pod
|
7
6
|
class Specification
|
@@ -43,6 +42,9 @@ module Pod
|
|
43
42
|
module DSL
|
44
43
|
extend Pod::Specification::DSL::AttributeSupport
|
45
44
|
|
45
|
+
# Deprecations must be required after include AttributeSupport
|
46
|
+
require 'cocoapods-core/specification/dsl/deprecations'
|
47
|
+
|
46
48
|
#-----------------------------------------------------------------------#
|
47
49
|
|
48
50
|
# @!group Root specification
|
@@ -98,6 +100,22 @@ module Pod
|
|
98
100
|
root_attribute :version,
|
99
101
|
:required => true
|
100
102
|
|
103
|
+
#-----------------------------------------------------------------------#
|
104
|
+
|
105
|
+
# @!method cocoapods_version=(cocoapods_version)
|
106
|
+
#
|
107
|
+
# The version of CocoaPods that the sepcification supports.
|
108
|
+
#
|
109
|
+
# @example
|
110
|
+
#
|
111
|
+
# spec.cocoapods_version = '>= 0.36'
|
112
|
+
#
|
113
|
+
# @param [String] cocoapods_version
|
114
|
+
# the CocoaPods version that the specification supports.
|
115
|
+
# CocoaPods follows [semantic versioning](http://semver.org).
|
116
|
+
#
|
117
|
+
root_attribute :cocoapods_version
|
118
|
+
|
101
119
|
#------------------#
|
102
120
|
|
103
121
|
# @!method authors=(authors)
|
@@ -443,7 +461,7 @@ module Pod
|
|
443
461
|
|
444
462
|
# The names of the platforms supported by the specification class.
|
445
463
|
#
|
446
|
-
PLATFORMS = [:osx, :ios].freeze
|
464
|
+
PLATFORMS = [:osx, :ios, :watchos].freeze
|
447
465
|
|
448
466
|
# @todo This currently is not used in the Ruby DSL.
|
449
467
|
#
|
@@ -717,18 +735,53 @@ module Pod
|
|
717
735
|
|
718
736
|
#------------------#
|
719
737
|
|
720
|
-
# @!method
|
738
|
+
# @!method pod_target_xcconfig=(value)
|
739
|
+
#
|
740
|
+
# Any flag to add to the final __private__ pod target xcconfig file.
|
741
|
+
#
|
742
|
+
# @example
|
743
|
+
#
|
744
|
+
# spec.pod_target_xcconfig = { 'OTHER_LDFLAGS' => '-lObjC' }
|
745
|
+
#
|
746
|
+
# @param [Hash{String => String}] value
|
747
|
+
# Key-value pairs representing build settings.
|
748
|
+
#
|
749
|
+
attribute :pod_target_xcconfig,
|
750
|
+
:container => Hash,
|
751
|
+
:inherited => true
|
752
|
+
|
753
|
+
# @!method user_target_xcconfig=(value)
|
754
|
+
#
|
755
|
+
# Specifies flags to add to the final aggregate target xcconfig file,
|
756
|
+
# which propagates to non-overridden and inheriting build settings to
|
757
|
+
# the integrated user targets.
|
721
758
|
#
|
722
|
-
#
|
759
|
+
# ---
|
760
|
+
#
|
761
|
+
# This attribute is __not recommended__ as Pods should not pollute the
|
762
|
+
# build settings of the user project and this can cause conflicts.
|
763
|
+
#
|
764
|
+
# Multiple definitions for build settings that take multiple values
|
765
|
+
# will be merged. The user is warned on conflicting definitions for
|
766
|
+
# custom build settings and build settings that take only one value.
|
767
|
+
#
|
768
|
+
# Typically clang compiler flags or precompiler macro definitions go
|
769
|
+
# in here if they are required when importing the pod in the user
|
770
|
+
# target. Note that, this influences not only the compiler view of the
|
771
|
+
# public interface of your pod, but also all other integrated pods
|
772
|
+
# alongside to yours. You should always prefer [`pod_target_xcconfig`](
|
773
|
+
# http://guides.cocoapods.org/syntax/podspec.html#pod_target_xcconfig),
|
774
|
+
# which can contain the same settings, but only influence the
|
775
|
+
# toolchain when compiling your pod target.
|
723
776
|
#
|
724
777
|
# @example
|
725
778
|
#
|
726
|
-
# spec.
|
779
|
+
# spec.user_target_xcconfig = { 'MY_SUBSPEC' => 'YES' }
|
727
780
|
#
|
728
781
|
# @param [Hash{String => String}] value
|
729
|
-
#
|
782
|
+
# Key-value pairs representing build settings.
|
730
783
|
#
|
731
|
-
attribute :
|
784
|
+
attribute :user_target_xcconfig,
|
732
785
|
:container => Hash,
|
733
786
|
:inherited => true
|
734
787
|
|
@@ -1316,6 +1369,10 @@ module Pod
|
|
1316
1369
|
def osx
|
1317
1370
|
PlatformProxy.new(self, :osx)
|
1318
1371
|
end
|
1372
|
+
|
1373
|
+
def watchos
|
1374
|
+
PlatformProxy.new(self, :watchos)
|
1375
|
+
end
|
1319
1376
|
end
|
1320
1377
|
end
|
1321
1378
|
end
|
@@ -9,6 +9,17 @@ module Pod
|
|
9
9
|
CoreUI.warn "[#{self}] `preferred_dependency` has been renamed "\
|
10
10
|
'to `default_subspecs`.'
|
11
11
|
end
|
12
|
+
|
13
|
+
DSL.attribute :xcconfig,
|
14
|
+
:container => Hash,
|
15
|
+
:inherited => true
|
16
|
+
|
17
|
+
def xcconfig=(value)
|
18
|
+
self.pod_target_xcconfig = value
|
19
|
+
self.user_target_xcconfig = value
|
20
|
+
CoreUI.warn "[#{self}] `xcconfig` has been split into "\
|
21
|
+
'`pod_target_xcconfig` and `user_target_xcconfig`.'
|
22
|
+
end
|
12
23
|
end
|
13
24
|
end
|
14
25
|
end
|
@@ -372,7 +372,9 @@ module Pod
|
|
372
372
|
if git = s[:git]
|
373
373
|
return unless git =~ /^#{URI.regexp}$/
|
374
374
|
git_uri = URI.parse(git)
|
375
|
-
|
375
|
+
if git_uri.host
|
376
|
+
perform_github_uri_checks(git, git_uri) if git_uri.host.end_with?('github.com')
|
377
|
+
end
|
376
378
|
end
|
377
379
|
end
|
378
380
|
|
@@ -34,6 +34,12 @@ module Pod
|
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
37
|
+
# @return [Requirement] The CocoaPods version required to use the specification.
|
38
|
+
#
|
39
|
+
def cocoapods_version
|
40
|
+
@cocoapods_version ||= Requirement.create(attributes_hash['cocoapods_version'])
|
41
|
+
end
|
42
|
+
|
37
43
|
# @return [Hash] a hash containing the authors as the keys and their
|
38
44
|
# email address as the values.
|
39
45
|
#
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.38.0.beta.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-
|
12
|
+
date: 2015-06-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubyforge_project:
|
140
|
-
rubygems_version: 2.4.
|
140
|
+
rubygems_version: 2.4.8
|
141
141
|
signing_key:
|
142
142
|
specification_version: 3
|
143
143
|
summary: The models of CocoaPods
|