cocoapods 0.3.10 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # CocoaPods – an Objective-C library manager
2
2
 
3
+ [![Build Status](https://secure.travis-ci.org/CocoaPods/CocoaPods.png)](https://secure.travis-ci.org/CocoaPods/CocoaPods)
4
+
3
5
  CocoaPods manages library dependencies for your Xcode project.
4
6
 
5
7
  You specify the dependencies for your project in one easy text file. CocoaPods resolves dependencies between libraries, fetches source code for the dependencies, and creates and maintains an Xcode workspace to build your project.
@@ -13,15 +15,9 @@ See [the wiki](https://github.com/CocoaPods/CocoaPods/wiki) for more in depth in
13
15
 
14
16
  Downloading and installing CocoaPods only takes a few minutes.
15
17
 
16
- CocoaPods runs on [MacRuby](http://macruby.org). If you don't have a recent version of MacRuby installed you will need to download it. CocoaPods works best on version 0.10.
17
-
18
- $ curl -O http://www.macruby.org/files/MacRuby%200.10.zip
19
- $ open MacRuby%200.10.zip
20
- # open MacRuby\ 0.10/MacRuby\ 0.10.pkg
21
-
22
- After that you can install CocoaPods itself.
18
+ CocoaPods runs on [Ruby](http://www.ruby-lang.org/en/). To install it run the following commands:
23
19
 
24
- $ sudo macgem install cocoapods
20
+ $ sudo gem install cocoapods
25
21
  $ pod setup
26
22
 
27
23
  Now that you've got CocoaPods installed you can easily add it to your project.
@@ -1,5 +1,5 @@
1
1
  module Pod
2
- VERSION = '0.3.10'
2
+ VERSION = '0.5.0'
3
3
 
4
4
  class Informative < StandardError
5
5
  end
@@ -11,6 +11,7 @@ module Pod
11
11
  autoload :Downloader, 'cocoapods/downloader'
12
12
  autoload :Executable, 'cocoapods/executable'
13
13
  autoload :Installer, 'cocoapods/installer'
14
+ autoload :Platform, 'cocoapods/platform'
14
15
  autoload :Podfile, 'cocoapods/podfile'
15
16
  autoload :Resolver, 'cocoapods/resolver'
16
17
  autoload :Source, 'cocoapods/source'
@@ -29,7 +30,7 @@ end
29
30
 
30
31
  module Xcodeproj
31
32
  autoload :Config, 'xcodeproj/config'
32
- autoload :Project, 'cocoapods/xcodeproj_ext'
33
+ autoload :Project, 'cocoapods/xcodeproj_pods'
33
34
  autoload :Workspace, 'xcodeproj/workspace'
34
35
  end
35
36
 
@@ -98,6 +98,23 @@ module Pod
98
98
  end
99
99
  end
100
100
 
101
+ # Taken from RubyGems 1.3.7
102
+ unless public_method_defined?(:match?)
103
+ def match?(spec_name, spec_version)
104
+ pattern = name
105
+
106
+ if Regexp === pattern
107
+ return false unless pattern =~ spec_name
108
+ else
109
+ return false unless pattern == spec_name
110
+ end
111
+
112
+ return true if requirement.to_s == ">= 0"
113
+
114
+ requirement.satisfied_by? Gem::Version.new(spec_version)
115
+ end
116
+ end
117
+
101
118
  # Taken from a newer version of RubyGems
102
119
  unless public_method_defined?(:merge)
103
120
  def merge other
@@ -1,4 +1,8 @@
1
- require 'rake'
1
+ if RUBY_VERSION >= "1.9"
2
+ require 'rake/file_list'
3
+ else
4
+ require 'rake'
5
+ end
2
6
 
3
7
  # This makes Rake::FileList usable with the Specification attributes
4
8
  # source_files, clean_paths, and resources.
@@ -19,6 +23,10 @@ module Rake
19
23
  end
20
24
  end
21
25
 
26
+ module Pod
27
+ FileList = Rake::FileList
28
+ end
29
+
22
30
  class Pathname
23
31
  alias_method :_original_sum, :+
24
32
  def +(other)
@@ -30,5 +38,3 @@ class Pathname
30
38
  end
31
39
  end
32
40
  end
33
-
34
-
@@ -55,8 +55,10 @@ module Pod
55
55
 
56
56
  def install_dependencies!
57
57
  build_specifications.each do |spec|
58
- if spec.pod_destroot.exist?
59
- puts "Using #{spec}" unless config.silent?
58
+ if spec.pod_destroot.exist? || spec.local?
59
+ message = "Using #{spec}"
60
+ message += " [LOCAL]" if spec.local?
61
+ puts message unless config.silent?
60
62
  else
61
63
  puts "Installing #{spec}" unless config.silent?
62
64
  spec = spec.part_of_specification if spec.part_of_other_pod?
@@ -90,12 +90,6 @@ module Pod
90
90
  end
91
91
  xcconfig.merge!('HEADER_SEARCH_PATHS' => header_search_paths.sort.uniq.join(" "))
92
92
 
93
- # Now that we have added all the source files and copy header phases,
94
- # move the compile build phase to the end, so that headers are copied
95
- # to the build products dir first, and thus Pod source files can enjoy
96
- # the same namespacing of headers as the app would.
97
- @target.move_compile_phase_to_end!
98
-
99
93
  # Add all the target related support files to the group, even the copy
100
94
  # resources script although the project doesn't actually use them.
101
95
  support_files_group = @project.groups.find do |group|
@@ -0,0 +1,45 @@
1
+ module Pod
2
+ class Platform
3
+ attr_reader :options
4
+
5
+ def initialize(symbolic_name, options = {})
6
+ @symbolic_name = symbolic_name
7
+ @options = options
8
+ end
9
+
10
+ def name
11
+ @symbolic_name
12
+ end
13
+
14
+ def ==(other_platform_or_symbolic_name)
15
+ if other_platform_or_symbolic_name.is_a?(Symbol)
16
+ @symbolic_name == other_platform_or_symbolic_name
17
+ else
18
+ self == (other_platform_or_symbolic_name.name)
19
+ end
20
+ end
21
+
22
+ def to_s
23
+ name.to_s
24
+ end
25
+
26
+ def to_sym
27
+ name
28
+ end
29
+
30
+ def nil?
31
+ name.nil?
32
+ end
33
+
34
+ def deployment_target
35
+ if (opt = options[:deployment_target])
36
+ Pod::Version.new(opt)
37
+ end
38
+ end
39
+
40
+ def requires_legacy_ios_archs?
41
+ return unless deployment_target
42
+ (name == :ios) && (deployment_target < Pod::Version.new("4.3"))
43
+ end
44
+ end
45
+ end
@@ -48,8 +48,15 @@ module Pod
48
48
  #
49
49
  # This can be either `:osx` for Mac OS X applications, or `:ios` for iOS
50
50
  # applications.
51
- def platform(platform = nil)
52
- platform ? @platform = platform : @platform
51
+ #
52
+ # For iOS applications, you can set the deployment target by passing a :deployment_target
53
+ # option, e.g:
54
+ #
55
+ # platform :ios, :deployment_target => "4.0"
56
+ #
57
+ # If the deployment target requires it (< 4.3), armv6 will be added to ARCHS.
58
+ def platform(platform = nil, options={})
59
+ platform ? @platform = Platform.new(platform, options) : @platform
53
60
  end
54
61
 
55
62
  # Specifies a dependency of the project.
@@ -236,7 +243,7 @@ module Pod
236
243
 
237
244
  def validate!
238
245
  lines = []
239
- lines << "* the `platform` attribute should be either `:osx` or `:ios`" unless [:osx, :ios].include?(@platform)
246
+ lines << "* the `platform` attribute should be either `:osx` or `:ios`" unless @platform && [:osx, :ios].include?(@platform.name)
240
247
  lines << "* no dependencies were specified, which is, well, kinda pointless" if dependencies.empty?
241
248
  raise(Informative, (["The Podfile at `#{@defined_in_file}' is invalid:"] + lines).join("\n")) unless lines.empty?
242
249
  end
@@ -28,6 +28,7 @@ module Pod
28
28
  # TODO This is just to work around a MacRuby bug
29
29
  def post_initialize
30
30
  @dependencies, @source_files, @resources, @clean_paths, @subspecs = [], [], [], [], []
31
+ @platform = Platform.new(nil)
31
32
  @xcconfig = Xcodeproj::Config.new
32
33
  end
33
34
 
@@ -123,7 +124,10 @@ module Pod
123
124
  flags
124
125
  end
125
126
 
126
- attr_accessor :platform
127
+ def platform=(platform)
128
+ @platform = Platform.new(platform)
129
+ end
130
+ attr_reader :platform
127
131
 
128
132
  attr_accessor :requires_arc
129
133
 
@@ -148,6 +152,14 @@ module Pod
148
152
  attr_accessor :defined_in_set
149
153
 
150
154
  include Config::Mixin
155
+
156
+ def local?
157
+ !source[:local].nil?
158
+ end
159
+
160
+ def local_path
161
+ Pathname.new(File.expand_path(source[:local]))
162
+ end
151
163
 
152
164
  def wrapper?
153
165
  source_files.empty? && !subspecs.empty?
@@ -191,6 +203,8 @@ module Pod
191
203
  def pod_destroot
192
204
  if part_of_other_pod?
193
205
  part_of_specification.pod_destroot
206
+ elsif local?
207
+ local_path
194
208
  else
195
209
  config.project_pods_root + @name
196
210
  end
@@ -321,7 +335,7 @@ module Pod
321
335
 
322
336
  incorrect = []
323
337
  allowed = [nil, :ios, :osx]
324
- incorrect << ["`platform'", allowed] unless allowed.include?(platform)
338
+ incorrect << ["`platform'", allowed] unless allowed.include?(platform.name)
325
339
 
326
340
  unless missing.empty? && incorrect.empty?
327
341
  message = "The following #{(missing + incorrect).size == 1 ? 'attribute is' : 'attributes are'}:\n"
@@ -26,7 +26,8 @@ module Pod
26
26
 
27
27
  def required_by(specification)
28
28
  dependency = specification.dependency_by_top_level_spec_name(name)
29
- unless @required_by.empty? || dependency.requirement.satisfied_by?(required_version)
29
+ # TODO we don’t actually do anything in our Version subclass. Maybe we should just remove that.
30
+ unless @required_by.empty? || dependency.requirement.satisfied_by?(Gem::Version.new(required_version.to_s))
30
31
  # TODO add graph that shows which dependencies led to this.
31
32
  raise Informative, "#{specification} tries to activate `#{dependency}', " \
32
33
  "but already activated version `#{required_version}' " \
@@ -1,4 +1,4 @@
1
- require 'xcodeproj'
1
+ require 'xcodeproj/project'
2
2
 
3
3
  module Xcodeproj
4
4
  class Project
@@ -11,18 +11,14 @@ module Xcodeproj
11
11
  def add_pod_group(name)
12
12
  pods.groups.new('name' => name)
13
13
  end
14
-
15
- class PBXNativeTarget
16
- def move_compile_phase_to_end!
17
- reflection = self.class.reflection(:buildPhases)
18
- uuids = send(reflection.uuids_getter)
19
- phase = buildPhases.find { |phase| phase.is_a?(PBXSourcesBuildPhase) }
20
- uuids.delete(phase.uuid)
21
- uuids << phase.uuid
22
- phase = buildPhases.find { |phase| phase.is_a?(PBXFrameworksBuildPhase) }
23
- uuids.delete(phase.uuid)
24
- uuids << phase.uuid
25
- end
14
+
15
+ # Shortcut access to build configurations
16
+ def build_configurations
17
+ objects[root_object.attributes['buildConfigurationList']].buildConfigurations
18
+ end
19
+
20
+ def build_configuration(name)
21
+ build_configurations.find { |c| c.name == name }
26
22
  end
27
23
 
28
24
  class PBXCopyFilesBuildPhase
@@ -97,8 +93,11 @@ module Xcodeproj
97
93
  }
98
94
 
99
95
  def self.build_settings(platform, scheme)
100
- settings = COMMON_BUILD_SETTINGS[:all].merge(COMMON_BUILD_SETTINGS[platform])
96
+ settings = COMMON_BUILD_SETTINGS[:all].merge(COMMON_BUILD_SETTINGS[platform.name])
101
97
  settings['COPY_PHASE_STRIP'] = scheme == :debug ? 'NO' : 'YES'
98
+ if platform.requires_legacy_ios_archs?
99
+ settings['ARCHS'] = "armv6 armv7"
100
+ end
102
101
  if scheme == :debug
103
102
  settings.merge!(COMMON_BUILD_SETTINGS[:debug])
104
103
  settings['ONLY_ACTIVE_ARCH'] = 'YES' if platform == :osx
metadata CHANGED
@@ -1,50 +1,43 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: cocoapods
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 3
8
- - 10
9
- version: 0.3.10
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.0
5
+ prerelease:
10
6
  platform: ruby
11
- authors:
7
+ authors:
12
8
  - Eloy Duran
13
9
  autorequire:
14
10
  bindir: bin
15
11
  cert_chain: []
16
-
17
- date: 2011-11-22 00:00:00 +01:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2011-11-22 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: xcodeproj
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
24
- requirements:
16
+ requirement: &70184002384740 !ruby/object:Gem::Requirement
17
+ none: false
18
+ requirements:
25
19
  - - ~>
26
- - !ruby/object:Gem::Version
27
- segments:
28
- - 0
29
- - 0
30
- - 2
31
- version: 0.0.2
20
+ - !ruby/object:Gem::Version
21
+ version: 0.1.0
32
22
  type: :runtime
33
- version_requirements: *id001
34
- description: |-
35
- CocoaPods manages library dependencies for your Xcode project.
36
-
37
- You specify the dependencies for your project in one easy text file. CocoaPods resolves dependencies between libraries, fetches source code for the dependencies, and creates and maintains an Xcode workspace to build your project.
38
-
39
- Ultimately, the goal is to improve discoverability of, and engagement in, third party open-source libraries, by creating a more centralized ecosystem.
23
+ prerelease: false
24
+ version_requirements: *70184002384740
25
+ description: ! 'CocoaPods manages library dependencies for your Xcode project.
26
+
27
+
28
+ You specify the dependencies for your project in one easy text file. CocoaPods resolves
29
+ dependencies between libraries, fetches source code for the dependencies, and creates
30
+ and maintains an Xcode workspace to build your project.
31
+
32
+
33
+ Ultimately, the goal is to improve discoverability of, and engagement in, third
34
+ party open-source libraries, by creating a more centralized ecosystem.'
40
35
  email: eloy.de.enige@gmail.com
41
- executables:
36
+ executables:
42
37
  - pod
43
38
  extensions: []
44
-
45
39
  extra_rdoc_files: []
46
-
47
- files:
40
+ files:
48
41
  - lib/cocoapods/command/install.rb
49
42
  - lib/cocoapods/command/list.rb
50
43
  - lib/cocoapods/command/repo.rb
@@ -64,47 +57,43 @@ files:
64
57
  - lib/cocoapods/generator/copy_resources_script.rb
65
58
  - lib/cocoapods/installer/target_installer.rb
66
59
  - lib/cocoapods/installer.rb
60
+ - lib/cocoapods/platform.rb
67
61
  - lib/cocoapods/podfile.rb
68
62
  - lib/cocoapods/resolver.rb
69
63
  - lib/cocoapods/source.rb
70
64
  - lib/cocoapods/specification/set.rb
71
65
  - lib/cocoapods/specification.rb
72
66
  - lib/cocoapods/version.rb
73
- - lib/cocoapods/xcodeproj_ext.rb
67
+ - lib/cocoapods/xcodeproj_pods.rb
74
68
  - lib/cocoapods.rb
75
69
  - bin/pod
76
70
  - README.md
77
71
  - LICENSE
78
72
  - CHANGELOG.md
79
- has_rdoc: true
80
73
  homepage: https://github.com/CocoaPods/CocoaPods
81
- licenses:
74
+ licenses:
82
75
  - MIT
83
- post_install_message: "[!] If this is your first time install of CocoaPods, or if you are upgrading, first run: $ pod setup"
76
+ post_install_message: ! '[!] If this is your first time install of CocoaPods, or if
77
+ you are upgrading, first run: $ pod setup'
84
78
  rdoc_options: []
85
-
86
- require_paths:
79
+ require_paths:
87
80
  - lib
88
- required_ruby_version: !ruby/object:Gem::Requirement
89
- requirements:
90
- - - ">="
91
- - !ruby/object:Gem::Version
92
- segments:
93
- - 0
94
- version: "0"
95
- required_rubygems_version: !ruby/object:Gem::Requirement
96
- requirements:
97
- - - ">="
98
- - !ruby/object:Gem::Version
99
- segments:
100
- - 0
101
- version: "0"
81
+ required_ruby_version: !ruby/object:Gem::Requirement
82
+ none: false
83
+ requirements:
84
+ - - ! '>='
85
+ - !ruby/object:Gem::Version
86
+ version: '0'
87
+ required_rubygems_version: !ruby/object:Gem::Requirement
88
+ none: false
89
+ requirements:
90
+ - - ! '>='
91
+ - !ruby/object:Gem::Version
92
+ version: '0'
102
93
  requirements: []
103
-
104
94
  rubyforge_project:
105
- rubygems_version: 1.3.6
95
+ rubygems_version: 1.8.11
106
96
  signing_key:
107
97
  specification_version: 3
108
98
  summary: An Objective-C library package manager. (Requires MacRuby.)
109
99
  test_files: []
110
-