cocoapods 1.2.1.beta.1 → 1.2.1.rc.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +58 -0
- data/lib/cocoapods/command/install.rb +4 -0
- data/lib/cocoapods/external_sources/abstract_external_source.rb +22 -12
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/copy_resources_script.rb +3 -0
- data/lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb +5 -1
- data/lib/cocoapods/installer/analyzer.rb +28 -5
- data/lib/cocoapods/installer/installation_options.rb +1 -0
- data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +32 -17
- data/lib/cocoapods/resolver.rb +24 -5
- data/lib/cocoapods/resolver/lazy_specification.rb +10 -8
- data/lib/cocoapods/sandbox/podspec_finder.rb +3 -7
- data/lib/cocoapods/sources_manager.rb +1 -1
- data/lib/cocoapods/target/aggregate_target.rb +13 -1
- data/lib/cocoapods/validator.rb +6 -1
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 666655faba4b49391d62a9f10e7f3b4a427d925b
|
4
|
+
data.tar.gz: ac8cc0d14bb90c79d42a2d4f80ae301f65d69897
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b210990c83e1c54887ed8ac795923e936c8dc5cbe94015f9f4d53671705eb19075074c19cbfbc7d13d95efeba3eee8cb7329162da4016107865f742345711171
|
7
|
+
data.tar.gz: 12256a5266085c5d411f4205420dd443438989a280c6a7d0d903625f8d2240c38d7bfa6370cb2ce219195eab1e89318a02d10b995e4332860cc137aa93b9db78
|
data/CHANGELOG.md
CHANGED
@@ -4,6 +4,52 @@ To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides
|
|
4
4
|
|
5
5
|
To install release candidates run `[sudo] gem install cocoapods --pre`
|
6
6
|
|
7
|
+
## 1.2.1.rc.1 (2017-04-05)
|
8
|
+
|
9
|
+
##### Enhancements
|
10
|
+
|
11
|
+
* None.
|
12
|
+
|
13
|
+
##### Bug Fixes
|
14
|
+
|
15
|
+
* Fix generating `LD_RUNPATH_SEARCH_PATHS` without `use_frameworks!` but consuming a vendored dynamic artifact.
|
16
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
17
|
+
[#6596](https://github.com/CocoaPods/CocoaPods/issues/6596)
|
18
|
+
|
19
|
+
* Fix building with static lib subprojects (previously only supported framework subprojects).
|
20
|
+
[Ben Asher](https://github.com/benasher44)
|
21
|
+
[#5830](https://github.com/CocoaPods/CocoaPods/issues/5830)
|
22
|
+
[#6306](https://github.com/CocoaPods/CocoaPods/issues/6306)
|
23
|
+
|
24
|
+
* Fix regression from #6457 to ensure a correct error message is given when a spec is not found.
|
25
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
26
|
+
[#6457](https://github.com/CocoaPods/CocoaPods/issues/6457)
|
27
|
+
|
28
|
+
* Provide a better error message if a podspec is found but cannot be parsed.
|
29
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
30
|
+
[#6457](https://github.com/CocoaPods/CocoaPods/issues/6457)
|
31
|
+
|
32
|
+
* Only share pod target xcscheme if present during validation.
|
33
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
34
|
+
[#6558](https://github.com/CocoaPods/CocoaPods/pull/6558)
|
35
|
+
|
36
|
+
* Properly compile storyboard for watch device family.
|
37
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
38
|
+
[#6516](https://github.com/CocoaPods/CocoaPods/issues/6516)
|
39
|
+
|
40
|
+
* Support git progress for `pod repo update` and `pod install --repo-update`
|
41
|
+
[Alfredo Delli Bovi](https://github.com/adellibovi)
|
42
|
+
[#6525](https://github.com/CocoaPods/CocoaPods/issues/6525)
|
43
|
+
|
44
|
+
* Return new exit code (31) when spec not found
|
45
|
+
[Alfredo Delli Bovi](https://github.com/adellibovi)
|
46
|
+
[#6033](https://github.com/CocoaPods/CocoaPods/issues/6033)
|
47
|
+
|
48
|
+
* Provide better error message when spec not found
|
49
|
+
[Alfredo Delli Bovi](https://github.com/adellibovi)
|
50
|
+
[#6033](https://github.com/CocoaPods/CocoaPods/issues/6033)
|
51
|
+
|
52
|
+
|
7
53
|
## 1.2.1.beta.1 (2017-03-08)
|
8
54
|
|
9
55
|
##### Enhancements
|
@@ -12,6 +58,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
|
|
12
58
|
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
13
59
|
[#6534](https://github.com/CocoaPods/CocoaPods/issues/6534)
|
14
60
|
|
61
|
+
* Provide installation option to disable multiple pod sources warnings.
|
62
|
+
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
63
|
+
[#6497](https://github.com/CocoaPods/CocoaPods/pull/6497)
|
64
|
+
|
15
65
|
* Use the colored2 gem instead of colored.
|
16
66
|
[Orta Therox](https://github.com/orta)
|
17
67
|
[xcodeproj#463](https://github.com/CocoaPods/Xcodeproj/pull/463)
|
@@ -20,8 +70,16 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
|
|
20
70
|
[Ken Wigginton](https://github.com/hailstorm350)
|
21
71
|
[#6434](https://github.com/CocoaPods/CocoaPods/pull/6434)
|
22
72
|
|
73
|
+
* Created `NOMENCLATURE.md` to keep a glossary of the most common terms used in cocoapods.
|
74
|
+
[Rob Contreras](https://github.com/robcontreras)
|
75
|
+
[#2379](https://github.com/CocoaPods/CocoaPods/pull/2379)
|
76
|
+
|
23
77
|
##### Bug Fixes
|
24
78
|
|
79
|
+
* Ensure Core Data models get added to the compile sources phase for header generation.
|
80
|
+
[Ben Asher](https://github.com/benasher44)
|
81
|
+
[#6259](https://github.com/CocoaPods/CocoaPods/issues/6259)
|
82
|
+
|
25
83
|
* Do not crash when attempting to install pod with no supported targets.
|
26
84
|
[Dimitris Koutsogiorgas](https://github.com/dnkoutso)
|
27
85
|
[#6465](https://github.com/CocoaPods/CocoaPods/issues/6465)
|
@@ -21,6 +21,10 @@ module Pod
|
|
21
21
|
This will configure the project to reference the Pods static library,
|
22
22
|
add a build configuration file, and add a post build script to copy
|
23
23
|
Pod resources.
|
24
|
+
|
25
|
+
This may return one of several error codes if it encounters problems.
|
26
|
+
* `1` Generic error code
|
27
|
+
* `31` Spec not found (i.e out-of-date source repos, mistyped Pod name etc...)
|
24
28
|
DESC
|
25
29
|
|
26
30
|
def self.options
|
@@ -111,7 +111,13 @@ module Pod
|
|
111
111
|
title = "Pre-downloading: `#{name}` #{description}"
|
112
112
|
UI.titled_section(title, :verbose_prefix => '-> ') do
|
113
113
|
target = sandbox.pod_dir(name)
|
114
|
-
|
114
|
+
begin
|
115
|
+
download_result = Downloader.download(download_request, target, :can_cache => can_cache)
|
116
|
+
rescue Pod::DSLError => e
|
117
|
+
raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
|
118
|
+
rescue => _
|
119
|
+
raise Informative, "Failed to download '#{name}'."
|
120
|
+
end
|
115
121
|
spec = download_result.spec
|
116
122
|
|
117
123
|
raise Informative, "Unable to find a specification for '#{name}'." unless spec
|
@@ -147,17 +153,21 @@ module Pod
|
|
147
153
|
# @return [void]
|
148
154
|
#
|
149
155
|
def store_podspec(sandbox, spec, json = false)
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
156
|
+
begin
|
157
|
+
spec = case spec
|
158
|
+
when Pathname
|
159
|
+
Specification.from_file(spec)
|
160
|
+
when String
|
161
|
+
path = "#{name}.podspec"
|
162
|
+
path << '.json' if json
|
163
|
+
Specification.from_string(spec, path)
|
164
|
+
when Specification
|
165
|
+
spec.dup
|
166
|
+
else
|
167
|
+
raise "Unknown spec type: #{spec}"
|
168
|
+
end
|
169
|
+
rescue Pod::DSLError => e
|
170
|
+
raise Informative, "Failed to load '#{name}' podspec: #{e.message}"
|
161
171
|
end
|
162
172
|
spec.defined_in_file = nil
|
163
173
|
validate_podspec(spec)
|
@@ -80,7 +80,11 @@ module Pod
|
|
80
80
|
# See https://github.com/CocoaPods/CocoaPods/issues/1216
|
81
81
|
@xcconfig.attributes.delete('USE_HEADERMAP')
|
82
82
|
|
83
|
-
|
83
|
+
# If any of the aggregate target dependencies bring in any vendored dynamic artifacts we should ensure to
|
84
|
+
# update the runpath search paths.
|
85
|
+
vendored_dynamic_artifacts = pod_targets.flat_map(&:file_accessors).flat_map(&:vendored_dynamic_artifacts)
|
86
|
+
|
87
|
+
generate_ld_runpath_search_paths if target.requires_frameworks? || vendored_dynamic_artifacts.count > 0
|
84
88
|
|
85
89
|
@xcconfig
|
86
90
|
end
|
@@ -156,6 +156,11 @@ module Pod
|
|
156
156
|
|
157
157
|
private
|
158
158
|
|
159
|
+
# @return [Bool] Whether the analysis has updated sources repositories.
|
160
|
+
#
|
161
|
+
attr_accessor :specs_updated
|
162
|
+
alias_method :specs_updated?, :specs_updated
|
163
|
+
|
159
164
|
def validate_podfile!
|
160
165
|
validator = Installer::PodfileValidator.new(podfile)
|
161
166
|
validator.validate
|
@@ -217,11 +222,12 @@ module Pod
|
|
217
222
|
def update_repositories
|
218
223
|
sources.each do |source|
|
219
224
|
if source.git?
|
220
|
-
config.sources_manager.update(source.name)
|
225
|
+
config.sources_manager.update(source.name, true)
|
221
226
|
else
|
222
227
|
UI.message "Skipping `#{source.name}` update because the repository is not a git source repository."
|
223
228
|
end
|
224
229
|
end
|
230
|
+
@specs_updated = true
|
225
231
|
end
|
226
232
|
|
227
233
|
private
|
@@ -236,11 +242,17 @@ module Pod
|
|
236
242
|
# @param [Array<AggregateTarget>] embedded_aggregate_targets the aggregate targets
|
237
243
|
# representing the embedded targets to be integrated
|
238
244
|
#
|
239
|
-
|
245
|
+
# @param [Boolean] libraries_only if true, only library-type embedded
|
246
|
+
# targets are considered, otherwise, all other types are have
|
247
|
+
# their pods copied to their host targets as well (extensions, etc.)
|
248
|
+
#
|
249
|
+
def copy_embedded_target_pod_targets_to_host(aggregate_target, embedded_aggregate_targets, libraries_only)
|
240
250
|
return if aggregate_target.requires_host_target?
|
241
251
|
pod_target_names = Set.new(aggregate_target.pod_targets.map(&:name))
|
242
252
|
aggregate_user_target_uuids = Set.new(aggregate_target.user_targets.map(&:uuid))
|
243
253
|
embedded_aggregate_targets.each do |embedded_aggregate_target|
|
254
|
+
# Skip non libraries in library-only mode
|
255
|
+
next if libraries_only && !embedded_aggregate_target.library?
|
244
256
|
next unless embedded_aggregate_target.user_targets.any? do |embedded_user_target|
|
245
257
|
# You have to ask the host target's project for the host targets of
|
246
258
|
# the embedded target, as opposed to asking user_project for the
|
@@ -351,11 +363,21 @@ module Pod
|
|
351
363
|
generate_target(target_definition, pod_targets)
|
352
364
|
end
|
353
365
|
if installation_options.integrate_targets?
|
354
|
-
# Copy embedded target pods that cannot have their pods embedded as frameworks to
|
355
|
-
|
366
|
+
# Copy embedded target pods that cannot have their pods embedded as frameworks to
|
367
|
+
# their host targets, and ensure we properly link library pods to their host targets
|
368
|
+
embedded_targets = aggregate_targets.select(&:requires_host_target?)
|
356
369
|
analyze_host_targets_in_podfile(aggregate_targets, embedded_targets)
|
370
|
+
|
371
|
+
use_frameworks_embedded_targets = embedded_targets.select(&:requires_frameworks?)
|
372
|
+
non_use_frameworks_embedded_targets = embedded_targets.reject(&:requires_frameworks?)
|
357
373
|
aggregate_targets.each do |target|
|
358
|
-
|
374
|
+
# For targets that require frameworks, we always have to copy their pods to their
|
375
|
+
# host targets because those frameworks will all be loaded from the host target's bundle
|
376
|
+
copy_embedded_target_pod_targets_to_host(target, use_frameworks_embedded_targets, false)
|
377
|
+
|
378
|
+
# For targets that don't require frameworks, we only have to consider library-type
|
379
|
+
# targets because their host targets will still need to link their pods
|
380
|
+
copy_embedded_target_pod_targets_to_host(target, non_use_frameworks_embedded_targets, true)
|
359
381
|
end
|
360
382
|
end
|
361
383
|
aggregate_targets.each do |target|
|
@@ -716,6 +738,7 @@ module Pod
|
|
716
738
|
specs_by_target = nil
|
717
739
|
UI.section "Resolving dependencies of #{UI.path(podfile.defined_in_file) || 'Podfile'}" do
|
718
740
|
resolver = Resolver.new(sandbox, podfile, locked_dependencies, sources)
|
741
|
+
resolver.specs_updated = specs_updated?
|
719
742
|
specs_by_target = resolver.resolve
|
720
743
|
specs_by_target.values.flatten(1).each(&:validate_cocoapods_version)
|
721
744
|
end
|
@@ -69,13 +69,26 @@ module Pod
|
|
69
69
|
# added by their parent directory. This will also include references to the parent [PBXVariantGroup]
|
70
70
|
# for all resources underneath it.
|
71
71
|
#
|
72
|
-
# @param Array
|
72
|
+
# @param [Array<Pathname>] resource_file_references
|
73
73
|
# The array of all resource file references to filter.
|
74
|
-
|
75
|
-
# @
|
74
|
+
#
|
75
|
+
# @yield_param [Array<PBXFileReference>} The filtered resource file references to be installed
|
76
|
+
# in the copy resources phase.
|
77
|
+
#
|
78
|
+
# @yield_param [Array<PBXFileReference>} The filtered resource file references to be installed
|
79
|
+
# in the compile sources phase.
|
80
|
+
#
|
81
|
+
# @note Core Data model directories (.xcdatamodeld) used to be added to the
|
82
|
+
# `Copy Resources` build phase like all other resources, since they would
|
83
|
+
# compile correctly in either the resources or compile phase. In recent
|
84
|
+
# versions of xcode, there's an exception for data models that generate
|
85
|
+
# headers. These need to be added to the compile sources phase of a real
|
86
|
+
# target for the headers to be built in time for code in the target to
|
87
|
+
# use them. These kinds of models generally break when added to resource
|
88
|
+
# bundles.
|
76
89
|
#
|
77
90
|
def filter_resource_file_references(resource_file_references)
|
78
|
-
resource_file_references.map do |resource_file_reference|
|
91
|
+
file_references = resource_file_references.map do |resource_file_reference|
|
79
92
|
ref = project.reference_for_path(resource_file_reference)
|
80
93
|
|
81
94
|
# Some nested files are not directly present in the Xcode project, such as the contents
|
@@ -87,7 +100,11 @@ module Pod
|
|
87
100
|
next ref.parent if ref.parent.is_a?(Xcodeproj::Project::Object::PBXVariantGroup)
|
88
101
|
|
89
102
|
ref
|
90
|
-
end
|
103
|
+
end.compact.uniq
|
104
|
+
compile_phase_matcher = lambda { |ref| !(ref.path =~ /.*\.xcdatamodeld/i).nil? }
|
105
|
+
resources_phase_refs = file_references.reject(&compile_phase_matcher)
|
106
|
+
compile_phase_refs = file_references.select(&compile_phase_matcher)
|
107
|
+
yield resources_phase_refs, compile_phase_refs
|
91
108
|
end
|
92
109
|
|
93
110
|
#-----------------------------------------------------------------------#
|
@@ -136,9 +153,10 @@ module Pod
|
|
136
153
|
|
137
154
|
next unless target.requires_frameworks?
|
138
155
|
|
139
|
-
|
140
|
-
|
141
|
-
|
156
|
+
filter_resource_file_references(file_accessor.resources.flatten) do |resource_phase_refs, compile_phase_refs|
|
157
|
+
native_target.add_file_references(compile_phase_refs, nil)
|
158
|
+
native_target.add_resources(resource_phase_refs)
|
159
|
+
end
|
142
160
|
end
|
143
161
|
end
|
144
162
|
|
@@ -147,19 +165,11 @@ module Pod
|
|
147
165
|
# @note The source files are grouped by Pod and in turn by subspec
|
148
166
|
# (recursively) in the resources group.
|
149
167
|
#
|
150
|
-
# @note Core Data model directories (.xcdatamodeld) are currently added to the
|
151
|
-
# `Copy Resources` build phase like all other resources. The Xcode UI adds
|
152
|
-
# these to the `Compile Sources` build phase, but they will compile
|
153
|
-
# correctly either way.
|
154
|
-
#
|
155
168
|
# @return [void]
|
156
169
|
#
|
157
170
|
def add_resources_bundle_targets
|
158
171
|
target.file_accessors.each do |file_accessor|
|
159
172
|
file_accessor.resource_bundles.each do |bundle_name, paths|
|
160
|
-
file_references = filter_resource_file_references(paths)
|
161
|
-
file_references = file_references.uniq.compact
|
162
|
-
|
163
173
|
label = target.resources_bundle_target_label(bundle_name)
|
164
174
|
bundle_target = project.new_resources_bundle(label, file_accessor.spec_consumer.platform_name)
|
165
175
|
bundle_target.product_reference.tap do |bundle_product|
|
@@ -167,7 +177,12 @@ module Pod
|
|
167
177
|
bundle_product.name = bundle_file_name
|
168
178
|
bundle_product.path = bundle_file_name
|
169
179
|
end
|
170
|
-
|
180
|
+
|
181
|
+
filter_resource_file_references(paths) do |resource_phase_refs, compile_phase_refs|
|
182
|
+
# Resource bundles are only meant to have resources, so install everything
|
183
|
+
# into the resources phase. See note in filter_resource_file_references.
|
184
|
+
bundle_target.add_resources(resource_phase_refs + compile_phase_refs)
|
185
|
+
end
|
171
186
|
|
172
187
|
target.user_build_configurations.each do |bc_name, type|
|
173
188
|
bundle_target.add_build_configuration(bc_name, type)
|
data/lib/cocoapods/resolver.rb
CHANGED
@@ -2,10 +2,20 @@ require 'molinillo'
|
|
2
2
|
require 'cocoapods/resolver/lazy_specification'
|
3
3
|
|
4
4
|
module Pod
|
5
|
+
class NoSpecFoundError < Informative
|
6
|
+
def exit_status
|
7
|
+
@exit_status ||= 31
|
8
|
+
end
|
9
|
+
end
|
10
|
+
|
5
11
|
# The resolver is responsible of generating a list of specifications grouped
|
6
12
|
# by target for a given Podfile.
|
7
13
|
#
|
8
14
|
class Resolver
|
15
|
+
include Pod::Installer::InstallationOptions::Mixin
|
16
|
+
|
17
|
+
delegate_installation_options { podfile }
|
18
|
+
|
9
19
|
# @return [Sandbox] the Sandbox used by the resolver to find external
|
10
20
|
# dependencies.
|
11
21
|
#
|
@@ -25,6 +35,11 @@ module Pod
|
|
25
35
|
#
|
26
36
|
attr_accessor :sources
|
27
37
|
|
38
|
+
# @return [Bool] Whether the resolver has sources repositories up-to-date.
|
39
|
+
#
|
40
|
+
attr_accessor :specs_updated
|
41
|
+
alias specs_updated? specs_updated
|
42
|
+
|
28
43
|
# Init a new Resolver
|
29
44
|
#
|
30
45
|
# @param [Sandbox] sandbox @see sandbox
|
@@ -288,7 +303,7 @@ module Pod
|
|
288
303
|
def specifications_for_dependency(dependency, additional_requirements = [])
|
289
304
|
requirement = Requirement.new(dependency.requirement.as_list + additional_requirements)
|
290
305
|
find_cached_set(dependency).
|
291
|
-
all_specifications.
|
306
|
+
all_specifications(installation_options.warn_for_multiple_pod_sources).
|
292
307
|
select { |s| requirement.satisfied_by? s.version }.
|
293
308
|
map { |s| s.subspec_by_name(dependency.name, false) }.
|
294
309
|
compact.
|
@@ -385,6 +400,7 @@ module Pod
|
|
385
400
|
#
|
386
401
|
def handle_resolver_error(error)
|
387
402
|
message = error.message.dup
|
403
|
+
type = Informative
|
388
404
|
case error
|
389
405
|
when Molinillo::VersionConflict
|
390
406
|
error.conflicts.each do |name, conflict|
|
@@ -423,12 +439,15 @@ module Pod
|
|
423
439
|
found_conflicted_specs = conflicts.reject { |c| search_for(c).empty? }
|
424
440
|
if found_conflicted_specs.empty?
|
425
441
|
# There are no existing specification inside any of the spec repos with given requirements.
|
442
|
+
type = NoSpecFoundError
|
426
443
|
dependencies = conflicts.count == 1 ? 'dependency' : 'dependencies'
|
427
444
|
message << "\n\nNone of your spec sources contain a spec satisfying "\
|
428
445
|
"the #{dependencies}: `#{conflicts.join(', ')}`." \
|
429
|
-
"\n\nYou have either:"
|
430
|
-
|
431
|
-
"\n *
|
446
|
+
"\n\nYou have either:"
|
447
|
+
unless specs_updated?
|
448
|
+
message << "\n * out-of-date source repos which you can update with `pod repo update` or with `pod install --repo-update`."
|
449
|
+
end
|
450
|
+
message << "\n * mistyped the name or version." \
|
432
451
|
"\n * not added the source repo that hosts the Podspec to your Podfile." \
|
433
452
|
"\n\nNote: as of CocoaPods 1.0, `pod repo update` does not happen on `pod install` by default."
|
434
453
|
|
@@ -439,7 +458,7 @@ module Pod
|
|
439
458
|
end
|
440
459
|
end
|
441
460
|
end
|
442
|
-
raise
|
461
|
+
raise type, message
|
443
462
|
end
|
444
463
|
|
445
464
|
# Returns whether the given spec is platform-compatible with the dependency
|
@@ -32,12 +32,12 @@ module Pod
|
|
32
32
|
end
|
33
33
|
|
34
34
|
class External
|
35
|
-
def all_specifications
|
35
|
+
def all_specifications(_warn_for_multiple_pod_sources)
|
36
36
|
[specification]
|
37
37
|
end
|
38
38
|
end
|
39
39
|
|
40
|
-
def all_specifications
|
40
|
+
def all_specifications(warn_for_multiple_pod_sources)
|
41
41
|
@all_specifications ||= begin
|
42
42
|
sources_by_version = {}
|
43
43
|
versions_by_source.each do |source, versions|
|
@@ -45,13 +45,15 @@ module Pod
|
|
45
45
|
sources_by_version
|
46
46
|
end
|
47
47
|
|
48
|
-
|
48
|
+
if warn_for_multiple_pod_sources
|
49
|
+
duplicate_versions = sources_by_version.select { |_version, sources| sources.count > 1 }
|
49
50
|
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
51
|
+
duplicate_versions.each do |version, sources|
|
52
|
+
UI.warn "Found multiple specifications for `#{name} (#{version})`:\n" +
|
53
|
+
sources.
|
54
|
+
map { |s| s.specification_path(name, version) }.
|
55
|
+
map { |v| "- #{v}" }.join("\n")
|
56
|
+
end
|
55
57
|
end
|
56
58
|
|
57
59
|
versions_by_source.flat_map do |source, versions|
|
@@ -12,13 +12,9 @@ module Pod
|
|
12
12
|
@specs_by_name = {}
|
13
13
|
spec_files = Pathname.glob(root + '{,*}.podspec{,.json}')
|
14
14
|
spec_files.sort_by { |p| -p.to_path.split(File::SEPARATOR).size }.each do |file|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
@specs_by_name[spec.name] = spec
|
19
|
-
rescue => e
|
20
|
-
UI.warn "Unable to load a podspec from `#{file.basename}`, skipping:\n\n#{e}"
|
21
|
-
end
|
15
|
+
spec = Specification.from_file(file)
|
16
|
+
spec.validate_cocoapods_version
|
17
|
+
@specs_by_name[spec.name] = spec
|
22
18
|
end
|
23
19
|
@specs_by_name
|
24
20
|
end
|
@@ -104,7 +104,7 @@ module Pod
|
|
104
104
|
|
105
105
|
def update_git_repo(show_output = false)
|
106
106
|
Config.instance.with_changes(:verbose => show_output) do
|
107
|
-
git!(%W(-C #{repo} fetch origin))
|
107
|
+
git!(%W(-C #{repo} fetch origin #{show_output ? '--progress' : ''}))
|
108
108
|
current_branch = git!(%W(-C #{repo} rev-parse --abbrev-ref HEAD)).strip
|
109
109
|
git!(%W(-C #{repo} reset --hard origin/#{current_branch}))
|
110
110
|
end
|
@@ -9,7 +9,7 @@ module Pod
|
|
9
9
|
|
10
10
|
# Product types where the product's frameworks must be embedded in a host target
|
11
11
|
#
|
12
|
-
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :messages_extension, :watch_extension, :xpc_service].freeze
|
12
|
+
EMBED_FRAMEWORKS_IN_HOST_TARGET_TYPES = [:app_extension, :framework, :static_library, :messages_extension, :watch_extension, :xpc_service].freeze
|
13
13
|
|
14
14
|
# Initialize a new instance
|
15
15
|
#
|
@@ -27,6 +27,18 @@ module Pod
|
|
27
27
|
@xcconfigs = {}
|
28
28
|
end
|
29
29
|
|
30
|
+
# @return [Boolean] True if the user_target refers to a
|
31
|
+
# library (framework, static or dynamic lib).
|
32
|
+
#
|
33
|
+
def library?
|
34
|
+
# Without a user_project, we can't say for sure
|
35
|
+
# that this is a library
|
36
|
+
return false if user_project.nil?
|
37
|
+
symbol_types = user_targets.map(&:symbol_type).uniq
|
38
|
+
raise ArgumentError, "Expected single kind of user_target for #{name}. Found #{symbol_types.join(', ')}." unless symbol_types.count == 1
|
39
|
+
[:framework, :dynamic_library, :static_library].include? symbol_types.first
|
40
|
+
end
|
41
|
+
|
30
42
|
# @return [Boolean] True if the user_target's pods are
|
31
43
|
# for an extension and must be embedded in a host,
|
32
44
|
# target, otherwise false.
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -428,7 +428,8 @@ module Pod
|
|
428
428
|
add_xctest(app_target) if @installer.pod_targets.any? { |pt| pt.spec_consumers.any? { |c| c.frameworks.include?('XCTest') } }
|
429
429
|
app_project.save
|
430
430
|
Xcodeproj::XCScheme.share_scheme(app_project.path, 'App')
|
431
|
-
|
431
|
+
# Share the pods xcscheme only if it exists. For pre-built vendored pods there is no xcscheme generated.
|
432
|
+
Xcodeproj::XCScheme.share_scheme(@installer.pods_project.path, pod_target.label) if shares_pod_target_xcscheme?(pod_target)
|
432
433
|
end
|
433
434
|
|
434
435
|
def add_swift_version(app_target)
|
@@ -669,6 +670,10 @@ module Pod
|
|
669
670
|
add_result(:note, *args)
|
670
671
|
end
|
671
672
|
|
673
|
+
def shares_pod_target_xcscheme?(pod_target)
|
674
|
+
Pathname.new(@installer.pods_project.path + pod_target.label).exist?
|
675
|
+
end
|
676
|
+
|
672
677
|
def add_result(type, attribute_name, message, public_only = false)
|
673
678
|
result = results.find do |r|
|
674
679
|
r.type == type && r.attribute_name && r.message == message && r.public_only? == public_only
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cocoapods
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.1.
|
4
|
+
version: 1.2.1.rc.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eloy Duran
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2017-
|
14
|
+
date: 2017-04-05 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: cocoapods-core
|
@@ -19,14 +19,14 @@ dependencies:
|
|
19
19
|
requirements:
|
20
20
|
- - '='
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 1.2.1.
|
22
|
+
version: 1.2.1.rc.1
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - '='
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: 1.2.1.
|
29
|
+
version: 1.2.1.rc.1
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
31
|
name: claide
|
32
32
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,7 +207,7 @@ dependencies:
|
|
207
207
|
requirements:
|
208
208
|
- - ">="
|
209
209
|
- !ruby/object:Gem::Version
|
210
|
-
version: 1.4.
|
210
|
+
version: 1.4.3
|
211
211
|
- - "<"
|
212
212
|
- !ruby/object:Gem::Version
|
213
213
|
version: '2.0'
|
@@ -217,7 +217,7 @@ dependencies:
|
|
217
217
|
requirements:
|
218
218
|
- - ">="
|
219
219
|
- !ruby/object:Gem::Version
|
220
|
-
version: 1.4.
|
220
|
+
version: 1.4.3
|
221
221
|
- - "<"
|
222
222
|
- !ruby/object:Gem::Version
|
223
223
|
version: '2.0'
|
@@ -317,14 +317,14 @@ dependencies:
|
|
317
317
|
requirements:
|
318
318
|
- - "~>"
|
319
319
|
- !ruby/object:Gem::Version
|
320
|
-
version:
|
320
|
+
version: '1.1'
|
321
321
|
type: :runtime
|
322
322
|
prerelease: false
|
323
323
|
version_requirements: !ruby/object:Gem::Requirement
|
324
324
|
requirements:
|
325
325
|
- - "~>"
|
326
326
|
- !ruby/object:Gem::Version
|
327
|
-
version:
|
327
|
+
version: '1.1'
|
328
328
|
- !ruby/object:Gem::Dependency
|
329
329
|
name: bacon
|
330
330
|
requirement: !ruby/object:Gem::Requirement
|