xcocoapods 1.5.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (124) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +6303 -0
  3. data/LICENSE +28 -0
  4. data/README.md +80 -0
  5. data/bin/pod +56 -0
  6. data/bin/sandbox-pod +168 -0
  7. data/lib/cocoapods.rb +73 -0
  8. data/lib/cocoapods/command.rb +175 -0
  9. data/lib/cocoapods/command/cache.rb +28 -0
  10. data/lib/cocoapods/command/cache/clean.rb +90 -0
  11. data/lib/cocoapods/command/cache/list.rb +69 -0
  12. data/lib/cocoapods/command/env.rb +66 -0
  13. data/lib/cocoapods/command/init.rb +128 -0
  14. data/lib/cocoapods/command/install.rb +45 -0
  15. data/lib/cocoapods/command/ipc.rb +19 -0
  16. data/lib/cocoapods/command/ipc/list.rb +40 -0
  17. data/lib/cocoapods/command/ipc/podfile.rb +31 -0
  18. data/lib/cocoapods/command/ipc/podfile_json.rb +30 -0
  19. data/lib/cocoapods/command/ipc/repl.rb +51 -0
  20. data/lib/cocoapods/command/ipc/spec.rb +29 -0
  21. data/lib/cocoapods/command/ipc/update_search_index.rb +24 -0
  22. data/lib/cocoapods/command/lib.rb +11 -0
  23. data/lib/cocoapods/command/lib/create.rb +105 -0
  24. data/lib/cocoapods/command/lib/lint.rb +121 -0
  25. data/lib/cocoapods/command/list.rb +39 -0
  26. data/lib/cocoapods/command/options/project_directory.rb +36 -0
  27. data/lib/cocoapods/command/options/repo_update.rb +34 -0
  28. data/lib/cocoapods/command/outdated.rb +140 -0
  29. data/lib/cocoapods/command/repo.rb +29 -0
  30. data/lib/cocoapods/command/repo/add.rb +103 -0
  31. data/lib/cocoapods/command/repo/lint.rb +82 -0
  32. data/lib/cocoapods/command/repo/list.rb +93 -0
  33. data/lib/cocoapods/command/repo/push.rb +281 -0
  34. data/lib/cocoapods/command/repo/remove.rb +36 -0
  35. data/lib/cocoapods/command/repo/update.rb +28 -0
  36. data/lib/cocoapods/command/setup.rb +103 -0
  37. data/lib/cocoapods/command/spec.rb +112 -0
  38. data/lib/cocoapods/command/spec/cat.rb +51 -0
  39. data/lib/cocoapods/command/spec/create.rb +283 -0
  40. data/lib/cocoapods/command/spec/edit.rb +87 -0
  41. data/lib/cocoapods/command/spec/env_spec.rb +53 -0
  42. data/lib/cocoapods/command/spec/lint.rb +137 -0
  43. data/lib/cocoapods/command/spec/which.rb +43 -0
  44. data/lib/cocoapods/command/update.rb +101 -0
  45. data/lib/cocoapods/config.rb +347 -0
  46. data/lib/cocoapods/core_overrides.rb +1 -0
  47. data/lib/cocoapods/downloader.rb +190 -0
  48. data/lib/cocoapods/downloader/cache.rb +233 -0
  49. data/lib/cocoapods/downloader/request.rb +86 -0
  50. data/lib/cocoapods/downloader/response.rb +16 -0
  51. data/lib/cocoapods/executable.rb +222 -0
  52. data/lib/cocoapods/external_sources.rb +57 -0
  53. data/lib/cocoapods/external_sources/abstract_external_source.rb +205 -0
  54. data/lib/cocoapods/external_sources/downloader_source.rb +30 -0
  55. data/lib/cocoapods/external_sources/path_source.rb +55 -0
  56. data/lib/cocoapods/external_sources/podspec_source.rb +54 -0
  57. data/lib/cocoapods/gem_version.rb +5 -0
  58. data/lib/cocoapods/generator/acknowledgements.rb +107 -0
  59. data/lib/cocoapods/generator/acknowledgements/markdown.rb +44 -0
  60. data/lib/cocoapods/generator/acknowledgements/plist.rb +94 -0
  61. data/lib/cocoapods/generator/app_target_helper.rb +244 -0
  62. data/lib/cocoapods/generator/bridge_support.rb +22 -0
  63. data/lib/cocoapods/generator/constant.rb +19 -0
  64. data/lib/cocoapods/generator/copy_resources_script.rb +230 -0
  65. data/lib/cocoapods/generator/dummy_source.rb +31 -0
  66. data/lib/cocoapods/generator/embed_frameworks_script.rb +215 -0
  67. data/lib/cocoapods/generator/header.rb +103 -0
  68. data/lib/cocoapods/generator/info_plist_file.rb +116 -0
  69. data/lib/cocoapods/generator/module_map.rb +99 -0
  70. data/lib/cocoapods/generator/prefix_header.rb +60 -0
  71. data/lib/cocoapods/generator/umbrella_header.rb +46 -0
  72. data/lib/cocoapods/hooks_manager.rb +132 -0
  73. data/lib/cocoapods/installer.rb +703 -0
  74. data/lib/cocoapods/installer/analyzer.rb +972 -0
  75. data/lib/cocoapods/installer/analyzer/analysis_result.rb +87 -0
  76. data/lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb +98 -0
  77. data/lib/cocoapods/installer/analyzer/pod_variant.rb +67 -0
  78. data/lib/cocoapods/installer/analyzer/pod_variant_set.rb +157 -0
  79. data/lib/cocoapods/installer/analyzer/podfile_dependency_cache.rb +54 -0
  80. data/lib/cocoapods/installer/analyzer/sandbox_analyzer.rb +240 -0
  81. data/lib/cocoapods/installer/analyzer/specs_state.rb +84 -0
  82. data/lib/cocoapods/installer/analyzer/target_inspection_result.rb +53 -0
  83. data/lib/cocoapods/installer/analyzer/target_inspector.rb +260 -0
  84. data/lib/cocoapods/installer/installation_options.rb +158 -0
  85. data/lib/cocoapods/installer/pod_source_installer.rb +202 -0
  86. data/lib/cocoapods/installer/pod_source_preparer.rb +77 -0
  87. data/lib/cocoapods/installer/podfile_validator.rb +139 -0
  88. data/lib/cocoapods/installer/post_install_hooks_context.rb +132 -0
  89. data/lib/cocoapods/installer/pre_install_hooks_context.rb +51 -0
  90. data/lib/cocoapods/installer/source_provider_hooks_context.rb +34 -0
  91. data/lib/cocoapods/installer/user_project_integrator.rb +250 -0
  92. data/lib/cocoapods/installer/user_project_integrator/target_integrator.rb +463 -0
  93. data/lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb +146 -0
  94. data/lib/cocoapods/installer/xcode.rb +8 -0
  95. data/lib/cocoapods/installer/xcode/pods_project_generator.rb +416 -0
  96. data/lib/cocoapods/installer/xcode/pods_project_generator/aggregate_target_installer.rb +181 -0
  97. data/lib/cocoapods/installer/xcode/pods_project_generator/app_host_installer.rb +84 -0
  98. data/lib/cocoapods/installer/xcode/pods_project_generator/file_references_installer.rb +334 -0
  99. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_installer.rb +777 -0
  100. data/lib/cocoapods/installer/xcode/pods_project_generator/pod_target_integrator.rb +116 -0
  101. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installation_result.rb +86 -0
  102. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer.rb +256 -0
  103. data/lib/cocoapods/installer/xcode/pods_project_generator/target_installer_helper.rb +68 -0
  104. data/lib/cocoapods/installer/xcode/target_validator.rb +147 -0
  105. data/lib/cocoapods/open-uri.rb +33 -0
  106. data/lib/cocoapods/project.rb +414 -0
  107. data/lib/cocoapods/resolver.rb +585 -0
  108. data/lib/cocoapods/resolver/lazy_specification.rb +79 -0
  109. data/lib/cocoapods/sandbox.rb +404 -0
  110. data/lib/cocoapods/sandbox/file_accessor.rb +444 -0
  111. data/lib/cocoapods/sandbox/headers_store.rb +146 -0
  112. data/lib/cocoapods/sandbox/path_list.rb +220 -0
  113. data/lib/cocoapods/sandbox/pod_dir_cleaner.rb +85 -0
  114. data/lib/cocoapods/sandbox/podspec_finder.rb +23 -0
  115. data/lib/cocoapods/sources_manager.rb +157 -0
  116. data/lib/cocoapods/target.rb +261 -0
  117. data/lib/cocoapods/target/aggregate_target.rb +338 -0
  118. data/lib/cocoapods/target/build_settings.rb +1075 -0
  119. data/lib/cocoapods/target/pod_target.rb +559 -0
  120. data/lib/cocoapods/user_interface.rb +459 -0
  121. data/lib/cocoapods/user_interface/error_report.rb +187 -0
  122. data/lib/cocoapods/user_interface/inspector_reporter.rb +109 -0
  123. data/lib/cocoapods/validator.rb +981 -0
  124. metadata +533 -0
data/LICENSE ADDED
@@ -0,0 +1,28 @@
1
+ This project is licensed under the MIT license.
2
+
3
+ Copyright (c) 2011 - 2017 Eloy Durán <eloy.de.enige@gmail.com>,
4
+ Fabio Pelosin <fabiopelosin@gmail.com>,
5
+ Samuel Giddins <segiddins@segiddins.me>,
6
+ Marius Rackwitz <git@mariusrackwitz.de>,
7
+ Kyle Fuller <kyle@fuller.li>,
8
+ Boris Bügling <boris@buegling.com>,
9
+ Orta Therox <orta.therox@gmail.com>, and
10
+ Olivier Halligon <olivier@halligon.net>.
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in
20
+ all copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
28
+ THE SOFTWARE.
@@ -0,0 +1,80 @@
1
+ ![CocoaPods Logo](https://raw.github.com/CocoaPods/shared_resources/master/assets/cocoapods-banner-readme.png)
2
+
3
+ ### CocoaPods: The Cocoa dependency manager
4
+
5
+ [![Build Status](http://img.shields.io/travis/CocoaPods/CocoaPods/master.svg?style=flat)](https://travis-ci.org/CocoaPods/CocoaPods)
6
+ [![Gem Version](http://img.shields.io/gem/v/cocoapods.svg?style=flat)](http://badge.fury.io/rb/cocoapods)
7
+ [![Code Climate](http://img.shields.io/codeclimate/github/CocoaPods/CocoaPods.svg?style=flat)](https://codeclimate.com/github/CocoaPods/CocoaPods)
8
+
9
+ CocoaPods manages dependencies for your Xcode projects.
10
+
11
+ You specify the dependencies for your project in a simple text file: your `Podfile`.
12
+ CocoaPods recursively resolves dependencies between libraries, fetches
13
+ source code for all dependencies, and creates and maintains an Xcode
14
+ workspace to build your project.
15
+
16
+ Installing and updating CocoaPods is very easy. Don't miss the [Installation
17
+ guide](http://guides.cocoapods.org/using/getting-started.html#installation) and the
18
+ [Getting Started guide](https://guides.cocoapods.org/using/getting-started.html).
19
+
20
+ ## Project Goals
21
+
22
+ CocoaPods aims to improve the engagement with, and discoverability
23
+ of, third party open-source Cocoa libraries. These
24
+ project goals influence and drive the design of CocoaPods:
25
+
26
+ - Create and share libraries, and use them in your own projects,
27
+ without creating extra work for library authors. Integrate
28
+ non-CocoaPods libraries and hack on your own fork of any
29
+ CocoaPods library with a simple transparent `Podspec` standard.
30
+ - Allow library authors to structure their libraries however they like.
31
+ - Save time for library authors by automating a lot of Xcode work not
32
+ related to their libraries' functionality.
33
+ - Support any source management system. (Currently supported are `git`,
34
+ `svn`, `mercurial`, `bazaar`, and various types of archives downloaded over HTTP.)
35
+ - Promote a culture of distributed collaboration on pods, but also provide
36
+ features only possible with a centralised solution to foster a community.
37
+ - Build tools on top of the core Cocoa development system, including those
38
+ typically deployed to other operating systems, such as web-services.
39
+ - Provide opinionated and automated integration, but make it completely
40
+ optional. You may manually integrate your CocoaPods dependencies
41
+ into your Xcode project as you see fit, with or without a workspace.
42
+ - Solve everyday problems for Cocoa and Xcode developers.
43
+
44
+ ## Sponsors
45
+
46
+ Lovingly sponsored by a collection of companies, see the footer of [CocoaPods.org](https://cocoapods.org) for an up-to-date list.
47
+
48
+ ## Collaborate
49
+
50
+ All CocoaPods development happens on GitHub. Contributions make for good karma and
51
+ we [welcome new](https://blog.cocoapods.org/starting-open-source/) contributors with joy. We take contributors seriously, and thus have a
52
+ contributor [code of conduct](CODE_OF_CONDUCT.md).
53
+
54
+ ## Links
55
+
56
+ | Link | Description |
57
+ | :----- | :------ |
58
+ [CocoaPods.org](https://cocoapods.org/) | Homepage and search for Pods.
59
+ [@CocoaPods](https://twitter.com/CocoaPods) | Follow CocoaPods on Twitter to stay up to date.
60
+ [Blog](https://blog.cocoapods.org) | The CocoaPods blog.
61
+ [Mailing List](http://groups.google.com/group/cocoapods) | Feel free to ask any kind of question.
62
+ [Guides](https://guides.cocoapods.org) | Everything you want to know about CocoaPods.
63
+ [Changelog](https://github.com/CocoaPods/CocoaPods/blob/master/CHANGELOG.md) | See the changes introduced in each CocoaPods version.
64
+ [New Pods RSS](https://feeds.cocoapods.org/new-pods.rss) | Don't miss any new Pods.
65
+ [Code of Conduct](CODE_OF_CONDUCT.md) | Find out the standards we hold ourselves to.
66
+
67
+ ## Projects
68
+
69
+ CocoaPods is composed of the following projects:
70
+
71
+ | Status | Project | Description | Info |
72
+ | :----- | :------ | :--- | :--- |
73
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/CocoaPods/master.svg?style=flat)](http://travis-ci.org/CocoaPods/CocoaPods) | [CocoaPods](https://github.com/CocoaPods/CocoaPods) | The CocoaPods command line tool. | [guides](https://guides.cocoapods.org)
74
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/Core/master.svg?style=flat)](http://travis-ci.org/CocoaPods/Core) | [CocoaPods Core](https://github.com/CocoaPods/Core) | Support for working with specifications and podfiles. | [docs](https://guides.cocoapods.org/contributing/components.html)
75
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/cocoapods-downloader/master.svg?style=flat)](http://travis-ci.org/CocoaPods/cocoapods-downloader) |[CocoaPods Downloader](https://github.com/CocoaPods/cocoapods-downloader) | Downloaders for various source types. | [docs](http://docs.cocoapods.org/cocoapods_downloader/index.html)
76
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/Xcodeproj/master.svg?style=flat)](https://travis-ci.org/CocoaPods/Xcodeproj) | [Xcodeproj](https://github.com/CocoaPods/Xcodeproj) | Create and modify Xcode projects from Ruby. | [docs](http://docs.cocoapods.org/xcodeproj/index.html)
77
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/CLAide/master.svg?style=flat)](https://travis-ci.org/CocoaPods/CLAide) | [CLAide](https://github.com/CocoaPods/CLAide) | A small command-line interface framework. | [docs](http://docs.cocoapods.org/claide/index.html)
78
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/Molinillo/master.svg?style=flat)](https://travis-ci.org/CocoaPods/Molinillo) | [Molinillo](https://github.com/CocoaPods/Molinillo) | A powerful generic dependency resolver. | [docs](http://www.rubydoc.info/gems/molinillo)
79
+ | [![Build Status](http://img.shields.io/travis/CocoaPods/CocoaPods-app/master.svg?style=flat)](https://travis-ci.org/CocoaPods/CocoaPods-app) | [CocoaPods.app](https://github.com/CocoaPods/CocoaPods-app) | A full-featured and standalone installation of CocoaPods. | [info](https://cocoapods.org/app)
80
+ | | [Master Repo ](https://github.com/CocoaPods/Specs) | Master repository of specifications. | [guides](http://docs.cocoapods.org/guides/contributing_to_the_master_repo.html)
data/bin/pod ADDED
@@ -0,0 +1,56 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ if Encoding.default_external != Encoding::UTF_8
4
+
5
+ if ARGV.include? '--no-ansi'
6
+ STDERR.puts <<-DOC
7
+ WARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
8
+ Consider adding the following to ~/.profile:
9
+
10
+ export LANG=en_US.UTF-8
11
+ DOC
12
+ else
13
+ STDERR.puts <<-DOC
14
+ \e[33mWARNING: CocoaPods requires your terminal to be using UTF-8 encoding.
15
+ Consider adding the following to ~/.profile:
16
+
17
+ export LANG=en_US.UTF-8
18
+ \e[0m
19
+ DOC
20
+ end
21
+
22
+ end
23
+
24
+ if $PROGRAM_NAME == __FILE__ && !ENV['COCOAPODS_NO_BUNDLER']
25
+ ENV['BUNDLE_GEMFILE'] = File.expand_path('../../Gemfile', __FILE__)
26
+ require 'rubygems'
27
+ require 'bundler/setup'
28
+ $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
29
+ elsif ENV['COCOAPODS_NO_BUNDLER']
30
+ require 'rubygems'
31
+ gem 'cocoapods'
32
+ end
33
+
34
+ STDOUT.sync = true if ENV['CP_STDOUT_SYNC'] == 'TRUE'
35
+
36
+ require 'cocoapods'
37
+
38
+ if profile_filename = ENV['PROFILE']
39
+ require 'ruby-prof'
40
+ reporter =
41
+ case (profile_extname = File.extname(profile_filename))
42
+ when '.txt'
43
+ RubyProf::FlatPrinterWithLineNumbers
44
+ when '.html'
45
+ RubyProf::GraphHtmlPrinter
46
+ when '.callgrind'
47
+ RubyProf::CallTreePrinter
48
+ else
49
+ raise "Unknown profiler format indicated by extension: #{profile_extname}"
50
+ end
51
+ File.open(profile_filename, 'w') do |io|
52
+ reporter.new(RubyProf.profile { Pod::Command.run(ARGV) }).print(io)
53
+ end
54
+ else
55
+ Pod::Command.run(ARGV)
56
+ end
@@ -0,0 +1,168 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: utf-8
3
+
4
+ # This bin wrapper runs the `pod` command in a OS X sandbox. The reason for this
5
+ # is to ensure that people can’t use malicious code from pod specifications.
6
+ #
7
+ # It does this by creating a ‘seatbelt’ profile on the fly and executing the
8
+ # given command through `/usr/bin/sandbox-exec`. This profile format is an
9
+ # undocumented format, which uses TinyScheme to implement its DSL.
10
+ #
11
+ # Even though it uses a undocumented format, it’s actually very self-explanatory.
12
+ # Because we use a whitelist approach, `(deny default)`, any action that is
13
+ # denied is logged to `/var/log/system.log`. So tailing that should provide
14
+ # enough information on steps that need to be take to get something to work.
15
+ #
16
+ # For more information see:
17
+ #
18
+ # * https://github.com/CocoaPods/CocoaPods/issues/939
19
+ # * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Slides.pdf
20
+ # * http://reverse.put.as/wp-content/uploads/2011/08/The-Apple-Sandbox-BHDC2011-Paper.pdf
21
+ # * https://github.com/s7ephen/OSX-Sandbox--Seatbelt--Profiles
22
+ # * `$ man sandbox-exec`
23
+ # * `$ ls /usr/share/sandbox`
24
+
25
+ if $0 == __FILE__
26
+ $:.unshift File.expand_path('../../lib', __FILE__)
27
+ end
28
+
29
+ require 'pathname'
30
+ require 'cocoapods/config'
31
+ require 'rbconfig'
32
+ require 'erb'
33
+
34
+ PROFILE_ERB_TEMPLATE = <<-EOS
35
+ (version 1)
36
+ (debug allow)
37
+
38
+ (import "mDNSResponder.sb")
39
+
40
+ (allow file-ioctl)
41
+ (allow sysctl-read)
42
+ (allow mach-lookup)
43
+ (allow ipc-posix-shm)
44
+ (allow process-fork)
45
+ (allow system-socket)
46
+
47
+ ; TODO make this stricter if possible
48
+ (allow network-outbound)
49
+
50
+ (allow process-exec
51
+ (literal
52
+ "<%= pod_bin %>"
53
+ "<%= ruby_bin %>"
54
+ )
55
+ (regex
56
+ <% prefixes.each do |prefix| %>
57
+ #"^<%= prefix %>/*"
58
+ <% end %>
59
+ )
60
+ )
61
+
62
+ (allow file-read-metadata)
63
+ (allow file-read*
64
+ ; This is currenly only added because using `xcodebuild` to build a resource
65
+ ; bundle target starts a FSEvents stream on `/`. No idea why that would be
66
+ ; needed, but for now it doesn’t seem like a real problem.
67
+ (literal "/")
68
+ (regex
69
+ ; TODO see if we can restrict this more, but it's going to be hard
70
+ #"^/Users/[^.]+/*"
71
+ ;#"^/Users/[^.]+/.netrc"
72
+ ;#"^/Users/[^.]+/.gemrc"
73
+ ;#"^/Users/[^.]+/.gem/*"
74
+ ;#"^/Users/[^.]+/Library/.*"
75
+ #"^/Library/*"
76
+ #"^/System/Library/*"
77
+ #"^/usr/lib/*"
78
+ #"^/usr/share/*"
79
+ #"^/private/*"
80
+ #"^/dev/*"
81
+ #"^<%= ruby_prefix %>"
82
+ #"^<%= pod_prefix %>"
83
+ #"^<%= xcode_app_path %>"
84
+ #"^<%= Pod::Config.instance.repos_dir %>"
85
+ <% prefixes.each do |prefix| %>
86
+ #"^<%= prefix %>/*"
87
+ <% end %>
88
+ )
89
+ )
90
+
91
+ (allow file-write*
92
+ (literal
93
+ "/dev/dtracehelper"
94
+ "/dev/null"
95
+ )
96
+ (regex
97
+ #"^<%= Pod::Config.instance.project_root %>"
98
+ #"^<%= Pod::Config.instance.repos_dir %>"
99
+ #"^/Users/[^.]+/Library/Caches/CocoaPods/*"
100
+ #"^/dev/tty"
101
+ #"^/private/var"
102
+ )
103
+ )
104
+
105
+ (deny default)
106
+ EOS
107
+
108
+ class Profile
109
+ def pod_bin
110
+ File.expand_path('../pod', __FILE__)
111
+ end
112
+
113
+ def pod_prefix
114
+ File.expand_path('../..', pod_bin)
115
+ end
116
+
117
+ def ruby_bin
118
+ File.join(RbConfig::CONFIG['bindir'], RbConfig::CONFIG['ruby_install_name'])
119
+ end
120
+
121
+ def ruby_prefix
122
+ RbConfig::CONFIG['prefix']
123
+ end
124
+
125
+ def prefix_from_bin(bin_name)
126
+ unless (path = `which #{bin_name}`.strip).empty?
127
+ File.dirname(File.dirname(path))
128
+ end
129
+ end
130
+
131
+ def prefixes
132
+ prefixes = ['/bin', '/usr/bin', '/usr/libexec', xcode_app_path]
133
+ prefixes << `brew --prefix`.strip unless `which brew`.strip.empty?
134
+
135
+ # From asking people, it seems MacPorts does not have a `prefix` command, like
136
+ # Homebrew does, so make an educated guess:
137
+ if port_prefix = prefix_from_bin('port')
138
+ prefixes << port_prefix
139
+ end
140
+
141
+ if rbenv_prefix = prefix_from_bin('rbenv')
142
+ prefixes << rbenv_prefix
143
+ end
144
+
145
+ prefixes
146
+ end
147
+
148
+ def developer_prefix
149
+ `xcode-select --print-path`.strip
150
+ end
151
+
152
+ def xcode_app_path
153
+ File.expand_path('../..', developer_prefix)
154
+ end
155
+
156
+ # TODO: raise SAFE level (0) to 4 if possible.
157
+ def generate
158
+ ERB.new(PROFILE_ERB_TEMPLATE, 0, '>').result(binding)
159
+ end
160
+ end
161
+
162
+ # Ensure the `pod` bin doesn’t think it needs to use Bundler.
163
+ ENV['COCOAPODS_NO_BUNDLER'] = '1'
164
+
165
+ profile = Profile.new
166
+ # puts profile.generate
167
+ command = ['/usr/bin/sandbox-exec', '-p', profile.generate, profile.pod_bin, *ARGV]
168
+ exec(*command)
@@ -0,0 +1,73 @@
1
+ require 'rubygems'
2
+ require 'xcodeproj'
3
+
4
+ # It is very likely that we'll need these and as some of those paths will atm
5
+ # result in a I18n deprecation warning, we load those here now so that we can
6
+ # get rid of that warning.
7
+ require 'active_support/core_ext/string/strip'
8
+ require 'active_support/core_ext/string/inflections'
9
+ require 'active_support/core_ext/array/conversions'
10
+ # TODO: check what this actually does by the time we're going to add support for
11
+ # other locales.
12
+ require 'i18n'
13
+ if I18n.respond_to?(:enforce_available_locales=)
14
+ I18n.enforce_available_locales = false
15
+ end
16
+
17
+ module Pod
18
+ require 'pathname'
19
+ require 'tmpdir'
20
+
21
+ require 'cocoapods/gem_version'
22
+ require 'cocoapods-core'
23
+ require 'cocoapods/config'
24
+ require 'cocoapods/downloader'
25
+
26
+ # Loaded immediately after dependencies to ensure proper override of their
27
+ # UI methods.
28
+ #
29
+ require 'cocoapods/user_interface'
30
+
31
+ # Indicates an user error. This is defined in cocoapods-core.
32
+ #
33
+ class Informative < PlainInformative
34
+ def message
35
+ "[!] #{super}".red
36
+ end
37
+ end
38
+
39
+ Xcodeproj::PlainInformative.send(:include, CLAide::InformativeError)
40
+
41
+ autoload :AggregateTarget, 'cocoapods/target/aggregate_target'
42
+ autoload :Command, 'cocoapods/command'
43
+ autoload :Deintegrator, 'cocoapods_deintegrate'
44
+ autoload :Executable, 'cocoapods/executable'
45
+ autoload :ExternalSources, 'cocoapods/external_sources'
46
+ autoload :Installer, 'cocoapods/installer'
47
+ autoload :HooksManager, 'cocoapods/hooks_manager'
48
+ autoload :PodTarget, 'cocoapods/target/pod_target'
49
+ autoload :Project, 'cocoapods/project'
50
+ autoload :Resolver, 'cocoapods/resolver'
51
+ autoload :Sandbox, 'cocoapods/sandbox'
52
+ autoload :Target, 'cocoapods/target'
53
+ autoload :Validator, 'cocoapods/validator'
54
+
55
+ module Generator
56
+ autoload :Acknowledgements, 'cocoapods/generator/acknowledgements'
57
+ autoload :Markdown, 'cocoapods/generator/acknowledgements/markdown'
58
+ autoload :Plist, 'cocoapods/generator/acknowledgements/plist'
59
+ autoload :BridgeSupport, 'cocoapods/generator/bridge_support'
60
+ autoload :Constant, 'cocoapods/generator/constant'
61
+ autoload :CopyResourcesScript, 'cocoapods/generator/copy_resources_script'
62
+ autoload :DummySource, 'cocoapods/generator/dummy_source'
63
+ autoload :EmbedFrameworksScript, 'cocoapods/generator/embed_frameworks_script'
64
+ autoload :Header, 'cocoapods/generator/header'
65
+ autoload :InfoPlistFile, 'cocoapods/generator/info_plist_file'
66
+ autoload :ModuleMap, 'cocoapods/generator/module_map'
67
+ autoload :PrefixHeader, 'cocoapods/generator/prefix_header'
68
+ autoload :UmbrellaHeader, 'cocoapods/generator/umbrella_header'
69
+ autoload :AppTargetHelper, 'cocoapods/generator/app_target_helper'
70
+ end
71
+
72
+ require 'cocoapods/core_overrides'
73
+ end
@@ -0,0 +1,175 @@
1
+ require 'colored2'
2
+ require 'claide'
3
+ require 'molinillo/errors'
4
+
5
+ module Molinillo
6
+ class ResolverError
7
+ include CLAide::InformativeError
8
+ end
9
+ end
10
+
11
+ module Pod
12
+ class PlainInformative
13
+ include CLAide::InformativeError
14
+ end
15
+
16
+ class Command < CLAide::Command
17
+ require 'cocoapods/command/options/repo_update'
18
+ require 'cocoapods/command/options/project_directory'
19
+ include Options
20
+
21
+ require 'cocoapods/command/cache'
22
+ require 'cocoapods/command/env'
23
+ require 'cocoapods/command/init'
24
+ require 'cocoapods/command/install'
25
+ require 'cocoapods/command/ipc'
26
+ require 'cocoapods/command/lib'
27
+ require 'cocoapods/command/list'
28
+ require 'cocoapods/command/outdated'
29
+ require 'cocoapods/command/repo'
30
+ require 'cocoapods/command/setup'
31
+ require 'cocoapods/command/spec'
32
+ require 'cocoapods/command/update'
33
+
34
+ self.abstract_command = true
35
+ self.command = 'pod'
36
+ self.version = VERSION
37
+ self.description = 'CocoaPods, the Cocoa library package manager.'
38
+ self.plugin_prefixes = %w(claide cocoapods)
39
+
40
+ def self.options
41
+ [
42
+ ['--silent', 'Show nothing'],
43
+ ].concat(super)
44
+ end
45
+
46
+ def self.run(argv)
47
+ help! 'You cannot run CocoaPods as root.' if Process.uid == 0
48
+
49
+ verify_minimum_git_version!
50
+ verify_xcode_license_approved!
51
+
52
+ super(argv)
53
+ ensure
54
+ UI.print_warnings
55
+ end
56
+
57
+ def self.report_error(exception)
58
+ case exception
59
+ when Interrupt
60
+ puts '[!] Cancelled'.red
61
+ Config.instance.verbose? ? raise : exit(1)
62
+ when SystemExit
63
+ raise
64
+ else
65
+ if ENV['COCOA_PODS_ENV'] != 'development'
66
+ puts UI::ErrorReport.report(exception)
67
+ UI::ErrorReport.search_for_exceptions(exception)
68
+ exit 1
69
+ else
70
+ raise exception
71
+ end
72
+ end
73
+ end
74
+
75
+ # @todo If a command is run inside another one some settings which where
76
+ # true might return false.
77
+ #
78
+ # @todo We should probably not even load colored unless needed.
79
+ #
80
+ # @todo Move silent flag to CLAide.
81
+ #
82
+ # @note It is important that the commands don't override the default
83
+ # settings if their flag is missing (i.e. their value is nil)
84
+ #
85
+ def initialize(argv)
86
+ super
87
+ config.silent = argv.flag?('silent', config.silent)
88
+ config.verbose = self.verbose? unless verbose.nil?
89
+ unless self.ansi_output?
90
+ Colored2.disable!
91
+ String.send(:define_method, :colorize) { |string, _| string }
92
+ end
93
+ end
94
+
95
+ # Ensure that the master spec repo exists
96
+ #
97
+ # @return [void]
98
+ #
99
+ def ensure_master_spec_repo_exists!
100
+ unless config.sources_manager.master_repo_functional?
101
+ Setup.new(CLAide::ARGV.new([])).run
102
+ end
103
+ end
104
+
105
+ #-------------------------------------------------------------------------#
106
+
107
+ include Config::Mixin
108
+
109
+ private
110
+
111
+ # Returns a new {Gem::Version} based on the systems `git` version.
112
+ #
113
+ # @return [Gem::Version]
114
+ #
115
+ def self.git_version
116
+ raw_version = Executable.capture_command('git', ['--version']).first
117
+ unless match = raw_version.scan(/\d+\.\d+\.\d+/).first
118
+ raise "Failed to extract git version from `git --version` (#{raw_version.inspect})"
119
+ end
120
+ Gem::Version.new(match)
121
+ end
122
+
123
+ # Checks that the git version is at least 1.8.5
124
+ #
125
+ # @raise If the git version is older than 1.8.5
126
+ #
127
+ # @return [void]
128
+ #
129
+ def self.verify_minimum_git_version!
130
+ if git_version < Gem::Version.new('1.8.5')
131
+ raise Informative, 'You need at least git version 1.8.5 to use CocoaPods'
132
+ end
133
+ end
134
+
135
+ # Returns a new {Installer} parametrized from the {Config}.
136
+ #
137
+ # @return [Installer]
138
+ #
139
+ def installer_for_config
140
+ Installer.new(config.sandbox, config.podfile, config.lockfile)
141
+ end
142
+
143
+ # Checks that the podfile exists.
144
+ #
145
+ # @raise If the podfile does not exists.
146
+ #
147
+ # @return [void]
148
+ #
149
+ def verify_podfile_exists!
150
+ unless config.podfile
151
+ raise Informative, "No `Podfile' found in the project directory."
152
+ end
153
+ end
154
+
155
+ # Checks that the lockfile exists.
156
+ #
157
+ # @raise If the lockfile does not exists.
158
+ #
159
+ # @return [void]
160
+ #
161
+ def verify_lockfile_exists!
162
+ unless config.lockfile
163
+ raise Informative, "No `Podfile.lock' found in the project directory, run `pod install'."
164
+ end
165
+ end
166
+
167
+ def self.verify_xcode_license_approved!
168
+ if `/usr/bin/xcrun clang 2>&1` =~ /license/ && !$?.success?
169
+ raise Informative, 'You have not agreed to the Xcode license, which ' \
170
+ 'you must do to use CocoaPods. Agree to the license by running: ' \
171
+ '`xcodebuild -license`.'
172
+ end
173
+ end
174
+ end
175
+ end