cocoapods 0.33.1 → 0.34.0.rc1
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +171 -46
- data/README.md +9 -9
- data/bin/pod +5 -5
- data/bin/sandbox-pod +2 -6
- data/lib/cocoapods.rb +4 -4
- data/lib/cocoapods/command.rb +12 -10
- data/lib/cocoapods/command/init.rb +12 -13
- data/lib/cocoapods/command/inter_process_communication.rb +6 -17
- data/lib/cocoapods/command/lib.rb +27 -24
- data/lib/cocoapods/command/list.rb +9 -9
- data/lib/cocoapods/command/outdated.rb +4 -9
- data/lib/cocoapods/command/project.rb +57 -19
- data/lib/cocoapods/command/push.rb +0 -1
- data/lib/cocoapods/command/repo.rb +14 -15
- data/lib/cocoapods/command/repo/push.rb +24 -19
- data/lib/cocoapods/command/search.rb +12 -13
- data/lib/cocoapods/command/setup.rb +10 -9
- data/lib/cocoapods/command/spec.rb +67 -63
- data/lib/cocoapods/config.rb +21 -54
- data/lib/cocoapods/downloader.rb +0 -1
- data/lib/cocoapods/executable.rb +3 -8
- data/lib/cocoapods/external_sources.rb +2 -4
- data/lib/cocoapods/external_sources/abstract_external_source.rb +15 -10
- data/lib/cocoapods/external_sources/downloader_source.rb +0 -2
- data/lib/cocoapods/external_sources/path_source.rb +1 -4
- data/lib/cocoapods/external_sources/podspec_source.rb +1 -3
- data/lib/cocoapods/gem_version.rb +1 -2
- data/lib/cocoapods/generator/acknowledgements.rb +5 -8
- data/lib/cocoapods/generator/acknowledgements/markdown.rb +5 -7
- data/lib/cocoapods/generator/acknowledgements/plist.rb +9 -10
- data/lib/cocoapods/generator/bridge_support.rb +1 -1
- data/lib/cocoapods/generator/copy_resources_script.rb +10 -14
- data/lib/cocoapods/generator/dummy_source.rb +3 -3
- data/lib/cocoapods/generator/prefix_header.rb +15 -16
- data/lib/cocoapods/generator/target_environment_header.rb +122 -36
- data/lib/cocoapods/generator/xcconfig.rb +0 -4
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +74 -65
- data/lib/cocoapods/generator/xcconfig/private_pod_xcconfig.rb +92 -95
- data/lib/cocoapods/generator/xcconfig/public_pod_xcconfig.rb +48 -51
- data/lib/cocoapods/generator/xcconfig/xcconfig_helper.rb +10 -10
- data/lib/cocoapods/hooks/installer_representation.rb +15 -18
- data/lib/cocoapods/hooks/library_representation.rb +4 -8
- data/lib/cocoapods/hooks/pod_representation.rb +1 -5
- data/lib/cocoapods/hooks_manager.rb +63 -0
- data/lib/cocoapods/installer.rb +60 -47
- data/lib/cocoapods/installer/analyzer.rb +60 -62
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +5 -8
- data/lib/cocoapods/installer/file_references_installer.rb +7 -10
- data/lib/cocoapods/installer/hooks_context.rb +74 -0
- data/lib/cocoapods/installer/migrator.rb +99 -0
- data/lib/cocoapods/installer/pod_source_installer.rb +9 -29
- data/lib/cocoapods/installer/target_installer.rb +7 -17
- data/lib/cocoapods/installer/target_installer/aggregate_target_installer.rb +40 -41
- data/lib/cocoapods/installer/target_installer/pod_target_installer.rb +43 -54
- data/lib/cocoapods/installer/user_project_integrator.rb +54 -10
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +66 -117
- data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +116 -0
- data/lib/cocoapods/open_uri.rb +1 -2
- data/lib/cocoapods/project.rb +34 -8
- data/lib/cocoapods/resolver.rb +43 -21
- data/lib/cocoapods/sandbox.rb +80 -75
- data/lib/cocoapods/sandbox/file_accessor.rb +3 -8
- data/lib/cocoapods/sandbox/headers_store.rb +6 -7
- data/lib/cocoapods/sandbox/path_list.rb +7 -10
- data/lib/cocoapods/sources_manager.rb +81 -49
- data/lib/cocoapods/target.rb +18 -12
- data/lib/cocoapods/target/aggregate_target.rb +43 -18
- data/lib/cocoapods/target/pod_target.rb +37 -4
- data/lib/cocoapods/user_interface.rb +19 -18
- data/lib/cocoapods/user_interface/error_report.rb +23 -4
- data/lib/cocoapods/validator.rb +30 -33
- metadata +100 -73
- data/lib/cocoapods/command/help.rb +0 -25
@@ -1,10 +1,8 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Stores the information relative to the target used to cluster the targets
|
4
3
|
# of the single Pods. The client targets will then depend on this one.
|
5
4
|
#
|
6
5
|
class AggregateTarget < Target
|
7
|
-
|
8
6
|
# @param [TargetDefinition] target_definition @see target_definition
|
9
7
|
# @param [Sandbox] sandbox @see sandbox
|
10
8
|
#
|
@@ -13,6 +11,7 @@ module Pod
|
|
13
11
|
@sandbox = sandbox
|
14
12
|
@pod_targets = []
|
15
13
|
@file_accessors = []
|
14
|
+
@xcconfigs = {}
|
16
15
|
end
|
17
16
|
|
18
17
|
# @return [String] the label for the target.
|
@@ -36,21 +35,37 @@ module Pod
|
|
36
35
|
#
|
37
36
|
attr_accessor :user_project_path
|
38
37
|
|
39
|
-
# @return [String] the list of the UUIDs of the user targets that
|
40
|
-
# integrated by this target as identified by the
|
38
|
+
# @return [Array<String>] the list of the UUIDs of the user targets that
|
39
|
+
# will be integrated by this target as identified by the analyzer.
|
41
40
|
#
|
42
41
|
# @note The target instances are not stored to prevent editing different
|
43
42
|
# instances.
|
44
43
|
#
|
45
44
|
attr_accessor :user_target_uuids
|
46
45
|
|
47
|
-
# @return [
|
46
|
+
# @return [Array<PBXNativeTarget>] The list of all the user targets that
|
47
|
+
# will be integrated by this target.
|
48
|
+
#
|
49
|
+
def user_targets(project = nil)
|
50
|
+
project ||= Xcodeproj::Project.open(user_project_path)
|
51
|
+
user_target_uuids.map do |uuid|
|
52
|
+
native_target = project.objects_by_uuid[uuid]
|
53
|
+
unless native_target
|
54
|
+
raise Informative, '[Bug] Unable to find the target with ' \
|
55
|
+
"the `#{uuid}` UUID for the `#{self}` integration library"
|
56
|
+
end
|
57
|
+
native_target
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
# @return [Hash<String, Xcodeproj::Config>] Map from configuration name to
|
62
|
+
# configuration file for the target
|
48
63
|
#
|
49
|
-
# @note The
|
64
|
+
# @note The configurations are generated by the {TargetInstaller} and
|
50
65
|
# used by {UserProjectIntegrator} to check for any overridden
|
51
66
|
# values.
|
52
67
|
#
|
53
|
-
|
68
|
+
attr_reader :xcconfigs
|
54
69
|
|
55
70
|
# @return [Array<PodTarget>] The dependencies for this target.
|
56
71
|
#
|
@@ -62,6 +77,19 @@ module Pod
|
|
62
77
|
pod_targets.map(&:specs).flatten
|
63
78
|
end
|
64
79
|
|
80
|
+
# @return [Hash{Symbol => Array<PodTarget>}] The pod targets for each
|
81
|
+
# build configuration.
|
82
|
+
#
|
83
|
+
def specs_by_build_configuration
|
84
|
+
result = {}
|
85
|
+
user_build_configurations.keys.each do |build_configuration|
|
86
|
+
result[build_configuration] = pod_targets.select do |pod_target|
|
87
|
+
pod_target.include_in_build_config?(build_configuration)
|
88
|
+
end.map(&:specs).flatten
|
89
|
+
end
|
90
|
+
result
|
91
|
+
end
|
92
|
+
|
65
93
|
# @return [Array<Specification::Consumer>] The consumers of the Pod.
|
66
94
|
#
|
67
95
|
def spec_consumers
|
@@ -74,27 +102,28 @@ module Pod
|
|
74
102
|
# the file type.
|
75
103
|
#
|
76
104
|
def acknowledgements_basepath
|
77
|
-
|
105
|
+
support_files_dir + "#{label}-acknowledgements"
|
78
106
|
end
|
79
107
|
|
80
108
|
# @return [Pathname] The absolute path of the copy resources script.
|
81
109
|
#
|
82
110
|
def copy_resources_script_path
|
83
|
-
|
111
|
+
support_files_dir + "#{label}-resources.sh"
|
84
112
|
end
|
85
113
|
|
86
114
|
# @return [String] The xcconfig path of the root from the `$(SRCROOT)`
|
87
115
|
# variable of the user's project.
|
88
116
|
#
|
89
117
|
def relative_pods_root
|
90
|
-
"${SRCROOT}/#{
|
118
|
+
"${SRCROOT}/#{sandbox.root.relative_path_from(client_root)}"
|
91
119
|
end
|
92
120
|
|
121
|
+
# @param [String] config_name The build configuration name to get the xcconfig for
|
93
122
|
# @return [String] The path of the xcconfig file relative to the root of
|
94
123
|
# the user project.
|
95
124
|
#
|
96
|
-
def xcconfig_relative_path
|
97
|
-
relative_to_srcroot(xcconfig_path).to_s
|
125
|
+
def xcconfig_relative_path(config_name)
|
126
|
+
relative_to_srcroot(xcconfig_path(config_name)).to_s
|
98
127
|
end
|
99
128
|
|
100
129
|
# @return [String] The path of the copy resources script relative to the
|
@@ -104,11 +133,10 @@ module Pod
|
|
104
133
|
"${SRCROOT}/#{relative_to_srcroot(copy_resources_script_path)}"
|
105
134
|
end
|
106
135
|
|
107
|
-
|
136
|
+
private
|
108
137
|
|
109
138
|
# @!group Private Helpers
|
110
|
-
|
111
|
-
private
|
139
|
+
#-------------------------------------------------------------------------#
|
112
140
|
|
113
141
|
# Computes the relative path of a sandboxed file from the `$(SRCROOT)`
|
114
142
|
# variable of the user's project.
|
@@ -121,8 +149,5 @@ module Pod
|
|
121
149
|
def relative_to_srcroot(path)
|
122
150
|
path.relative_path_from(client_root).to_s
|
123
151
|
end
|
124
|
-
|
125
|
-
#-------------------------------------------------------------------------#
|
126
|
-
|
127
152
|
end
|
128
153
|
end
|
@@ -1,10 +1,8 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Stores the information relative to the target used to compile a single Pod.
|
4
3
|
# A pod can have one or more activated spec/subspecs.
|
5
4
|
#
|
6
5
|
class PodTarget < Target
|
7
|
-
|
8
6
|
# @return [Specification] the spec for the target.
|
9
7
|
#
|
10
8
|
attr_reader :specs
|
@@ -21,14 +19,14 @@ module Pod
|
|
21
19
|
@specs = specs
|
22
20
|
@target_definition = target_definition
|
23
21
|
@sandbox = sandbox
|
24
|
-
@build_headers = Sandbox::HeadersStore.new(sandbox,
|
22
|
+
@build_headers = Sandbox::HeadersStore.new(sandbox, 'Build')
|
25
23
|
@file_accessors = []
|
26
24
|
end
|
27
25
|
|
28
26
|
# @return [String] the label for the target.
|
29
27
|
#
|
30
28
|
def label
|
31
|
-
"#{target_definition.label
|
29
|
+
"#{target_definition.label}-#{root_spec.name}"
|
32
30
|
end
|
33
31
|
|
34
32
|
# @return [Array<Sandbox::FileAccessor>] the file accessors for the
|
@@ -64,5 +62,40 @@ module Pod
|
|
64
62
|
end.flatten
|
65
63
|
end
|
66
64
|
|
65
|
+
# Checks if the target should be included in the build configuration with
|
66
|
+
# the given name.
|
67
|
+
#
|
68
|
+
# @param [String] configuration_name
|
69
|
+
# The name of the build configuration.
|
70
|
+
#
|
71
|
+
def include_in_build_config?(configuration_name)
|
72
|
+
whitelists = target_definition_dependencies.map do |dependency|
|
73
|
+
target_definition.pod_whitelisted_for_configuration?(dependency.name, configuration_name)
|
74
|
+
end.uniq
|
75
|
+
|
76
|
+
if whitelists.empty?
|
77
|
+
return true
|
78
|
+
elsif whitelists.count == 1
|
79
|
+
whitelists.first
|
80
|
+
else
|
81
|
+
raise Informative, "The subspecs of `#{pod_name}` are linked to " \
|
82
|
+
"different build configurations for the `#{target_definition}` " \
|
83
|
+
'target. CocoaPods does not currently support subspecs across ' \
|
84
|
+
'different build configurations.'
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
private
|
89
|
+
|
90
|
+
# @return [Array<Dependency>] The dependency of the target definition for
|
91
|
+
# this Pod. Return an empty array if the Pod is not a direct
|
92
|
+
# dependency of the target definition but the dependency of one or
|
93
|
+
# more Pods.
|
94
|
+
#
|
95
|
+
def target_definition_dependencies
|
96
|
+
target_definition.dependencies.select do |dependency|
|
97
|
+
Specification.root_name(dependency.name) == pod_name
|
98
|
+
end
|
99
|
+
end
|
67
100
|
end
|
68
101
|
end
|
@@ -1,22 +1,19 @@
|
|
1
1
|
require 'cocoapods/user_interface/error_report'
|
2
2
|
|
3
3
|
module Pod
|
4
|
-
|
5
4
|
# Provides support for UI output. It provides support for nested sections of
|
6
5
|
# information and for a verbose mode.
|
7
6
|
#
|
8
7
|
module UserInterface
|
9
|
-
|
10
8
|
require 'colored'
|
11
9
|
|
12
|
-
@title_colors = %w
|
10
|
+
@title_colors = %w( yellow green )
|
13
11
|
@title_level = 0
|
14
12
|
@indentation_level = 2
|
15
13
|
@treat_titles_as_messages = false
|
16
14
|
@warnings = []
|
17
15
|
|
18
16
|
class << self
|
19
|
-
|
20
17
|
include Config::Mixin
|
21
18
|
|
22
19
|
attr_accessor :indentation_level
|
@@ -27,7 +24,7 @@ module Pod
|
|
27
24
|
# terminal should be disabled.
|
28
25
|
#
|
29
26
|
attr_accessor :disable_wrap
|
30
|
-
alias_method
|
27
|
+
alias_method :disable_wrap?, :disable_wrap
|
31
28
|
|
32
29
|
# Prints a title taking an optional verbose prefix and
|
33
30
|
# a relative indentation valid for the UI action in the passed
|
@@ -78,7 +75,7 @@ module Pod
|
|
78
75
|
# A title opposed to a section is always visible
|
79
76
|
#
|
80
77
|
def title(title, verbose_prefix = '', relative_indentation = 2)
|
81
|
-
if
|
78
|
+
if @treat_titles_as_messages
|
82
79
|
message(title, verbose_prefix)
|
83
80
|
else
|
84
81
|
title = verbose_prefix + title if config.verbose?
|
@@ -122,7 +119,7 @@ module Pod
|
|
122
119
|
#
|
123
120
|
def info(message)
|
124
121
|
indentation = config.verbose? ? self.indentation_level : 0
|
125
|
-
indented = wrap_string(message,
|
122
|
+
indented = wrap_string(message, ' ' * indentation)
|
126
123
|
puts(indented)
|
127
124
|
|
128
125
|
self.indentation_level += 2
|
@@ -148,7 +145,9 @@ module Pod
|
|
148
145
|
#
|
149
146
|
def path(pathname)
|
150
147
|
if pathname
|
151
|
-
|
148
|
+
from_path = config.podfile_path.dirname if config.podfile_path
|
149
|
+
from_path ||= Pathname.pwd
|
150
|
+
path = Pathname(pathname).relative_path_from(from_path)
|
152
151
|
"`#{path}`"
|
153
152
|
else
|
154
153
|
''
|
@@ -162,7 +161,15 @@ module Pod
|
|
162
161
|
puts_indented "#{set.name} #{set.versions.first.version}"
|
163
162
|
else
|
164
163
|
pod = Specification::Set::Presenter.new(set, statistics_provider)
|
165
|
-
title
|
164
|
+
title = "\n-> #{pod.name} (#{pod.version})"
|
165
|
+
if pod.spec.deprecated?
|
166
|
+
title += " #{pod.deprecation_description}"
|
167
|
+
colored_title = title.red
|
168
|
+
else
|
169
|
+
colored_title = title.green
|
170
|
+
end
|
171
|
+
|
172
|
+
title(colored_title, '', 1) do
|
166
173
|
puts_indented pod.summary
|
167
174
|
puts_indented "pod '#{pod.name}', '~> #{pod.version}'"
|
168
175
|
labeled('Homepage', pod.homepage)
|
@@ -202,7 +209,7 @@ module Pod
|
|
202
209
|
# wrapping it to the terminal width if necessary.
|
203
210
|
#
|
204
211
|
def puts_indented(message = '')
|
205
|
-
indented = wrap_string(message,
|
212
|
+
indented = wrap_string(message, ' ' * self.indentation_level)
|
206
213
|
puts(indented)
|
207
214
|
end
|
208
215
|
|
@@ -217,7 +224,7 @@ module Pod
|
|
217
224
|
next if warning[:verbose_only] && !config.verbose?
|
218
225
|
STDERR.puts("\n[!] #{warning[:message]}".yellow)
|
219
226
|
warning[:actions].each do |action|
|
220
|
-
indented = wrap_string(action,
|
227
|
+
indented = wrap_string(action, ' - ')
|
221
228
|
puts(indented)
|
222
229
|
end
|
223
230
|
end
|
@@ -294,9 +301,7 @@ module Pod
|
|
294
301
|
# Redirects cocoapods-core UI.
|
295
302
|
#
|
296
303
|
module CoreUI
|
297
|
-
|
298
304
|
class << self
|
299
|
-
|
300
305
|
def puts(message)
|
301
306
|
UI.puts message
|
302
307
|
end
|
@@ -308,14 +313,12 @@ module Pod
|
|
308
313
|
end
|
309
314
|
end
|
310
315
|
|
311
|
-
|
316
|
+
#---------------------------------------------------------------------------#
|
312
317
|
|
313
318
|
module Xcodeproj
|
314
|
-
|
315
319
|
# Redirects xcodeproj UI.
|
316
320
|
#
|
317
321
|
module UserInterface
|
318
|
-
|
319
322
|
def self.puts(message)
|
320
323
|
::Pod::UI.puts message
|
321
324
|
end
|
@@ -323,7 +326,5 @@ module Xcodeproj
|
|
323
326
|
def self.warn(message)
|
324
327
|
::Pod::UI.warn message
|
325
328
|
end
|
326
|
-
|
327
329
|
end
|
328
330
|
end
|
329
|
-
|
@@ -8,7 +8,7 @@ module Pod
|
|
8
8
|
module ErrorReport
|
9
9
|
class << self
|
10
10
|
def report(exception)
|
11
|
-
|
11
|
+
<<-EOS
|
12
12
|
|
13
13
|
#{'――― MARKDOWN TEMPLATE ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――――'.reversed}
|
14
14
|
|
@@ -32,6 +32,12 @@ module Pod
|
|
32
32
|
Ruby lib dir : #{RbConfig::CONFIG['libdir']}
|
33
33
|
Repositories : #{repo_information.join("\n ")}
|
34
34
|
```
|
35
|
+
|
36
|
+
### Plugins
|
37
|
+
|
38
|
+
```
|
39
|
+
#{plugins_string}
|
40
|
+
```
|
35
41
|
#{markdown_podfile}
|
36
42
|
### Error
|
37
43
|
|
@@ -75,7 +81,7 @@ EOS
|
|
75
81
|
|
76
82
|
def error_from_podfile(error)
|
77
83
|
if error.message =~ /Podfile:(\d*)/
|
78
|
-
"\nIt appears to have originated from your Podfile at line #{
|
84
|
+
"\nIt appears to have originated from your Podfile at line #{Regexp.last_match[1]}.\n"
|
79
85
|
end
|
80
86
|
end
|
81
87
|
|
@@ -90,15 +96,28 @@ EOS
|
|
90
96
|
end
|
91
97
|
|
92
98
|
def host_information
|
93
|
-
product, version, build
|
99
|
+
product, version, build = `sw_vers`.strip.split("\n").map { |line| line.split(':').last.strip }
|
94
100
|
"#{product} #{version} (#{build})"
|
95
101
|
end
|
96
102
|
|
97
103
|
def xcode_information
|
98
|
-
version, build = `xcodebuild -version`.strip.split("\n").map { |line| line.split(
|
104
|
+
version, build = `xcodebuild -version`.strip.split("\n").map { |line| line.split(' ').last }
|
99
105
|
"#{version} (#{build})"
|
100
106
|
end
|
101
107
|
|
108
|
+
def installed_plugins
|
109
|
+
CLAide::Command::PluginsHelper.specifications.
|
110
|
+
reduce({}) { |hash, s| hash.tap { |h| h[s.name] = s.version.to_s } }
|
111
|
+
end
|
112
|
+
|
113
|
+
def plugins_string
|
114
|
+
plugins = installed_plugins
|
115
|
+
max_name_length = plugins.keys.map(&:length).max
|
116
|
+
plugins.map do |name, version|
|
117
|
+
"#{name.ljust(max_name_length)} : #{version}"
|
118
|
+
end.sort.join("\n")
|
119
|
+
end
|
120
|
+
|
102
121
|
def repo_information
|
103
122
|
SourcesManager.all.map do |source|
|
104
123
|
next unless source.type == 'file system'
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
module Pod
|
2
|
-
|
3
2
|
# Validates a Specification.
|
4
3
|
#
|
5
4
|
# Extends the Linter from the Core to add additional which require the
|
@@ -10,7 +9,6 @@ module Pod
|
|
10
9
|
# it without integration and building the project with xcodebuild.
|
11
10
|
#
|
12
11
|
class Validator
|
13
|
-
|
14
12
|
include Config::Mixin
|
15
13
|
|
16
14
|
# @return [Specification::Linter] the linter instance from CocoaPods
|
@@ -70,7 +68,7 @@ module Pod
|
|
70
68
|
perform_linting
|
71
69
|
perform_extensive_analysis(a_spec) if a_spec && !quick
|
72
70
|
|
73
|
-
UI.puts
|
71
|
+
UI.puts ' -> '.send(result_color) << (a_spec ? a_spec.to_s : file.basename.to_s)
|
74
72
|
print_results
|
75
73
|
validated?
|
76
74
|
end
|
@@ -82,25 +80,25 @@ module Pod
|
|
82
80
|
def print_results
|
83
81
|
results.each do |result|
|
84
82
|
if result.platforms == [:ios]
|
85
|
-
platform_message =
|
83
|
+
platform_message = '[iOS] '
|
86
84
|
elsif result.platforms == [:osx]
|
87
|
-
platform_message =
|
85
|
+
platform_message = '[OSX] '
|
88
86
|
end
|
89
87
|
|
90
|
-
subspecs_message =
|
88
|
+
subspecs_message = ''
|
91
89
|
if result.is_a?(Result)
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
90
|
+
subspecs = result.subspecs.uniq
|
91
|
+
if subspecs.count > 2
|
92
|
+
subspecs_message = '[' + subspecs[0..2].join(', ') + ', and more...] '
|
93
|
+
elsif subspecs.count > 0
|
94
|
+
subspecs_message = '[' + subspecs.join(',') + '] '
|
95
|
+
end
|
98
96
|
end
|
99
97
|
|
100
98
|
case result.type
|
101
|
-
when :error then type =
|
102
|
-
when :warning then type =
|
103
|
-
when :note then type =
|
99
|
+
when :error then type = 'ERROR'
|
100
|
+
when :warning then type = 'WARN'
|
101
|
+
when :note then type = 'NOTE'
|
104
102
|
else raise "#{result.type}" end
|
105
103
|
UI.puts " - #{type.ljust(5)} | #{platform_message}#{subspecs_message}#{result.message}"
|
106
104
|
end
|
@@ -109,7 +107,7 @@ module Pod
|
|
109
107
|
|
110
108
|
#-------------------------------------------------------------------------#
|
111
109
|
|
112
|
-
#
|
110
|
+
# @!group Configuration
|
113
111
|
|
114
112
|
# @return [Bool] whether the validation should skip the checks that
|
115
113
|
# requires the download of the library.
|
@@ -126,8 +124,8 @@ module Pod
|
|
126
124
|
#
|
127
125
|
# @note Uses the `:path` option of the Podfile.
|
128
126
|
#
|
129
|
-
|
130
|
-
|
127
|
+
attr_accessor :local
|
128
|
+
alias_method :local?, :local
|
131
129
|
|
132
130
|
# @return [Bool] Whether the validator should fail only on errors or also
|
133
131
|
# on warnings.
|
@@ -177,7 +175,7 @@ module Pod
|
|
177
175
|
# @return [Pathname] the temporary directory used by the linter.
|
178
176
|
#
|
179
177
|
def validation_dir
|
180
|
-
Pathname.new(File.join(Pathname.new('/tmp').realpath,'CocoaPods/Lint'))
|
178
|
+
Pathname.new(File.join(Pathname.new('/tmp').realpath, 'CocoaPods/Lint'))
|
181
179
|
end
|
182
180
|
|
183
181
|
#-------------------------------------------------------------------------#
|
@@ -229,7 +227,7 @@ module Pod
|
|
229
227
|
# Performs validation of a URL
|
230
228
|
#
|
231
229
|
def validate_url(url)
|
232
|
-
resp = Pod::HTTP
|
230
|
+
resp = Pod::HTTP.validate_url(url)
|
233
231
|
|
234
232
|
if !resp
|
235
233
|
warning "There was a problem validating the URL #{url}."
|
@@ -351,8 +349,10 @@ module Pod
|
|
351
349
|
end
|
352
350
|
end
|
353
351
|
|
354
|
-
|
355
|
-
|
352
|
+
if consumer.spec.root?
|
353
|
+
unless file_accessor.license || spec.license && ( spec.license[:type] == 'Public Domain' || spec.license[:text])
|
354
|
+
warning 'Unable to find a license file'
|
355
|
+
end
|
356
356
|
end
|
357
357
|
end
|
358
358
|
|
@@ -387,14 +387,12 @@ module Pod
|
|
387
387
|
# Specialized Result to support subspecs aggregation
|
388
388
|
#
|
389
389
|
class Result < Specification::Linter::Result
|
390
|
+
def initialize(type, message)
|
391
|
+
super(type, message)
|
392
|
+
@subspecs = []
|
393
|
+
end
|
390
394
|
|
391
|
-
|
392
|
-
super(type, message)
|
393
|
-
@subspecs = []
|
394
|
-
end
|
395
|
-
|
396
|
-
attr_reader :subspecs
|
397
|
-
|
395
|
+
attr_reader :subspecs
|
398
396
|
end
|
399
397
|
|
400
398
|
#-------------------------------------------------------------------------#
|
@@ -415,7 +413,7 @@ module Pod
|
|
415
413
|
local = local?
|
416
414
|
podfile = Pod::Podfile.new do
|
417
415
|
platform(platform_name, deployment_target)
|
418
|
-
if
|
416
|
+
if local
|
419
417
|
pod name, :path => podspec.dirname.to_s
|
420
418
|
else
|
421
419
|
pod name, :podspec => podspec.to_s
|
@@ -443,8 +441,8 @@ module Pod
|
|
443
441
|
l.include?('note: ') && (l !~ /expanded from macro/)
|
444
442
|
end
|
445
443
|
selected_lines.map do |l|
|
446
|
-
new = l.gsub(/\/tmp\/CocoaPods\/Lint\/Pods\//,'')
|
447
|
-
new.gsub!(/^ */,' ')
|
444
|
+
new = l.gsub(/\/tmp\/CocoaPods\/Lint\/Pods\//, '')
|
445
|
+
new.gsub!(/^ */, ' ')
|
448
446
|
end
|
449
447
|
end
|
450
448
|
|
@@ -457,6 +455,5 @@ module Pod
|
|
457
455
|
end
|
458
456
|
|
459
457
|
#-------------------------------------------------------------------------#
|
460
|
-
|
461
458
|
end
|
462
459
|
end
|