motion-cocoapods 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5809a607aad317dffc74f3d3dea5f6e234ae544f
4
- data.tar.gz: 29f69e491f27646fd980b37b3e3fc7a349836733
3
+ metadata.gz: c080d5b0ed0340f6aef99a31c114007c1680963d
4
+ data.tar.gz: 3474078ff4ad74cf0acd84dce6c9e6c0ab218f7a
5
5
  SHA512:
6
- metadata.gz: eac171e6e18c1843f055209c679fe4ea225bd2d0ddfc6a67f139ffc9202e1a528c7c0ab3dea7384871eef971c4e2b02af9a94bbc9ff0fac14328ceae23eec7df
7
- data.tar.gz: 13fcec8d997ea2ee5aaa488aeee68e90e798c0f053d1470d7e333f8a5f79a45d0b730235afe654f440fb1c98e0a28a41d74055dffe8e2c290a25f13c3fb01c8e
6
+ metadata.gz: 01f8d63b9a7bf46edc207e225a408d3c327a641bd8225025ddd3873fd62793fc8d8426522c76ca95fffe0abdd4854682d94c6629ea0c09938cc3e8cf28563a5d
7
+ data.tar.gz: b98d5b10ec810c59a8b93746d0d3cc7b1ef19801f1038bfa6a97b30cc44162f8d43a7057a3ce92d226169577898a3cdcd8a49fc437e0693dd6823037a5d2f9b3
data/README.md CHANGED
@@ -13,7 +13,7 @@ $ [sudo] gem install motion-cocoapods
13
13
  Or if you use Bundler:
14
14
 
15
15
  ```ruby
16
- gem 'motion-cocoapods', '~> 1.4.1'
16
+ gem 'motion-cocoapods'
17
17
  ```
18
18
 
19
19
 
@@ -53,7 +53,7 @@ To tell motion-cocoapods to download your dependencies, run the following rake
53
53
  task:
54
54
 
55
55
  ```
56
- $ rake pod:install
56
+ $ [bundle exec] rake pod:install
57
57
  ```
58
58
 
59
59
  That’s all. The build system will properly download the given pods and their
@@ -64,23 +64,38 @@ If the `vendor/Podfile.lock` file exists, this will be used to install specific
64
64
  versions. To update the versions, use the following rake task:
65
65
 
66
66
  ```
67
- $ rake pod:update
67
+ $ [bundle exec] rake pod:update
68
68
  ```
69
69
 
70
70
  ## Options
71
71
 
72
+ If necessary, you can pass `vendor_project` options to the `pods` configuration
73
+ method. These options are described [here](http://www.rubymotion.com/developer-center/guides/project-management/#_vendoring_3rd_party_libraries).
74
+ For instance, to only generate BridgeSupport metadata for a single pod, which
75
+ might be needed if a dependency that you’re not using directly is causing issues
76
+ (such as C++ headers), you can specify that like so:
77
+
78
+ ```ruby
79
+ Motion::Project::App.setup do |app|
80
+ app.pods :headers_dir => 'Headers/AFNetworking' do
81
+ pod 'AFNetworking'
82
+ # ...
83
+ end
84
+ end
85
+ ```
86
+
72
87
  By default the output of CocoaPods doing its work is silenced. If, however, you
73
88
  would like to see the output, you can set the `COCOAPODS_VERBOSE` env variable:
74
89
 
75
90
  ```
76
- $ rake pod:install COCOAPODS_VERBOSE=1
91
+ $ [bundle exec] rake pod:install COCOAPODS_VERBOSE=1
77
92
  ```
78
93
 
79
94
  As part of the install and update tasks, the specification repostories will get
80
95
  updated. You can disable this with the `COCOAPODS_NO_REPO_UPDATE` env variable:
81
96
 
82
97
  ```
83
- $ rake pod:install COCOAPODS_NO_REPO_UPDATE=1
98
+ $ [bundle exec] rake pod:install COCOAPODS_NO_REPO_UPDATE=1
84
99
  ```
85
100
 
86
101
 
@@ -91,13 +106,13 @@ $ rake pod:install COCOAPODS_NO_REPO_UPDATE=1
91
106
  ```
92
107
  $ git clone git://github.com/HipByte/motion-cocoapods.git
93
108
  $ cd motion-cocoapods
94
- $ rake bootstrap
109
+ $ [bundle exec] rake bootstrap
95
110
  ```
96
111
 
97
112
  2. Verify that all the tests are passing.
98
113
 
99
114
  ```
100
- $ rake spec
115
+ $ [bundle exec] rake spec
101
116
  ```
102
117
 
103
118
  3. Create your patch and send a
@@ -34,8 +34,8 @@ module Motion::Project
34
34
  class Config
35
35
  variable :pods
36
36
 
37
- def pods(&block)
38
- @pods ||= Motion::Project::CocoaPods.new(self)
37
+ def pods(vendor_options = {}, &block)
38
+ @pods ||= Motion::Project::CocoaPods.new(self, vendor_options)
39
39
  if block
40
40
  @pods.instance_eval(&block)
41
41
  end
@@ -47,7 +47,7 @@ module Motion::Project
47
47
  class << self
48
48
  def build_with_cocoapods(platform, opts = {})
49
49
  unless File.exist?(CocoaPods::PODS_ROOT)
50
- $stderr.puts "[!] No CocoaPods dependencies found in #{CocoaPods::PODS_ROOT}, run the `rake pod:install` task."
50
+ $stderr.puts "[!] No CocoaPods dependencies found in #{CocoaPods::PODS_ROOT}, run the `[bundle exec] rake pod:install` task."
51
51
  exit 1
52
52
  end
53
53
  build_without_cocoapods(platform, opts)
@@ -62,55 +62,77 @@ module Motion::Project
62
62
 
63
63
  class CocoaPods
64
64
  PODS_ROOT = 'vendor/Pods'
65
+ SUPPORT_FILES = File.join(PODS_ROOT, 'Target Support Files/Pods')
65
66
 
66
67
  attr_accessor :podfile
67
68
 
68
- def initialize(config)
69
+ def initialize(config, vendor_options)
69
70
  @config = config
71
+ @vendor_options = vendor_options
70
72
 
71
73
  @podfile = Pod::Podfile.new(Pathname.new(Rake.original_dir) + 'Rakefile') {}
72
74
  @podfile.platform((App.respond_to?(:template) ? App.template : :ios), config.deployment_target)
73
75
  cp_config.podfile = @podfile
74
76
  cp_config.skip_repo_update = true
75
- cp_config.verbose = !!ENV['COCOAPODS_VERBOSE']
76
77
  cp_config.integrate_targets = false
77
78
  cp_config.installation_root = Pathname.new(File.expand_path(config.project_dir)) + 'vendor'
78
79
 
80
+ if cp_config.verbose = !!ENV['COCOAPODS_VERBOSE']
81
+ require 'claide'
82
+ end
83
+
79
84
  configure_project
80
85
  end
81
86
 
82
87
  # Adds the Pods project to the RubyMotion config as a vendored project and
83
88
  #
84
89
  def configure_project
85
- @config.vendor_project(PODS_ROOT, :xcode,
86
- :target => 'Pods',
87
- :headers_dir => 'Headers',
88
- :products => %w{ libPods.a }
89
- )
90
-
91
90
  @config.resources_dirs << resources_dir.to_s
92
91
 
93
92
  # TODO replace this all once Xcodeproj has the proper xcconfig parser.
94
93
  if (xcconfig = self.pods_xcconfig_hash) && ldflags = xcconfig['OTHER_LDFLAGS']
95
94
  lib_search_paths = xcconfig['LIBRARY_SEARCH_PATHS'] || ""
96
- lib_search_paths = lib_search_paths.split(/"\s/).map do |path|
95
+ lib_search_paths = lib_search_paths.split(/\s/).map do |path|
97
96
  '-L ' << path.gsub('$(PODS_ROOT)', File.join(@config.project_dir, PODS_ROOT))
98
97
  end.join(' ')
99
98
 
100
- @config.libs.concat(ldflags.scan(/-l([^\s]+)/).map { |m|
101
- if lib_search_paths.length == 0 || File.exist?("/usr/lib/lib#{m[0]}.dylib")
102
- "/usr/lib/lib#{m[0]}.dylib"
99
+ # Collect the Pod products
100
+ pods_libs = []
101
+
102
+ @config.libs.concat(ldflags.scan(/-l"?([^\s"]+)"?/).map { |m|
103
+ lib_name = m[0]
104
+ next if lib_name.nil?
105
+ if lib_name.start_with?('Pods-')
106
+ pods_libs << lib_name
107
+ nil
108
+ elsif lib_search_paths.length == 0 || File.exist?("/usr/lib/lib#{lib_name}.dylib")
109
+ "/usr/lib/lib#{lib_name}.dylib"
103
110
  else
104
- "#{lib_search_paths} -ObjC -l#{m[0]}"
111
+ "#{lib_search_paths} -ObjC -l#{lib_name}"
105
112
  end
106
- })
113
+ }.compact)
107
114
  @config.libs.uniq!
108
115
 
116
+ @config.vendor_project(PODS_ROOT, :xcode, {
117
+ :target => 'Pods',
118
+ :headers_dir => 'Headers/Public',
119
+ :products => pods_libs.map { |lib_name| "lib#{lib_name}.a" }
120
+ }.merge(@vendor_options))
121
+
109
122
  framework_search_paths = []
110
- if xcconfig['FRAMEWORK_SEARCH_PATHS']
111
- xcconfig['FRAMEWORK_SEARCH_PATHS'].scan(/\"([^\"]+)\"/) do |search_path|
112
- path = search_path.first.gsub!(/(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/, "#{@config.project_dir}/#{PODS_ROOT}")
113
- framework_search_paths << path if path
123
+ if search_paths = xcconfig['FRAMEWORK_SEARCH_PATHS']
124
+ search_paths = search_paths.strip
125
+ unless search_paths.empty?
126
+ search_paths.scan(/\"([^\"]+)\"/) do |search_path|
127
+ path = search_path.first.gsub!(/(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/, "#{@config.project_dir}/#{PODS_ROOT}")
128
+ framework_search_paths << path if path
129
+ end
130
+ # If we couldn't parse any search paths, then presumably nothing was properly quoted, so
131
+ # fallback to just assuming the whole value is one path.
132
+ if framework_search_paths.empty?
133
+ path = search_paths.gsub!(/(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/, "#{@config.project_dir}/#{PODS_ROOT}")
134
+ framework_search_paths << path if path
135
+ end
114
136
  end
115
137
  end
116
138
  frameworks = ldflags.scan(/-framework\s+([^\s]+)/).map { |m| m[0] }
@@ -122,10 +144,13 @@ module Motion::Project
122
144
  @config.frameworks.uniq!
123
145
 
124
146
  framework_search_paths.each do |framework_search_path|
125
- frameworks.each do |framework|
147
+ frameworks.reject! do |framework|
126
148
  path = File.join(framework_search_path, "#{framework}.framework")
127
149
  if File.exist?(path)
128
150
  @config.embedded_frameworks << path
151
+ true
152
+ else
153
+ false
129
154
  end
130
155
  end
131
156
  end
@@ -136,15 +161,21 @@ module Motion::Project
136
161
  # as a static library (which it is) with `-force_load` fixes this.
137
162
  #
138
163
  framework_search_paths.each do |framework_search_path|
139
- frameworks.each do |framework|
164
+ frameworks.reject! do |framework|
140
165
  path = File.join(framework_search_path, "#{framework}.framework")
141
166
  if File.exist?(path)
142
167
  @config.libs << "-force_load '#{File.join(path, framework)}'"
168
+ true
169
+ else
170
+ false
143
171
  end
144
172
  end
145
173
  end
146
174
  end
147
175
 
176
+ @config.frameworks.concat(frameworks)
177
+ @config.frameworks.uniq!
178
+
148
179
  @config.weak_frameworks.concat(ldflags.scan(/-weak_framework\s+([^\s]+)/).map { |m| m[0] })
149
180
  @config.weak_frameworks.uniq!
150
181
  end
@@ -239,7 +270,7 @@ module Motion::Project
239
270
  end
240
271
 
241
272
  def pods_xcconfig
242
- path = Pathname.new(@config.project_dir) + PODS_ROOT + 'Pods.xcconfig'
273
+ path = Pathname.new(@config.project_dir) + SUPPORT_FILES + 'Pods.release.xcconfig'
243
274
  Xcodeproj::Config.new(path) if path.exist?
244
275
  end
245
276
 
@@ -254,7 +285,7 @@ module Motion::Project
254
285
  #
255
286
  def resources
256
287
  resources = []
257
- File.open(Pathname.new(@config.project_dir) + PODS_ROOT + 'Pods-resources.sh') { |f|
288
+ File.open(Pathname.new(@config.project_dir) + SUPPORT_FILES + 'Pods-resources.sh') { |f|
258
289
  f.each_line do |line|
259
290
  if matched = line.match(/install_resource\s+(.*)/)
260
291
  path = (matched[1].strip)[1..-2]
@@ -24,6 +24,6 @@
24
24
 
25
25
  module Motion::Project
26
26
  class CocoaPods
27
- VERSION = '1.5.0'
27
+ VERSION = '1.6.0'
28
28
  end
29
29
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: motion-cocoapods
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Laurent Sansonetti
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-08 00:00:00.000000000 Z
11
+ date: 2014-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '>='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.32.1
19
+ version: '0.34'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '>='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.32.1
26
+ version: '0.34'
27
27
  description: motion-cocoapods allows RubyMotion projects to have access to the CocoaPods
28
28
  dependency manager.
29
29
  email: lrz@hipbyte.com