cocoapods 0.34.1 → 0.34.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +68 -0
- data/lib/cocoapods/command/init.rb +2 -2
- data/lib/cocoapods/command/inter_process_communication.rb +1 -1
- data/lib/cocoapods/command/lib.rb +5 -2
- data/lib/cocoapods/command/outdated.rb +28 -4
- data/lib/cocoapods/command/repo.rb +1 -1
- data/lib/cocoapods/command/repo/push.rb +1 -1
- data/lib/cocoapods/command/spec.rb +5 -2
- data/lib/cocoapods/downloader.rb +5 -0
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/target_environment_header.rb +1 -1
- data/lib/cocoapods/installer.rb +2 -2
- data/lib/cocoapods/installer/analyzer.rb +5 -1
- data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +2 -0
- data/lib/cocoapods/installer/user_project_integrator.rb +5 -2
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +12 -4
- data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +30 -7
- data/lib/cocoapods/project.rb +1 -1
- data/lib/cocoapods/resolver.rb +17 -10
- data/lib/cocoapods/sources_manager.rb +34 -14
- data/lib/cocoapods/user_interface/error_report.rb +1 -1
- data/lib/cocoapods/validator.rb +17 -2
- 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: 03befb1a6d0cf06ee2e98b1481e48b0bb52a51bf
|
4
|
+
data.tar.gz: ab7cf2b6bae37b12bebca53f6fb40075d3d9c4c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3ab1e18fa19d113c2e6dad3e550da01e79fe806de57b7cf193e579b8cf11d68cccafb209af289f2f69705413652c504d6acd890e974387d31a64893e6879fb2
|
7
|
+
data.tar.gz: 00fc7c1ee370f63d52433411419640b26f32b69c2f98dafad30ae982d685048f72d6d4cd7631cb1dbf8cc8e04be8f042fbbae5cc16040255b0aff37ce769d536
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,74 @@
|
|
2
2
|
|
3
3
|
To install or update CocoaPods see this [guide](http://docs.cocoapods.org/guides/installing_cocoapods.html).
|
4
4
|
|
5
|
+
## 0.34.2
|
6
|
+
|
7
|
+
##### Enhancements
|
8
|
+
|
9
|
+
* Make the output of `pod outdated` show what running `pod update` will do.
|
10
|
+
Takes into account the sources specified in the `Podfile`.
|
11
|
+
[Samuel Giddins](https://github.com/segiddins)
|
12
|
+
[#2470](https://github.com/CocoaPods/CocoaPods/issues/2470)
|
13
|
+
|
14
|
+
* Allows the use of the `GCC_PREPROCESSOR_DEFINITION` flag `${inherited}`
|
15
|
+
without emitting a warning.
|
16
|
+
[Samuel Giddins](https://github.com/segiddins)
|
17
|
+
[#2577](https://github.com/CocoaPods/CocoaPods/issues/2577)
|
18
|
+
|
19
|
+
* Integration with user project will no longer replace an existing
|
20
|
+
base build configuration.
|
21
|
+
[Robert Jones](https://github.com/redshirtrob)
|
22
|
+
[#1736](https://github.com/CocoaPods/CocoaPods/issues/1736)
|
23
|
+
|
24
|
+
##### Bug Fixes
|
25
|
+
|
26
|
+
* Improved sanitizing of configuration names to avoid generating invalid
|
27
|
+
preprocessor definitions.
|
28
|
+
[Boris Bügling](https://github.com/neonichu)
|
29
|
+
[#2542](https://github.com/CocoaPods/CocoaPods/issues/2542)
|
30
|
+
|
31
|
+
* More robust generation of source names from URLs.
|
32
|
+
[Samuel Giddins](https://github.com/segiddins)
|
33
|
+
[#2534](https://github.com/CocoaPods/CocoaPods/issues/2534)
|
34
|
+
|
35
|
+
* Allow the `Validator` to only use specific sources.
|
36
|
+
Allows customizable source for `pod spec lint` and `pod lib lint`,
|
37
|
+
with both defaulting to `master`.
|
38
|
+
[Samuel Giddins](https://github.com/segiddins)
|
39
|
+
[#2543](https://github.com/CocoaPods/CocoaPods/issues/2543)
|
40
|
+
[cocoapods-trunk#28](https://github.com/CocoaPods/cocoapods-trunk/issues/28)
|
41
|
+
|
42
|
+
* Takes into account the sources specified in `Podfile` running
|
43
|
+
`pod outdated`.
|
44
|
+
[Samuel Giddins](https://github.com/segiddins)
|
45
|
+
[#2553](https://github.com/CocoaPods/CocoaPods/issues/2553)
|
46
|
+
|
47
|
+
* Ensures that the master repo is shallow cloned when added via a Podfile
|
48
|
+
`source` directive.
|
49
|
+
[Samuel Giddins](https://github.com/segiddins)
|
50
|
+
[#3586](https://github.com/CocoaPods/CocoaPods/issues/2586)
|
51
|
+
|
52
|
+
* Ensures that the user project is not saved when there are no
|
53
|
+
user targets integrated.
|
54
|
+
[Samuel Giddins](https://github.com/segiddins)
|
55
|
+
[#2561](https://github.com/CocoaPods/CocoaPods/issues/2561)
|
56
|
+
[#2593](https://github.com/CocoaPods/CocoaPods/issues/2593)
|
57
|
+
|
58
|
+
* Fix a crash when running `pod install` with an empty target that inherits a
|
59
|
+
pod from a parent target.
|
60
|
+
[Kyle Fuller](https://github.com/kylef)
|
61
|
+
[#2591](https://github.com/CocoaPods/CocoaPods/issues/2591)
|
62
|
+
|
63
|
+
* Take into account versions of a Pod from all specified sources when
|
64
|
+
resolving dependencies.
|
65
|
+
[Thomas Visser](https://github.com/Thomvis)
|
66
|
+
[#2556](https://github.com/CocoaPods/CocoaPods/issues/2556)
|
67
|
+
|
68
|
+
* Sanitize build configuration names in target environment header macros.
|
69
|
+
[Kra Larivain](https://github.com/olarivain)
|
70
|
+
[#2532](https://github.com/CocoaPods/CocoaPods/pull/2532)
|
71
|
+
|
72
|
+
|
5
73
|
## 0.34.1
|
6
74
|
|
7
75
|
##### Bug Fixes
|
@@ -57,7 +57,7 @@ module Pod
|
|
57
57
|
podfile << "xcodeproj '#{@project_path}'\n\n" if @project_path
|
58
58
|
podfile << <<-PLATFORM.strip_heredoc
|
59
59
|
# Uncomment this line to define a global platform for your project
|
60
|
-
# platform :ios,
|
60
|
+
# platform :ios, '6.0'
|
61
61
|
|
62
62
|
source '#{Command::Setup.read_only_url}'
|
63
63
|
PLATFORM
|
@@ -74,7 +74,7 @@ module Pod
|
|
74
74
|
# @return [String] the text for the target module
|
75
75
|
#
|
76
76
|
def target_module(target)
|
77
|
-
target_module = "\ntarget
|
77
|
+
target_module = "\ntarget '#{target.name}' do\n"
|
78
78
|
|
79
79
|
if target.name =~ /tests?/i
|
80
80
|
target_module << template_contents(config.default_test_podfile_path)
|
@@ -112,7 +112,9 @@ module Pod
|
|
112
112
|
['--only-errors', 'Lint validates even if warnings are present'],
|
113
113
|
['--subspec=NAME', 'Lint validates only the given subspec'],
|
114
114
|
['--no-subspecs', 'Lint skips validation of subspecs'],
|
115
|
-
['--no-clean', 'Lint leaves the build directory intact for inspection']
|
115
|
+
['--no-clean', 'Lint leaves the build directory intact for inspection'],
|
116
|
+
['--sources=https://github.com/artsy/Specs', 'The sources to pull dependant pods from ' \
|
117
|
+
'(defaults to https://github.com/CocoaPods/Specs.git)']].concat(super)
|
116
118
|
end
|
117
119
|
|
118
120
|
def initialize(argv)
|
@@ -121,6 +123,7 @@ module Pod
|
|
121
123
|
@clean = argv.flag?('clean', true)
|
122
124
|
@subspecs = argv.flag?('subspecs', true)
|
123
125
|
@only_subspec = argv.option('subspec')
|
126
|
+
@source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
|
124
127
|
@podspecs_paths = argv.arguments!
|
125
128
|
super
|
126
129
|
end
|
@@ -133,7 +136,7 @@ module Pod
|
|
133
136
|
UI.puts
|
134
137
|
podspecs_to_lint.each do |podspec|
|
135
138
|
|
136
|
-
validator = Validator.new(podspec)
|
139
|
+
validator = Validator.new(podspec, @source_urls)
|
137
140
|
validator.local = true
|
138
141
|
validator.quick = @quick
|
139
142
|
validator.no_clean = !@clean
|
@@ -27,8 +27,9 @@ module Pod
|
|
27
27
|
UI.puts 'No updates are available.'.yellow
|
28
28
|
else
|
29
29
|
UI.section 'The following updates are available:' do
|
30
|
-
updates.each do |(name, from_version, to_version)|
|
31
|
-
UI.puts "- #{name} #{from_version} -> #{
|
30
|
+
updates.each do |(name, from_version, matching_version, to_version)|
|
31
|
+
UI.puts "- #{name} #{from_version} -> #{matching_version} " \
|
32
|
+
"(latest version #{to_version})"
|
32
33
|
end
|
33
34
|
end
|
34
35
|
end
|
@@ -49,6 +50,13 @@ module Pod
|
|
49
50
|
|
50
51
|
private
|
51
52
|
|
53
|
+
def analyzer
|
54
|
+
@analyzer ||= begin
|
55
|
+
verify_podfile_exists!
|
56
|
+
Installer::Analyzer.new(config.sandbox, config.podfile, config.lockfile)
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
52
60
|
def updates
|
53
61
|
@updates ||= begin
|
54
62
|
spec_sets.map do |set|
|
@@ -57,7 +65,10 @@ module Pod
|
|
57
65
|
pod_name = spec.root.name
|
58
66
|
lockfile_version = lockfile.version(pod_name)
|
59
67
|
if source_version > lockfile_version
|
60
|
-
|
68
|
+
matching_spec = unlocked_pods.find { |s| s.name == pod_name }
|
69
|
+
matching_version =
|
70
|
+
matching_spec ? matching_spec.version : "(unused)"
|
71
|
+
[pod_name, lockfile_version, matching_version, source_version]
|
61
72
|
else
|
62
73
|
nil
|
63
74
|
end
|
@@ -65,6 +76,18 @@ module Pod
|
|
65
76
|
end
|
66
77
|
end
|
67
78
|
|
79
|
+
def unlocked_pods
|
80
|
+
@unlocked_pods ||= begin
|
81
|
+
pods = []
|
82
|
+
UI.titled_section('Analyzing dependencies') do
|
83
|
+
pods = Installer::Analyzer.new(config.sandbox, config.podfile).
|
84
|
+
analyze(false).
|
85
|
+
specs_by_target.values.flatten.uniq
|
86
|
+
end
|
87
|
+
pods
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
68
91
|
def deprecated_pods
|
69
92
|
@deprecated_pods ||= begin
|
70
93
|
spec_sets.map(&:specification).select do |spec|
|
@@ -75,8 +98,9 @@ module Pod
|
|
75
98
|
|
76
99
|
def spec_sets
|
77
100
|
@spec_sets ||= begin
|
101
|
+
aggregate = Source::Aggregate.new(analyzer.sources)
|
78
102
|
installed_pods.map do |pod_name|
|
79
|
-
|
103
|
+
aggregate.search(Dependency.new(pod_name))
|
80
104
|
end.compact.uniq
|
81
105
|
end
|
82
106
|
end
|
@@ -82,7 +82,7 @@ module Pod
|
|
82
82
|
def validate_podspec_files
|
83
83
|
UI.puts "\nValidating #{'spec'.pluralize(count)}".yellow
|
84
84
|
podspec_files.each do |podspec|
|
85
|
-
validator = Validator.new(podspec)
|
85
|
+
validator = Validator.new(podspec, SourcesManager.all.map(&:url))
|
86
86
|
validator.only_errors = @allow_warnings
|
87
87
|
begin
|
88
88
|
validator.validate
|
@@ -67,7 +67,9 @@ module Pod
|
|
67
67
|
['--only-errors', 'Lint validates even if warnings are present'],
|
68
68
|
['--subspec=NAME', 'Lint validates only the given subspec'],
|
69
69
|
['--no-subspecs', 'Lint skips validation of subspecs'],
|
70
|
-
['--no-clean', 'Lint leaves the build directory intact for inspection']
|
70
|
+
['--no-clean', 'Lint leaves the build directory intact for inspection'],
|
71
|
+
['--sources=https://github.com/artsy/Specs', 'The sources to pull dependant pods from ' \
|
72
|
+
'(defaults to https://github.com/CocoaPods/Specs.git)']].concat(super)
|
71
73
|
end
|
72
74
|
|
73
75
|
def initialize(argv)
|
@@ -76,6 +78,7 @@ module Pod
|
|
76
78
|
@clean = argv.flag?('clean', true)
|
77
79
|
@subspecs = argv.flag?('subspecs', true)
|
78
80
|
@only_subspec = argv.option('subspec')
|
81
|
+
@source_urls = argv.option('sources', 'https://github.com/CocoaPods/Specs.git').split(',')
|
79
82
|
@podspecs_paths = argv.arguments!
|
80
83
|
super
|
81
84
|
end
|
@@ -84,7 +87,7 @@ module Pod
|
|
84
87
|
UI.puts
|
85
88
|
invalid_count = 0
|
86
89
|
podspecs_to_lint.each do |podspec|
|
87
|
-
validator = Validator.new(podspec)
|
90
|
+
validator = Validator.new(podspec, @source_urls)
|
88
91
|
validator.quick = @quick
|
89
92
|
validator.no_clean = !@clean
|
90
93
|
validator.only_errors = @only_errors
|
data/lib/cocoapods/downloader.rb
CHANGED
@@ -1,12 +1,17 @@
|
|
1
1
|
require 'cocoapods-downloader'
|
2
|
+
require 'claide/informative_error'
|
2
3
|
|
3
4
|
module Pod
|
4
5
|
module Downloader
|
6
|
+
class DownloaderError; include CLAide::InformativeError; end
|
7
|
+
|
5
8
|
class Base
|
6
9
|
override_api do
|
7
10
|
|
8
11
|
def execute_command(executable, command, raise_on_failure = false)
|
9
12
|
Executable.execute_command(executable, command, raise_on_failure)
|
13
|
+
rescue CLAide::InformativeError => e
|
14
|
+
raise DownloaderError, e.message
|
10
15
|
end
|
11
16
|
|
12
17
|
# Indicates that an action will be performed. The action is passed as a
|
@@ -49,7 +49,7 @@ module Pod
|
|
49
49
|
specs_by_config = specs_scoped_by_configuration(common_specs, specs_by_configuration)
|
50
50
|
specs_by_config.each do |config, specs|
|
51
51
|
result << "// #{config} build configuration\n"
|
52
|
-
result << "#ifdef #{config.gsub(
|
52
|
+
result << "#ifdef #{config.gsub(/[^a-zA-Z0-9_]/, '_').upcase}\n\n"
|
53
53
|
specs.each { |spec| result << spec_defines(spec, 1) }
|
54
54
|
result << "#endif\n"
|
55
55
|
end
|
data/lib/cocoapods/installer.rb
CHANGED
@@ -402,13 +402,13 @@ module Pod
|
|
402
402
|
def install_libraries
|
403
403
|
UI.message '- Installing targets' do
|
404
404
|
pod_targets.sort_by(&:name).each do |pod_target|
|
405
|
-
next if pod_target.target_definition.empty?
|
405
|
+
next if pod_target.target_definition.dependencies.empty?
|
406
406
|
target_installer = PodTargetInstaller.new(sandbox, pod_target)
|
407
407
|
target_installer.install!
|
408
408
|
end
|
409
409
|
|
410
410
|
aggregate_targets.sort_by(&:name).each do |target|
|
411
|
-
next if target.target_definition.empty?
|
411
|
+
next if target.target_definition.dependencies.empty?
|
412
412
|
target_installer = AggregateTargetInstaller.new(sandbox, target)
|
413
413
|
target_installer.install!
|
414
414
|
end
|
@@ -359,7 +359,7 @@ module Pod
|
|
359
359
|
|
360
360
|
#-----------------------------------------------------------------------#
|
361
361
|
|
362
|
-
|
362
|
+
public
|
363
363
|
|
364
364
|
# Returns the sources used to query for specifications
|
365
365
|
#
|
@@ -388,6 +388,10 @@ module Pod
|
|
388
388
|
end
|
389
389
|
end
|
390
390
|
|
391
|
+
#-----------------------------------------------------------------------#
|
392
|
+
|
393
|
+
private
|
394
|
+
|
391
395
|
# @!group Analysis sub-steps
|
392
396
|
|
393
397
|
# Returns the path of the user project that the {TargetDefinition}
|
@@ -40,6 +40,8 @@ module Pod
|
|
40
40
|
#
|
41
41
|
attr_reader :update_mode
|
42
42
|
|
43
|
+
alias_method :update_mode?, :update_mode
|
44
|
+
|
43
45
|
# @return [Lockfile] The lockfile of the installation as a fall-back if
|
44
46
|
# there is no sandbox manifest. This is indented as a temporary
|
45
47
|
# solution to prevent the full re-installation from users which
|
@@ -132,6 +132,8 @@ module Pod
|
|
132
132
|
end
|
133
133
|
end
|
134
134
|
|
135
|
+
INHERITED_FLAGS = ['$(inherited)', '${inherited}']
|
136
|
+
|
135
137
|
# Checks whether the settings of the CocoaPods generated xcconfig are
|
136
138
|
# overridden by the build configuration of a target and prints a
|
137
139
|
# warning to inform the user if needed.
|
@@ -143,8 +145,9 @@ module Pod
|
|
143
145
|
xcconfig = aggregate_target.xcconfigs[config.name]
|
144
146
|
if xcconfig
|
145
147
|
xcconfig.to_hash.keys.each do |key|
|
146
|
-
|
147
|
-
if
|
148
|
+
target_values = config.build_settings[key]
|
149
|
+
if target_values &&
|
150
|
+
!INHERITED_FLAGS.any? { |flag| target_values.include?(flag) }
|
148
151
|
print_override_warning(aggregate_target, user_target, config, key)
|
149
152
|
end
|
150
153
|
end
|
@@ -27,15 +27,15 @@ module Pod
|
|
27
27
|
#
|
28
28
|
def integrate!
|
29
29
|
UI.section(integration_message) do
|
30
|
-
XCConfigIntegrator.integrate(target, native_targets)
|
31
|
-
update_to_cocoapods_0_34
|
30
|
+
user_project.save if XCConfigIntegrator.integrate(target, native_targets)
|
31
|
+
user_project.save if update_to_cocoapods_0_34
|
32
32
|
|
33
33
|
unless native_targets_to_integrate.empty?
|
34
34
|
add_pods_library
|
35
35
|
add_copy_resources_script_phase
|
36
36
|
add_check_manifest_lock_script_phase
|
37
|
+
user_project.save
|
37
38
|
end
|
38
|
-
user_project.save
|
39
39
|
end
|
40
40
|
end
|
41
41
|
|
@@ -52,6 +52,8 @@ module Pod
|
|
52
52
|
|
53
53
|
# Fixes the paths of the copy resource scripts.
|
54
54
|
#
|
55
|
+
# @return [Bool] whether any changes to the project were made.
|
56
|
+
#
|
55
57
|
# @todo This can be removed for CocoaPods 1.0
|
56
58
|
#
|
57
59
|
def update_to_cocoapods_0_34
|
@@ -62,9 +64,15 @@ module Pod
|
|
62
64
|
end.flatten
|
63
65
|
|
64
66
|
script_path = target.copy_resources_script_relative_path
|
67
|
+
shell_script = %("#{script_path}"\n)
|
68
|
+
changes = false
|
65
69
|
phases.each do |phase|
|
66
|
-
phase.shell_script
|
70
|
+
unless phase.shell_script == shell_script
|
71
|
+
phase.shell_script = shell_script
|
72
|
+
changes = true
|
73
|
+
end
|
67
74
|
end
|
75
|
+
changes
|
68
76
|
end
|
69
77
|
|
70
78
|
# Adds spec libraries to the frameworks build phase of the
|
data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb
CHANGED
@@ -15,13 +15,17 @@ module Pod
|
|
15
15
|
# The native targets associated which should be integrated
|
16
16
|
# with the Pod bundle.
|
17
17
|
#
|
18
|
+
# @return [Bool] whether any changes to the project were made.
|
19
|
+
#
|
18
20
|
def self.integrate(pod_bundle, targets)
|
21
|
+
changes = false
|
19
22
|
targets.each do |target|
|
20
23
|
target.build_configurations.each do |config|
|
21
|
-
update_to_cocoapods_0_34(pod_bundle, targets)
|
22
|
-
set_target_xcconfig(pod_bundle, config)
|
24
|
+
changes = true if update_to_cocoapods_0_34(pod_bundle, targets)
|
25
|
+
changes = true if set_target_xcconfig(pod_bundle, target, config)
|
23
26
|
end
|
24
27
|
end
|
28
|
+
changes
|
25
29
|
end
|
26
30
|
|
27
31
|
private
|
@@ -35,13 +39,16 @@ module Pod
|
|
35
39
|
# @param [Target::AggregateTarget] pod_bundle
|
36
40
|
# The Pods bundle.
|
37
41
|
#
|
38
|
-
# @param [XcodeProj::PBXNativeTarget]
|
42
|
+
# @param [Array<XcodeProj::PBXNativeTarget>] targets
|
39
43
|
# The native targets.
|
40
44
|
#
|
45
|
+
# @return [Bool] whether any changes to the project were made.
|
46
|
+
#
|
41
47
|
# @todo This can be removed for CocoaPods 1.0
|
42
48
|
#
|
43
49
|
def self.update_to_cocoapods_0_34(pod_bundle, targets)
|
44
50
|
sandbox = pod_bundle.sandbox
|
51
|
+
changes = false
|
45
52
|
targets.map(&:project).uniq.each do |project|
|
46
53
|
file_refs = project.files.select do |file_ref|
|
47
54
|
path = file_ref.path.to_s
|
@@ -57,7 +64,10 @@ module Pod
|
|
57
64
|
file_ref.remove_from_project
|
58
65
|
end
|
59
66
|
end
|
67
|
+
|
68
|
+
changes = true unless file_refs.empty?
|
60
69
|
end
|
70
|
+
changes
|
61
71
|
end
|
62
72
|
|
63
73
|
# Creates a file reference to the xcconfig generated by
|
@@ -67,15 +77,28 @@ module Pod
|
|
67
77
|
# @param [Target::AggregateTarget] pod_bundle
|
68
78
|
# The Pods bundle.
|
69
79
|
#
|
70
|
-
# @param [
|
80
|
+
# @param [PBXNativeTarget] target
|
81
|
+
# The native target.
|
82
|
+
#
|
83
|
+
# @param [Xcodeproj::XCBuildConfiguration] config
|
71
84
|
# The build configuration.
|
72
85
|
#
|
73
|
-
def self.set_target_xcconfig(pod_bundle, config)
|
86
|
+
def self.set_target_xcconfig(pod_bundle, target, config)
|
74
87
|
path = pod_bundle.xcconfig_relative_path(config.name)
|
75
88
|
group = config.project['Pods'] || config.project.new_group('Pods')
|
76
89
|
file_ref = group.files.find { |f| f.path == path }
|
77
|
-
|
78
|
-
|
90
|
+
if config.base_configuration_reference != file_ref
|
91
|
+
UI.warn 'CocoaPods did not set the base configuration of your ' \
|
92
|
+
'project because because your project already has a custom ' \
|
93
|
+
'config set. In order for CocoaPods integration to work at ' \
|
94
|
+
'all, please either set the base configurations of the target ' \
|
95
|
+
"#{target.name}` to `#{path}` or include the `#{path}` in your " \
|
96
|
+
'build configuration.'
|
97
|
+
false
|
98
|
+
elsif !file_ref
|
99
|
+
file_ref ||= group.new_file(path)
|
100
|
+
config.base_configuration_reference = file_ref
|
101
|
+
end
|
79
102
|
end
|
80
103
|
|
81
104
|
private
|
data/lib/cocoapods/project.rb
CHANGED
@@ -209,7 +209,7 @@ module Pod
|
|
209
209
|
#
|
210
210
|
def add_build_configuration(name, type)
|
211
211
|
build_configuration = super
|
212
|
-
values = ["#{name.gsub(
|
212
|
+
values = ["#{name.gsub(/[^a-zA-Z0-9_]/, '_').upcase}=1"]
|
213
213
|
settings = build_configuration.build_settings
|
214
214
|
definitions = Array(settings['GCC_PREPROCESSOR_DEFINITIONS'])
|
215
215
|
values.each do |value|
|
data/lib/cocoapods/resolver.rb
CHANGED
@@ -150,6 +150,11 @@ module Pod
|
|
150
150
|
set = find_cached_set(dependency, dependent_spec)
|
151
151
|
set.required_by(dependency, dependent_spec.to_s)
|
152
152
|
|
153
|
+
if (paths = set.specification_paths_for_version(set.required_version)).length > 1
|
154
|
+
UI.warn "Found multiple specifications for #{dependency}:\n" \
|
155
|
+
"- #{paths.join("\n")}"
|
156
|
+
end
|
157
|
+
|
153
158
|
unless @loaded_specs.include?(dependency.name)
|
154
159
|
spec = set.specification.subspec_by_name(dependency.name)
|
155
160
|
@loaded_specs << spec.name
|
@@ -190,7 +195,7 @@ module Pod
|
|
190
195
|
end
|
191
196
|
set = Specification::Set::External.new(spec)
|
192
197
|
else
|
193
|
-
set =
|
198
|
+
set = create_set_from_sources(dependency)
|
194
199
|
end
|
195
200
|
cached_sets[name] = set
|
196
201
|
unless set
|
@@ -201,19 +206,21 @@ module Pod
|
|
201
206
|
cached_sets[name]
|
202
207
|
end
|
203
208
|
|
204
|
-
# @return [Set]
|
205
|
-
# sources. The set will
|
206
|
-
#
|
209
|
+
# @return [Set] Creates a set for the Pod of the given dependency from the
|
210
|
+
# sources. The set will contain all versions from all sources that
|
211
|
+
# include the Pod.
|
207
212
|
#
|
208
213
|
# @param [Dependency] dependency
|
209
214
|
# The dependency for which the set is needed.
|
210
215
|
#
|
211
|
-
def
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
216
|
+
def create_set_from_sources(dependency)
|
217
|
+
aggregate.search(dependency)
|
218
|
+
end
|
219
|
+
|
220
|
+
# @return [Source::Aggregate] The aggregate of the {#sources}.
|
221
|
+
#
|
222
|
+
def aggregate
|
223
|
+
@aggregate ||= Source::Aggregate.new(sources.map(&:repo))
|
217
224
|
end
|
218
225
|
|
219
226
|
# Ensures that a specification is compatible with the platform of a target.
|
@@ -40,7 +40,9 @@ module Pod
|
|
40
40
|
previous_title_level = UI.title_level
|
41
41
|
UI.title_level = 0
|
42
42
|
begin
|
43
|
-
|
43
|
+
argv = [name, url]
|
44
|
+
argv << '--shallow' if name =~ /^master(-\d+)?$/
|
45
|
+
Command::Repo::Add.new(CLAide::ARGV.new(argv)).run
|
44
46
|
rescue Informative => e
|
45
47
|
raise Informative, "Unable to add a source with url `#{url}` " \
|
46
48
|
"named `#{name}`.\nYou can try adding it manually in " \
|
@@ -189,7 +191,7 @@ module Pod
|
|
189
191
|
|
190
192
|
sources.each do |source|
|
191
193
|
UI.section "Updating spec repo `#{source.name}`" do
|
192
|
-
Dir.chdir(source.
|
194
|
+
Dir.chdir(source.repo) do
|
193
195
|
begin
|
194
196
|
output = git!('pull --ff-only')
|
195
197
|
UI.puts output if show_output && !config.verbose?
|
@@ -200,7 +202,7 @@ module Pod
|
|
200
202
|
'`pod repo update --verbose`'
|
201
203
|
end
|
202
204
|
end
|
203
|
-
check_version_information(source.
|
205
|
+
check_version_information(source.repo)
|
204
206
|
end
|
205
207
|
end
|
206
208
|
end
|
@@ -242,11 +244,20 @@ module Pod
|
|
242
244
|
|
243
245
|
if config.new_version_message? && cocoapods_update?(versions)
|
244
246
|
last = versions['last']
|
247
|
+
rc = Gem::Version.new(last).prerelease?
|
245
248
|
install_message = needs_sudo ? 'sudo ' : ''
|
246
249
|
install_message << 'gem install cocoapods'
|
247
|
-
install_message << ' --pre' if
|
248
|
-
|
249
|
-
"
|
250
|
+
install_message << ' --pre' if rc
|
251
|
+
message = [
|
252
|
+
"CocoaPods #{versions['last']} is available.".green,
|
253
|
+
"To update use: `#{install_message}`".green,
|
254
|
+
("[!] This is a test version we'd love you to try.".yellow if rc),
|
255
|
+
'',
|
256
|
+
'For more information see http://blog.cocoapods.org'.green,
|
257
|
+
'and the CHANGELOG for this version http://git.io/BaH8pQ.'.green,
|
258
|
+
'',
|
259
|
+
].compact.join("\n")
|
260
|
+
UI.puts("\n#{message}\n")
|
250
261
|
end
|
251
262
|
end
|
252
263
|
|
@@ -348,7 +359,7 @@ module Pod
|
|
348
359
|
unless specified_source
|
349
360
|
raise Informative, "Unable to find the `#{name}` repo."
|
350
361
|
end
|
351
|
-
unless git_repo?(specified_source.
|
362
|
+
unless git_repo?(specified_source.repo)
|
352
363
|
raise Informative, "The `#{name}` repo is not a git repo."
|
353
364
|
end
|
354
365
|
specified_source
|
@@ -358,7 +369,7 @@ module Pod
|
|
358
369
|
#
|
359
370
|
def git_sources
|
360
371
|
all.select do |source|
|
361
|
-
git_repo?(source.
|
372
|
+
git_repo?(source.repo)
|
362
373
|
end
|
363
374
|
end
|
364
375
|
|
@@ -405,18 +416,27 @@ module Pod
|
|
405
416
|
# @return [String] A suitable repository name for `url`.
|
406
417
|
#
|
407
418
|
def name_for_url(url)
|
408
|
-
|
419
|
+
base_from_host_and_path = lambda do |host, path|
|
420
|
+
base = host.split('.')[-2] || host
|
421
|
+
base += '-' + path.gsub(/.git$/, '').gsub(/^\//, '').
|
422
|
+
split('/').join('-')
|
423
|
+
end
|
424
|
+
|
425
|
+
case url.to_s.downcase
|
409
426
|
when %r{github.com(:|/)cocoapods/specs}
|
410
427
|
base = 'master'
|
411
428
|
when %r{github.com(:|/)(.+)/(.+)}
|
412
429
|
base = Regexp.last_match[2]
|
413
|
-
|
414
|
-
raise Informative,
|
415
|
-
"`#{url}` is not a valid URL." unless url =~ URI.regexp
|
430
|
+
when URI.regexp
|
416
431
|
url = URI(url.downcase)
|
417
|
-
base = url.host.
|
418
|
-
|
432
|
+
base = base_from_host_and_path[url.host, url.path]
|
433
|
+
when %r{^\S+@(\S+)[:/](.+)$}
|
434
|
+
host, path = Regexp.last_match.captures
|
435
|
+
base = base_from_host_and_path[host, path]
|
436
|
+
else
|
437
|
+
base = url.to_s.downcase
|
419
438
|
end
|
439
|
+
|
420
440
|
name = base
|
421
441
|
infinity = 1.0 / 0
|
422
442
|
(1..infinity).each do |i|
|
@@ -121,7 +121,7 @@ EOS
|
|
121
121
|
def repo_information
|
122
122
|
SourcesManager.all.map do |source|
|
123
123
|
next unless source.type == 'file system'
|
124
|
-
repo = source.
|
124
|
+
repo = source.repo
|
125
125
|
Dir.chdir(repo) do
|
126
126
|
url = `git config --get remote.origin.url 2>&1`.strip
|
127
127
|
sha = `git rev-parse HEAD 2>&1`.strip
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -19,7 +19,11 @@ module Pod
|
|
19
19
|
# @param [Specification, Pathname, String] spec_or_path
|
20
20
|
# the Specification or the path of the `podspec` file to lint.
|
21
21
|
#
|
22
|
-
|
22
|
+
# @param [Array<String>] source_urls
|
23
|
+
# the Source URLs to use in creating a {Podfile}.
|
24
|
+
#
|
25
|
+
def initialize(spec_or_path, source_urls)
|
26
|
+
@source_urls = source_urls
|
23
27
|
@linter = Specification::Linter.new(spec_or_path)
|
24
28
|
end
|
25
29
|
|
@@ -332,7 +336,11 @@ module Pod
|
|
332
336
|
#
|
333
337
|
# For more details see https://github.com/CocoaPods/CocoaPods/issues/2394#issuecomment-56658587
|
334
338
|
#
|
335
|
-
if message.include?(
|
339
|
+
if message.include?("'InputFile' should have")
|
340
|
+
next
|
341
|
+
end
|
342
|
+
|
343
|
+
if message.include?('error: ')
|
336
344
|
error "[xcodebuild] #{message}"
|
337
345
|
else
|
338
346
|
note "[xcodebuild] #{message}"
|
@@ -408,6 +416,11 @@ module Pod
|
|
408
416
|
|
409
417
|
# !@group Helpers
|
410
418
|
|
419
|
+
# @return [Array<String>] an array of source URLs used to create the
|
420
|
+
# {Podfile} used in the linting process
|
421
|
+
#
|
422
|
+
attr_reader :source_urls
|
423
|
+
|
411
424
|
# @return [Podfile] a podfile that requires the specification on the
|
412
425
|
# current platform.
|
413
426
|
#
|
@@ -418,7 +431,9 @@ module Pod
|
|
418
431
|
name = subspec_name ? subspec_name : spec.name
|
419
432
|
podspec = file.realpath
|
420
433
|
local = local?
|
434
|
+
urls = source_urls
|
421
435
|
podfile = Pod::Podfile.new do
|
436
|
+
urls.each { |u| source(u) }
|
422
437
|
platform(platform_name, deployment_target)
|
423
438
|
if local
|
424
439
|
pod name, :path => podspec.dirname.to_s
|
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: 0.34.
|
4
|
+
version: 0.34.2
|
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: 2014-
|
12
|
+
date: 2014-10-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: cocoapods-core
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - '='
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: 0.34.
|
20
|
+
version: 0.34.2
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - '='
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: 0.34.
|
27
|
+
version: 0.34.2
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: claide
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -59,14 +59,14 @@ dependencies:
|
|
59
59
|
requirements:
|
60
60
|
- - ~>
|
61
61
|
- !ruby/object:Gem::Version
|
62
|
-
version: 0.7.
|
62
|
+
version: 0.7.2
|
63
63
|
type: :runtime
|
64
64
|
prerelease: false
|
65
65
|
version_requirements: !ruby/object:Gem::Requirement
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
68
68
|
- !ruby/object:Gem::Version
|
69
|
-
version: 0.7.
|
69
|
+
version: 0.7.2
|
70
70
|
- !ruby/object:Gem::Dependency
|
71
71
|
name: cocoapods-plugins
|
72
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -101,14 +101,14 @@ dependencies:
|
|
101
101
|
requirements:
|
102
102
|
- - ~>
|
103
103
|
- !ruby/object:Gem::Version
|
104
|
-
version: 0.
|
104
|
+
version: 0.3.0
|
105
105
|
type: :runtime
|
106
106
|
prerelease: false
|
107
107
|
version_requirements: !ruby/object:Gem::Requirement
|
108
108
|
requirements:
|
109
109
|
- - ~>
|
110
110
|
- !ruby/object:Gem::Version
|
111
|
-
version: 0.
|
111
|
+
version: 0.3.0
|
112
112
|
- !ruby/object:Gem::Dependency
|
113
113
|
name: colored
|
114
114
|
requirement: !ruby/object:Gem::Requirement
|