cocoapods 0.18.1 → 0.19.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +40 -0
- data/lib/cocoapods.rb +21 -21
- data/lib/cocoapods/command.rb +2 -0
- data/lib/cocoapods/command/help.rb +23 -0
- data/lib/cocoapods/command/outdated.rb +3 -1
- data/lib/cocoapods/command/podfile_info.rb +91 -0
- data/lib/cocoapods/config.rb +2 -1
- data/lib/cocoapods/external_sources.rb +14 -9
- data/lib/cocoapods/gem_version.rb +1 -1
- data/lib/cocoapods/generator/copy_resources_script.rb +2 -2
- data/lib/cocoapods/generator/dummy_source.rb +1 -0
- data/lib/cocoapods/generator/target_environment_header.rb +86 -0
- data/lib/cocoapods/generator/xcconfig.rb +1 -0
- data/lib/cocoapods/hooks/pod_representation.rb +1 -1
- data/lib/cocoapods/installer.rb +22 -5
- data/lib/cocoapods/installer/analyzer.rb +5 -6
- data/lib/cocoapods/installer/target_installer.rb +6 -6
- data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +1 -1
- data/lib/cocoapods/library.rb +2 -2
- data/lib/cocoapods/sandbox.rb +2 -0
- data/lib/cocoapods/sandbox/file_accessor.rb +4 -2
- data/lib/cocoapods/sources_manager.rb +33 -24
- data/lib/cocoapods/validator.rb +1 -1
- metadata +9 -7
- data/lib/cocoapods/generator/target_header.rb +0 -58
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9e460bfedda8d6e9df7398183867f5c605b1bbe2
|
4
|
+
data.tar.gz: 771269534428bde0e97b8f167f709a4013ad9e0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b5495d6f6d3e041470e7d8a09483faa989a97c8f2292f28bb237c5bd7c7a64aa176a995f2f7ad30774d5e12cca94c368e8bc53efc85cee2b095f947584fc2049
|
7
|
+
data.tar.gz: f34a4f956ed9bc12305259bc457f148de99b0bf4ba40d41252f98ebe6e75024ad9089ed152f86645c8469d3f6e82a33c3b3fceebcfc67fa11d6bc33911206bc1
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,43 @@
|
|
1
|
+
## 0.19.0
|
2
|
+
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.18.1...0.19.0)
|
3
|
+
• [cocoapods-core](https://github.com/CocoaPods/Core/compare/0.18.1...0.19.0)
|
4
|
+
|
5
|
+
###### Enhancements
|
6
|
+
|
7
|
+
* Added `pod podfile-info` command. Shows list of used Pods and their info
|
8
|
+
in a project or supplied Podfile.
|
9
|
+
Options: `--all` - with dependancies. `--md` - in Markdown.
|
10
|
+
[#855](https://github.com/CocoaPods/CocoaPods/issues/855)
|
11
|
+
* CocoaPods now defines the `COCOAPODS=1` macro in the Pod and the Client
|
12
|
+
targets. This is useful for libraries which conditionally expose interfaces.
|
13
|
+
[#903](https://github.com/CocoaPods/CocoaPods/issues/903)
|
14
|
+
* Compile time introspection. Macro definitions which allow to inspect the
|
15
|
+
installed Pods and their version have been introduced in the build
|
16
|
+
environment of the Pod libraries
|
17
|
+
([example](https://gist.github.com/irrationalfab/5348551)).
|
18
|
+
* CocoaPods now defines the deployment target of the Pods project computed as
|
19
|
+
the minimum deployment target of the Pods libraries.
|
20
|
+
[#556](https://github.com/CocoaPods/CocoaPods/issues/556)
|
21
|
+
* Added `pod help` command. You can still use the old format
|
22
|
+
with --help flag.
|
23
|
+
[#957](https://github.com/CocoaPods/CocoaPods/pull/957)
|
24
|
+
* Restored support for Podfiles named `CocoaPods.podfile`. Moreover, the
|
25
|
+
experimental YAML format of the Podfile now is associated with files named
|
26
|
+
`CocoaPods.podfile.yaml`.
|
27
|
+
[#1004](https://github.com/CocoaPods/CocoaPods/pull/1004)
|
28
|
+
|
29
|
+
###### Deprecations
|
30
|
+
|
31
|
+
* `:local` flag in Podfile is deprecated. Please use `:path` when
|
32
|
+
specifying a pod source.
|
33
|
+
[#971](https://github.com/CocoaPods/CocoaPods/issues/971)
|
34
|
+
###### Bug fixes
|
35
|
+
|
36
|
+
* Fix issue related to `pod outdated` and external sources.
|
37
|
+
[#954](https://github.com/CocoaPods/CocoaPods/issues/954)
|
38
|
+
* Fix issue with .svn folders in copy resources script.
|
39
|
+
[#972](https://github.com/CocoaPods/CocoaPods/issues/972)
|
40
|
+
|
1
41
|
## 0.18.1
|
2
42
|
[CocoaPods](https://github.com/CocoaPods/CocoaPods/compare/0.18.0...0.18.1)
|
3
43
|
• [cocoapods-core](https://github.com/CocoaPods/Core/compare/0.18.0...0.18.)
|
data/lib/cocoapods.rb
CHANGED
@@ -39,29 +39,29 @@ module Pod
|
|
39
39
|
#
|
40
40
|
STATISTICS_CACHE_FILE = CACHE_ROOT + 'statistics.yml'
|
41
41
|
|
42
|
-
autoload :Command,
|
43
|
-
autoload :Executable,
|
44
|
-
autoload :ExternalSources,
|
45
|
-
autoload :Installer,
|
46
|
-
autoload :SourcesManager,
|
47
|
-
autoload :Library,
|
48
|
-
autoload :Project,
|
49
|
-
autoload :Resolver,
|
50
|
-
autoload :Sandbox,
|
51
|
-
autoload :UI,
|
52
|
-
autoload :Validator,
|
42
|
+
autoload :Command, 'cocoapods/command'
|
43
|
+
autoload :Executable, 'cocoapods/executable'
|
44
|
+
autoload :ExternalSources, 'cocoapods/external_sources'
|
45
|
+
autoload :Installer, 'cocoapods/installer'
|
46
|
+
autoload :SourcesManager, 'cocoapods/sources_manager'
|
47
|
+
autoload :Library, 'cocoapods/library'
|
48
|
+
autoload :Project, 'cocoapods/project'
|
49
|
+
autoload :Resolver, 'cocoapods/resolver'
|
50
|
+
autoload :Sandbox, 'cocoapods/sandbox'
|
51
|
+
autoload :UI, 'cocoapods/user_interface'
|
52
|
+
autoload :Validator, 'cocoapods/validator'
|
53
53
|
|
54
54
|
module Generator
|
55
|
-
autoload :Acknowledgements,
|
56
|
-
autoload :BridgeSupport,
|
57
|
-
autoload :CopyResourcesScript,
|
58
|
-
autoload :Documentation,
|
59
|
-
autoload :DummySource,
|
60
|
-
autoload :Markdown,
|
61
|
-
autoload :Plist,
|
62
|
-
autoload :PrefixHeader,
|
63
|
-
autoload :
|
64
|
-
autoload :XCConfig,
|
55
|
+
autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
|
56
|
+
autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
|
57
|
+
autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
|
58
|
+
autoload :Documentation, 'cocoapods/generator/documentation'
|
59
|
+
autoload :DummySource, 'cocoapods/generator/dummy_source'
|
60
|
+
autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
|
61
|
+
autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
|
62
|
+
autoload :PrefixHeader, 'cocoapods/generator/prefix_header'
|
63
|
+
autoload :TargetEnvironmentHeader, 'cocoapods/generator/target_environment_header'
|
64
|
+
autoload :XCConfig, 'cocoapods/generator/xcconfig'
|
65
65
|
end
|
66
66
|
|
67
67
|
module Hooks
|
data/lib/cocoapods/command.rb
CHANGED
@@ -16,7 +16,9 @@ module Pod
|
|
16
16
|
require 'cocoapods/command/search'
|
17
17
|
require 'cocoapods/command/setup'
|
18
18
|
require 'cocoapods/command/spec'
|
19
|
+
require 'cocoapods/command/help'
|
19
20
|
require 'cocoapods/command/inter_process_communication'
|
21
|
+
require 'cocoapods/command/podfile_info'
|
20
22
|
|
21
23
|
self.abstract_command = true
|
22
24
|
self.command = 'pod'
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
class Help < Command
|
4
|
+
self.summary = 'Show help for the given command.'
|
5
|
+
self.arguments = '[COMMAND]'
|
6
|
+
|
7
|
+
def initialize(argv)
|
8
|
+
@help_command = Pod::Command.parse(argv) unless argv.empty?
|
9
|
+
super
|
10
|
+
end
|
11
|
+
|
12
|
+
def run
|
13
|
+
help_command.help!
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def help_command
|
19
|
+
@help_command || self
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
@@ -19,6 +19,7 @@ module Pod
|
|
19
19
|
|
20
20
|
# @todo the command report new dependencies added to the Podfile as
|
21
21
|
# updates.
|
22
|
+
#
|
22
23
|
# @todo fix.
|
23
24
|
#
|
24
25
|
def run
|
@@ -30,6 +31,7 @@ module Pod
|
|
30
31
|
updates = []
|
31
32
|
pods.each do |pod_name|
|
32
33
|
set = SourcesManager.search(Dependency.new(pod_name))
|
34
|
+
next unless set
|
33
35
|
source_version = set.versions.first
|
34
36
|
lockfile_version = lockfile.version(pod_name)
|
35
37
|
if source_version > lockfile_version
|
@@ -42,7 +44,7 @@ module Pod
|
|
42
44
|
else
|
43
45
|
UI.section "The following updates are available:" do
|
44
46
|
updates.each do |(name, from_version, to_version)|
|
45
|
-
UI.
|
47
|
+
UI.puts "- #{name} #{from_version} -> #{to_version}"
|
46
48
|
end
|
47
49
|
end
|
48
50
|
end
|
@@ -0,0 +1,91 @@
|
|
1
|
+
module Pod
|
2
|
+
class Command
|
3
|
+
|
4
|
+
class PodfileInfo < Command
|
5
|
+
|
6
|
+
self.summary = 'Shows information on installed Pods.'
|
7
|
+
self.description = <<-DESC
|
8
|
+
Shows information on installed Pods in current Project.
|
9
|
+
If optional `PODFILE_PATH` provided, the info will be shown for
|
10
|
+
that specific Podfile
|
11
|
+
DESC
|
12
|
+
self.arguments = '[PODFILE_PATH]'
|
13
|
+
|
14
|
+
def self.options
|
15
|
+
[
|
16
|
+
["--all", "Show information about all Pods with dependencies that are used in a project"],
|
17
|
+
["--md", "Output information in Markdown format"]
|
18
|
+
].concat(super)
|
19
|
+
end
|
20
|
+
|
21
|
+
def initialize(argv)
|
22
|
+
@info_all = argv.flag?('all')
|
23
|
+
@info_in_md = argv.flag?('md')
|
24
|
+
@podfile_path = argv.shift_argument
|
25
|
+
super
|
26
|
+
end
|
27
|
+
|
28
|
+
def run
|
29
|
+
use_podfile = (@podfile_path || !config.lockfile)
|
30
|
+
|
31
|
+
if !use_podfile
|
32
|
+
UI.puts "Using lockfile" if config.verbose?
|
33
|
+
verify_lockfile_exists!
|
34
|
+
lockfile = config.lockfile
|
35
|
+
pods = lockfile.pod_names
|
36
|
+
if @info_all
|
37
|
+
deps = lockfile.dependencies.map{|d| d.name}
|
38
|
+
pods = (deps + pods).uniq
|
39
|
+
end
|
40
|
+
elsif @podfile_path
|
41
|
+
podfile = Pod::Podfile.from_file(@podfile_path)
|
42
|
+
pods = pods_from_podfile(podfile)
|
43
|
+
else
|
44
|
+
verify_podfile_exists!
|
45
|
+
podfile = config.podfile
|
46
|
+
pods = pods_from_podfile(podfile)
|
47
|
+
end
|
48
|
+
|
49
|
+
UI.puts "\nPods used:\n".yellow unless @info_in_md
|
50
|
+
pods_info(pods, @info_in_md)
|
51
|
+
end
|
52
|
+
|
53
|
+
def pods_from_podfile(podfile)
|
54
|
+
pods = []
|
55
|
+
podfile.root_target_definitions.each {|e| h = e.to_hash; pods << h['dependencies'] if h['dependencies']}
|
56
|
+
pods.flatten!
|
57
|
+
pods.collect! {|pod| (pod.is_a?(Hash)) ? pod.keys.first : pod}
|
58
|
+
end
|
59
|
+
|
60
|
+
def pods_info_hash(pods, keys=[:name, :homepage, :summary])
|
61
|
+
pods_info = []
|
62
|
+
pods.each do |pod|
|
63
|
+
spec = (Pod::SourcesManager.search_by_name(pod).first rescue nil)
|
64
|
+
if spec
|
65
|
+
info = {}
|
66
|
+
keys.each { |k| info[k] = spec.specification.send(k) }
|
67
|
+
pods_info << info
|
68
|
+
else
|
69
|
+
|
70
|
+
end
|
71
|
+
|
72
|
+
end
|
73
|
+
pods_info
|
74
|
+
end
|
75
|
+
|
76
|
+
def pods_info(pods, in_md=false)
|
77
|
+
pods = pods_info_hash(pods, [:name, :homepage, :summary])
|
78
|
+
|
79
|
+
pods.each do |pod|
|
80
|
+
if in_md
|
81
|
+
UI.puts "* [#{pod[:name]}](#{pod[:homepage]}) - #{pod[:summary]}"
|
82
|
+
else
|
83
|
+
UI.puts "- #{pod[:name]} - #{pod[:summary]}"
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
|
90
|
+
end
|
91
|
+
end
|
data/lib/cocoapods/config.rb
CHANGED
@@ -188,7 +188,8 @@ module Pod
|
|
188
188
|
#
|
189
189
|
def podfile_path
|
190
190
|
unless @podfile_path
|
191
|
-
path = installation_root + '
|
191
|
+
path = installation_root + 'CocoaPods.podfile.yaml'
|
192
|
+
path = installation_root + 'CocoaPods.podfile' unless path.exist?
|
192
193
|
path = installation_root + 'Podfile' unless path.exist?
|
193
194
|
@podfile_path = path
|
194
195
|
end
|
@@ -13,11 +13,16 @@ module Pod
|
|
13
13
|
name = dependency.root_name
|
14
14
|
params = dependency.external_source
|
15
15
|
|
16
|
-
klass =
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
klass = if params.key?(:git) then GitSource
|
17
|
+
elsif params.key?(:svn) then SvnSource
|
18
|
+
elsif params.key?(:hg) then MercurialSource
|
19
|
+
elsif params.key?(:podspec) then PodspecSource
|
20
|
+
elsif params.key?(:path) then PathSource
|
21
|
+
end
|
22
|
+
|
23
|
+
if params.key?(:local)
|
24
|
+
klass = PathSource
|
25
|
+
UI.warn "The `:local` option of the Podfile has been renamed to `:path` and is deprecated." \
|
21
26
|
end
|
22
27
|
|
23
28
|
if klass
|
@@ -286,7 +291,7 @@ module Pod
|
|
286
291
|
|
287
292
|
# @!group Helpers
|
288
293
|
|
289
|
-
# @return [String] The uri of the podspec appending the name of the file
|
294
|
+
# @return [String] The uri of the podspec appending the name of the file
|
290
295
|
# and expanding it if necessary.
|
291
296
|
#
|
292
297
|
# @note If the declared path is expanded only if the represents a path
|
@@ -312,7 +317,7 @@ module Pod
|
|
312
317
|
#
|
313
318
|
# Works with the {LocalPod::LocalSourcedPod} class.
|
314
319
|
#
|
315
|
-
class
|
320
|
+
class PathSource < AbstractExternalSource
|
316
321
|
|
317
322
|
# @see AbstractExternalSource#fetch
|
318
323
|
#
|
@@ -327,7 +332,7 @@ module Pod
|
|
327
332
|
# @see AbstractExternalSource#description
|
328
333
|
#
|
329
334
|
def description
|
330
|
-
"from `#{params[:local]}`"
|
335
|
+
"from `#{params[:path] || params[:local]}`"
|
331
336
|
end
|
332
337
|
|
333
338
|
#--------------------------------------#
|
@@ -339,7 +344,7 @@ module Pod
|
|
339
344
|
# @return [Pathname] the path of the podspec.
|
340
345
|
#
|
341
346
|
def podspec_path
|
342
|
-
declared_path = params[:local].to_s
|
347
|
+
declared_path = (params[:path] || params[:local]).to_s
|
343
348
|
path_with_ext = File.extname(declared_path) == '.podspec' ? declared_path : "#{declared_path}/#{name}.podspec"
|
344
349
|
podfile_dir = File.dirname(podfile_path || '')
|
345
350
|
absolute_path = File.expand_path(path_with_ext, podfile_dir)
|
@@ -24,8 +24,8 @@ install_resource()
|
|
24
24
|
xcrun momc "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}/`basename $1 .xcdatamodeld`.momd"
|
25
25
|
;;
|
26
26
|
*)
|
27
|
-
echo "
|
28
|
-
|
27
|
+
echo "rsync -av --exclude '*/.svn/*' ${PODS_ROOT}/$1 ${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
28
|
+
rsync -av --exclude '*/.svn/*' "${PODS_ROOT}/$1" "${CONFIGURATION_BUILD_DIR}/${UNLOCALIZED_RESOURCES_FOLDER_PATH}"
|
29
29
|
;;
|
30
30
|
esac
|
31
31
|
}
|
@@ -0,0 +1,86 @@
|
|
1
|
+
module Pod
|
2
|
+
module Generator
|
3
|
+
|
4
|
+
# Generates a header which allows to inspect at compile time the installed
|
5
|
+
# pods and the installed specifications of a pod.
|
6
|
+
#
|
7
|
+
# Example output:
|
8
|
+
#
|
9
|
+
# #define COCOAPODS_POD_AVAILABLE_ObjectiveSugar 1
|
10
|
+
# #define COCOAPODS_VERSION_MAJOR_ObjectiveSugar 0
|
11
|
+
# #define COCOAPODS_VERSION_MINOR_ObjectiveSugar 6
|
12
|
+
# #define COCOAPODS_VERSION_PATCH_ObjectiveSugar 2
|
13
|
+
#
|
14
|
+
# Example usage:
|
15
|
+
#
|
16
|
+
# #ifdef COCOAPODS
|
17
|
+
# #ifdef COCOAPODS_POD_AVAILABLE_ObjectiveSugar
|
18
|
+
# #import "ObjectiveSugar.h"
|
19
|
+
# #endif
|
20
|
+
# #else
|
21
|
+
# // Non CocoaPods code
|
22
|
+
# #endif
|
23
|
+
#
|
24
|
+
class TargetEnvironmentHeader
|
25
|
+
|
26
|
+
# @return [Array<LocalPod>] the specifications installed for the target.
|
27
|
+
#
|
28
|
+
attr_reader :specs
|
29
|
+
|
30
|
+
# @param [Array<LocalPod>] pods @see pods
|
31
|
+
#
|
32
|
+
def initialize(specs)
|
33
|
+
@specs = specs
|
34
|
+
end
|
35
|
+
|
36
|
+
# Generates and saves the file.
|
37
|
+
#
|
38
|
+
# @param [Pathname] pathname
|
39
|
+
# The path where to save the generated file.
|
40
|
+
#
|
41
|
+
# @return [void]
|
42
|
+
#
|
43
|
+
def save_as(pathname)
|
44
|
+
pathname.open('w') do |source|
|
45
|
+
source.puts
|
46
|
+
source.puts "// To check if a library is compiled with CocoaPods you"
|
47
|
+
source.puts "// can use the `COCOAPODS` macro definition which is"
|
48
|
+
source.puts "// defined in the xcconfigs so it is available in"
|
49
|
+
source.puts "// headers also when they are imported in the client"
|
50
|
+
source.puts "// project."
|
51
|
+
source.puts
|
52
|
+
source.puts
|
53
|
+
specs.each do |spec|
|
54
|
+
spec_name = safe_spec_name(spec.name)
|
55
|
+
source.puts "// #{spec.name}"
|
56
|
+
source.puts "#define COCOAPODS_POD_AVAILABLE_#{spec_name}"
|
57
|
+
if spec.version.semantic?
|
58
|
+
source.puts "#define COCOAPODS_VERSION_MAJOR_#{spec_name} #{spec.version.major}"
|
59
|
+
source.puts "#define COCOAPODS_VERSION_MINOR_#{spec_name} #{spec.version.minor}"
|
60
|
+
source.puts "#define COCOAPODS_VERSION_PATCH_#{spec_name} #{spec.version.patch}"
|
61
|
+
else
|
62
|
+
source.puts "// This library does not follow semantic-versioning,"
|
63
|
+
source.puts "// so we were not able to define version macros."
|
64
|
+
source.puts "// Please contact the author."
|
65
|
+
source.puts "// Version: #{spec.version}."
|
66
|
+
end
|
67
|
+
source.puts
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
72
|
+
#-----------------------------------------------------------------------#
|
73
|
+
|
74
|
+
private
|
75
|
+
|
76
|
+
# !@group Private Helpers
|
77
|
+
|
78
|
+
def safe_spec_name(spec_name)
|
79
|
+
spec_name.gsub(/[^\w]/,'_')
|
80
|
+
end
|
81
|
+
|
82
|
+
#-----------------------------------------------------------------------#
|
83
|
+
|
84
|
+
end
|
85
|
+
end
|
86
|
+
end
|
@@ -58,6 +58,7 @@ module Pod
|
|
58
58
|
'PODS_HEADERS_SEARCH_PATHS' => '${PODS_PUBLIC_HEADERS_SEARCH_PATHS}',
|
59
59
|
'PODS_BUILD_HEADERS_SEARCH_PATHS' => quote(sandbox.build_headers.search_paths),
|
60
60
|
'PODS_PUBLIC_HEADERS_SEARCH_PATHS' => quote(sandbox.public_headers.search_paths),
|
61
|
+
'GCC_PREPROCESSOR_DEFINITIONS' => 'COCOAPODS=1'
|
61
62
|
})
|
62
63
|
|
63
64
|
spec_consumers.each do |consumer|
|
@@ -2,7 +2,7 @@ module Pod
|
|
2
2
|
|
3
3
|
class Specification
|
4
4
|
def config
|
5
|
-
UI.warn "Specification#config is deprecated. The config is accessible from " \
|
5
|
+
UI.warn "[#{name}] Specification#config is deprecated. The config is accessible from " \
|
6
6
|
"the parameter passed to the hooks"
|
7
7
|
Config.instance
|
8
8
|
end
|
data/lib/cocoapods/installer.rb
CHANGED
@@ -55,9 +55,9 @@ module Pod
|
|
55
55
|
# @param [Lockfile] lockfile @see lockfile
|
56
56
|
#
|
57
57
|
def initialize(sandbox, podfile, lockfile = nil)
|
58
|
-
@sandbox =
|
59
|
-
@podfile =
|
60
|
-
@lockfile =
|
58
|
+
@sandbox = sandbox
|
59
|
+
@podfile = podfile
|
60
|
+
@lockfile = lockfile
|
61
61
|
end
|
62
62
|
|
63
63
|
# @return [Bool] Whether the installer is in update mode. In update mode
|
@@ -151,7 +151,17 @@ module Pod
|
|
151
151
|
|
152
152
|
# @return [void]
|
153
153
|
#
|
154
|
+
# @note The warning about the version of the Lockfile doesn't uses the
|
155
|
+
# `UI.warn` method because it prints the output only at the end
|
156
|
+
# of the installation. At that time CocoaPods could have crashed.
|
157
|
+
#
|
154
158
|
def analyze
|
159
|
+
if lockfile && lockfile.cocoapods_version > Version.new(VERSION)
|
160
|
+
STDERR.puts '[!] The version of CocoaPods used to generate the lockfile is '\
|
161
|
+
'higher that the one of the current executable. Incompatibility' \
|
162
|
+
'issues might arise.'.yellow
|
163
|
+
end
|
164
|
+
|
155
165
|
analyzer = Analyzer.new(sandbox, podfile, lockfile)
|
156
166
|
analyzer.update_mode = update_mode
|
157
167
|
@analysis_result = analyzer.analyze
|
@@ -276,6 +286,13 @@ module Pod
|
|
276
286
|
@pods_project.add_podfile(config.podfile_path)
|
277
287
|
end
|
278
288
|
sandbox.project = @pods_project
|
289
|
+
platforms = libraries.map(&:platform)
|
290
|
+
osx_deployment_target = platforms.select { |p| p.name == :osx }.map(&:deployment_target).min
|
291
|
+
ios_deployment_target = platforms.select { |p| p.name == :ios }.map(&:deployment_target).min
|
292
|
+
@pods_project.build_configurations.each do |build_configuration|
|
293
|
+
build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = osx_deployment_target.to_s if osx_deployment_target
|
294
|
+
build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ios_deployment_target.to_s if ios_deployment_target
|
295
|
+
end
|
279
296
|
end
|
280
297
|
end
|
281
298
|
|
@@ -372,7 +389,7 @@ module Pod
|
|
372
389
|
executed = false
|
373
390
|
libraries_using_spec(spec).each do |lib|
|
374
391
|
lib_representation = library_rep(lib)
|
375
|
-
executed
|
392
|
+
executed |= run_spec_pre_install_hook(spec, lib_representation)
|
376
393
|
end
|
377
394
|
UI.message "- #{spec.name}" if executed
|
378
395
|
end
|
@@ -431,7 +448,7 @@ module Pod
|
|
431
448
|
executed = false
|
432
449
|
libraries_using_spec(spec).each do |lib|
|
433
450
|
lib_representation = library_rep(lib)
|
434
|
-
executed
|
451
|
+
executed |= run_spec_post_install_hook(spec, lib_representation)
|
435
452
|
end
|
436
453
|
UI.message "- #{spec.name}" if executed
|
437
454
|
end
|
@@ -170,9 +170,9 @@ module Pod
|
|
170
170
|
#
|
171
171
|
def generated_libraries
|
172
172
|
libraries = []
|
173
|
-
podfile.
|
174
|
-
lib
|
175
|
-
lib.support_files_root
|
173
|
+
podfile.target_definition_list.each do |target_definition|
|
174
|
+
lib = Library.new(target_definition)
|
175
|
+
lib.support_files_root = sandbox.library_support_files_dir(lib.name)
|
176
176
|
|
177
177
|
if config.integrate_targets?
|
178
178
|
project_path = compute_user_project_path(target_definition)
|
@@ -248,7 +248,7 @@ module Pod
|
|
248
248
|
pods_to_fetch = result.podfile_state.added + result.podfile_state.changed
|
249
249
|
deps_to_fetch = deps_with_external_source.select { |dep| pods_to_fetch.include?(dep.root_name) }
|
250
250
|
deps_to_fetch_if_needed = deps_with_external_source.select { |dep| result.podfile_state.unchanged.include?(dep.root_name) }
|
251
|
-
deps_to_fetch += deps_to_fetch_if_needed.select { |dep| sandbox.specification(dep.root_name).nil? || !dep.external_source[:local].nil? }
|
251
|
+
deps_to_fetch += deps_to_fetch_if_needed.select { |dep| sandbox.specification(dep.root_name).nil? || !dep.external_source[:local].nil? || !dep.external_source[:path].nil? }
|
252
252
|
end
|
253
253
|
|
254
254
|
unless deps_to_fetch.empty?
|
@@ -446,8 +446,7 @@ module Pod
|
|
446
446
|
end
|
447
447
|
|
448
448
|
target_definition.set_platform(name, deployment_target)
|
449
|
-
|
450
|
-
platform
|
449
|
+
Platform.new(name, deployment_target)
|
451
450
|
end
|
452
451
|
|
453
452
|
#-----------------------------------------------------------------------#
|
@@ -35,7 +35,7 @@ module Pod
|
|
35
35
|
create_suport_files_group
|
36
36
|
|
37
37
|
create_xcconfig_file
|
38
|
-
|
38
|
+
create_target_environment_header
|
39
39
|
create_prefix_header
|
40
40
|
create_bridge_support_file
|
41
41
|
create_copy_resources_script
|
@@ -158,10 +158,10 @@ module Pod
|
|
158
158
|
# Generates a header which allows to inspect at compile time the installed
|
159
159
|
# pods and the installed specifications of a pod.
|
160
160
|
#
|
161
|
-
def
|
162
|
-
path = library.
|
163
|
-
UI.message "- Generating target header at #{UI.path(path)}" do
|
164
|
-
generator = Generator::
|
161
|
+
def create_target_environment_header
|
162
|
+
path = library.target_environment_header_path
|
163
|
+
UI.message "- Generating target environment header at #{UI.path(path)}" do
|
164
|
+
generator = Generator::TargetEnvironmentHeader.new(library.specs)
|
165
165
|
generator.save_as(path)
|
166
166
|
add_file_to_support_group(path)
|
167
167
|
end
|
@@ -177,7 +177,7 @@ module Pod
|
|
177
177
|
path = library.prefix_header_path
|
178
178
|
UI.message "- Generating prefix header at #{UI.path(path)}" do
|
179
179
|
generator = Generator::PrefixHeader.new(library.file_accessors, library.platform)
|
180
|
-
generator.imports << library.
|
180
|
+
generator.imports << library.target_environment_header_path.basename
|
181
181
|
generator.save_as(path)
|
182
182
|
add_file_to_support_group(path)
|
183
183
|
|
@@ -152,7 +152,7 @@ module Pod
|
|
152
152
|
diff "${PODS_ROOT}/../Podfile.lock" "${PODS_ROOT}/Manifest.lock" > /dev/null
|
153
153
|
if [[ $? != 0 ]] ; then
|
154
154
|
cat << EOM
|
155
|
-
error: The
|
155
|
+
error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.
|
156
156
|
EOM
|
157
157
|
exit 1
|
158
158
|
fi
|
data/lib/cocoapods/library.rb
CHANGED
@@ -127,8 +127,8 @@ module Pod
|
|
127
127
|
# @return [Pathname] the absolute path of the header file which contains
|
128
128
|
# the information about the installed pods.
|
129
129
|
#
|
130
|
-
def
|
131
|
-
support_files_root + "#{label}-
|
130
|
+
def target_environment_header_path
|
131
|
+
support_files_root + "#{label}-environment.h"
|
132
132
|
end
|
133
133
|
|
134
134
|
# @return [Pathname] the absolute path of the prefix header file.
|
data/lib/cocoapods/sandbox.rb
CHANGED
@@ -320,6 +320,8 @@ module Pod
|
|
320
320
|
# @return [Hash{String=>String}] The path of the Pods with a local source
|
321
321
|
# grouped by their name.
|
322
322
|
#
|
323
|
+
# @todo Rename (e.g. `pods_with_local_path`)
|
324
|
+
#
|
323
325
|
attr_reader :local_pods
|
324
326
|
|
325
327
|
# Checks if a Pod is locally sourced?
|
@@ -80,11 +80,13 @@ module Pod
|
|
80
80
|
#
|
81
81
|
def public_headers
|
82
82
|
public_headers = paths_for_attribute(:public_header_files)
|
83
|
+
private_headers = paths_for_attribute(:private_header_files)
|
83
84
|
if public_headers.nil? || public_headers.empty?
|
84
|
-
headers
|
85
|
+
header_files = headers
|
85
86
|
else
|
86
|
-
public_headers
|
87
|
+
header_files = public_headers
|
87
88
|
end
|
89
|
+
header_files - private_headers
|
88
90
|
end
|
89
91
|
|
90
92
|
# @return [Hash{ Symbol => Array<Pathname> }] the resources of the
|
@@ -38,11 +38,7 @@ module Pod
|
|
38
38
|
# @raise If no source including the set can be found.
|
39
39
|
#
|
40
40
|
def search(dependency)
|
41
|
-
|
42
|
-
unless set
|
43
|
-
raise Informative, "Unable to find a pod named `#{dependency.name}`"
|
44
|
-
end
|
45
|
-
set
|
41
|
+
aggregate.search(dependency)
|
46
42
|
end
|
47
43
|
|
48
44
|
# Search all the sources with the given search term.
|
@@ -63,18 +59,21 @@ module Pod
|
|
63
59
|
# @return [Array<Set>] The sets that contain the search term.
|
64
60
|
#
|
65
61
|
def search_by_name(query, full_text_search = false)
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
62
|
+
if full_text_search
|
63
|
+
set_names = []
|
64
|
+
updated_search_index.each do |name, set_data|
|
65
|
+
text = name.dup
|
66
|
+
if full_text_search
|
67
|
+
text << set_data['authors'].to_s if set_data['authors']
|
68
|
+
text << set_data['summary'] if set_data['summary']
|
69
|
+
text << set_data['description'] if set_data['description']
|
70
|
+
end
|
71
|
+
set_names << name if text.downcase.include?(query.downcase)
|
73
72
|
end
|
74
|
-
set_names
|
73
|
+
sets = set_names.sort.map { |name| aggregate.represenative_set(name) }
|
74
|
+
else
|
75
|
+
sets = aggregate.search_by_name(query, false)
|
75
76
|
end
|
76
|
-
|
77
|
-
sets = set_names.sort.map { |name| aggregate.represenative_set(name) }
|
78
77
|
if sets.empty?
|
79
78
|
extra = ", author, summary, or description" if full_text_search
|
80
79
|
raise Informative, "Unable to find a pod with name#{extra} matching `#{query}`"
|
@@ -90,24 +89,34 @@ module Pod
|
|
90
89
|
# - description
|
91
90
|
# - authors
|
92
91
|
#
|
92
|
+
# @note This operation is fairly expensive, because of the YAML
|
93
|
+
# conversion.
|
94
|
+
#
|
93
95
|
# @return [Hash{String => String}] The up to date search data.
|
94
96
|
#
|
95
97
|
def updated_search_index
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
98
|
+
unless @updated_search_index
|
99
|
+
if search_index_path.exist?
|
100
|
+
stored_index = YAML.load(search_index_path.read)
|
101
|
+
if stored_index && stored_index.is_a?(Hash)
|
102
|
+
search_index = aggregate.update_search_index(stored_index)
|
103
|
+
else
|
104
|
+
search_index = aggregate.generate_search_index
|
105
|
+
end
|
100
106
|
else
|
101
107
|
search_index = aggregate.generate_search_index
|
102
108
|
end
|
103
|
-
else
|
104
|
-
search_index = aggregate.generate_search_index
|
105
|
-
end
|
106
109
|
|
107
|
-
|
108
|
-
|
110
|
+
File.open(search_index_path, 'w') {|f| f.write(search_index.to_yaml) }
|
111
|
+
@updated_search_index = search_index
|
112
|
+
end
|
113
|
+
@updated_search_index
|
109
114
|
end
|
110
115
|
|
116
|
+
# Allows to clear the search index.
|
117
|
+
#
|
118
|
+
attr_writer :updated_search_index
|
119
|
+
|
111
120
|
# @return [Pathname] The path where the search index should be stored.
|
112
121
|
#
|
113
122
|
def search_index_path
|
data/lib/cocoapods/validator.rb
CHANGED
@@ -106,7 +106,7 @@ module Pod
|
|
106
106
|
# @return [Bool] whether the validation should be performed against the root of
|
107
107
|
# the podspec instead to its original source.
|
108
108
|
#
|
109
|
-
# @note Uses the `:
|
109
|
+
# @note Uses the `:path` option of the Podfile.
|
110
110
|
#
|
111
111
|
attr_writer :local
|
112
112
|
def local?; @local; end
|
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.
|
4
|
+
version: 0.19.0
|
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: 2013-04-
|
12
|
+
date: 2013-04-30 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.
|
20
|
+
version: 0.19.0
|
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.
|
27
|
+
version: 0.19.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: claide
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -207,9 +207,11 @@ executables:
|
|
207
207
|
extensions: []
|
208
208
|
extra_rdoc_files: []
|
209
209
|
files:
|
210
|
+
- lib/cocoapods/command/help.rb
|
210
211
|
- lib/cocoapods/command/inter_process_communication.rb
|
211
212
|
- lib/cocoapods/command/list.rb
|
212
213
|
- lib/cocoapods/command/outdated.rb
|
214
|
+
- lib/cocoapods/command/podfile_info.rb
|
213
215
|
- lib/cocoapods/command/project.rb
|
214
216
|
- lib/cocoapods/command/push.rb
|
215
217
|
- lib/cocoapods/command/repo.rb
|
@@ -231,7 +233,7 @@ files:
|
|
231
233
|
- lib/cocoapods/generator/documentation.rb
|
232
234
|
- lib/cocoapods/generator/dummy_source.rb
|
233
235
|
- lib/cocoapods/generator/prefix_header.rb
|
234
|
-
- lib/cocoapods/generator/
|
236
|
+
- lib/cocoapods/generator/target_environment_header.rb
|
235
237
|
- lib/cocoapods/generator/xcconfig.rb
|
236
238
|
- lib/cocoapods/hooks/installer_representation.rb
|
237
239
|
- lib/cocoapods/hooks/library_representation.rb
|
@@ -273,7 +275,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
273
275
|
requirements:
|
274
276
|
- - '>='
|
275
277
|
- !ruby/object:Gem::Version
|
276
|
-
version:
|
278
|
+
version: 1.8.7
|
277
279
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
278
280
|
requirements:
|
279
281
|
- - '>='
|
@@ -281,7 +283,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
281
283
|
version: '0'
|
282
284
|
requirements: []
|
283
285
|
rubyforge_project:
|
284
|
-
rubygems_version: 2.0.
|
286
|
+
rubygems_version: 2.0.3
|
285
287
|
signing_key:
|
286
288
|
specification_version: 3
|
287
289
|
summary: An Objective-C library package manager.
|
@@ -1,58 +0,0 @@
|
|
1
|
-
module Pod
|
2
|
-
module Generator
|
3
|
-
|
4
|
-
# Generates a header which allows to inspect at compile time the installed
|
5
|
-
# pods and the installed specifications of a pod.
|
6
|
-
#
|
7
|
-
# Example output:
|
8
|
-
#
|
9
|
-
# #define __COCOA_PODS
|
10
|
-
#
|
11
|
-
# #define __POD_AFIncrementaStore
|
12
|
-
# #define __POD_AFNetworking
|
13
|
-
# #define __POD_libextobjc_EXTConcreteProtocol
|
14
|
-
# #define __POD_libextobjc_EXTKeyPathCoding
|
15
|
-
# #define __POD_libextobjc_EXTScope
|
16
|
-
#
|
17
|
-
# Example usage:
|
18
|
-
#
|
19
|
-
# #ifdef __COCOA_PODS
|
20
|
-
# #ifdef __POD__AFNetworking
|
21
|
-
# #import "MYLib+AFNetworking.h"
|
22
|
-
# #endif
|
23
|
-
# #else
|
24
|
-
# // Non CocoaPods code
|
25
|
-
# #endif
|
26
|
-
#
|
27
|
-
class TargetHeader
|
28
|
-
|
29
|
-
# @return [Array<LocalPod>] the specifications installed for the target.
|
30
|
-
#
|
31
|
-
attr_reader :specs
|
32
|
-
|
33
|
-
# @param [Array<LocalPod>] pods @see pods
|
34
|
-
#
|
35
|
-
def initialize(specs)
|
36
|
-
@specs = specs
|
37
|
-
end
|
38
|
-
|
39
|
-
# Generates and saves the file.
|
40
|
-
#
|
41
|
-
# @param [Pathname] pathname
|
42
|
-
# The path where to save the generated file.
|
43
|
-
#
|
44
|
-
# @return [void]
|
45
|
-
#
|
46
|
-
def save_as(pathname)
|
47
|
-
pathname.open('w') do |source|
|
48
|
-
source.puts "// WARNING: This feature of CocoaPods is present for discussion purposes and might be discontinued or changed in future"
|
49
|
-
source.puts "#define __COCOA_PODS"
|
50
|
-
source.puts
|
51
|
-
specs.each do |specs|
|
52
|
-
source.puts "#define __POD_#{specs.name.gsub(/[^\w]/,'_')}"
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|
56
|
-
end
|
57
|
-
end
|
58
|
-
end
|