motion-cocoapods 1.4.1 → 1.4.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 86d6c7c5167227a973fe0471b633907426c97ef4
4
- data.tar.gz: 141d2122cd94435963fac2d43b98ad7dd9d8233a
3
+ metadata.gz: ef187da4dff56e88c14542a23a6970acd36a7d2c
4
+ data.tar.gz: 18f39aadb0cb87d277370ee3ea15a9f5f922252a
5
5
  SHA512:
6
- metadata.gz: dc9acbed9f856e730a9cd7ec6c3366249ef9f700247e17cf32c9f76fc143f02e3e708159c9f8192a89945e045b801782fe3cad96e85b2b3c2eb7bd62a5310001
7
- data.tar.gz: 2ea6e87fb6126226178fd6b708a9890f183c13b2e53520f33d5efa27c888c0ad1b950958b96ae226b6387dcbae963a746c95b46a83ed39b425304154f11d039e
6
+ metadata.gz: b90490505d1693ae1e49994f1d0b179451a7181b6e78889cd740e506bfd4f7afb0d6ca610d0dbb555137eab8e85a74ebe5242a5cefc87fda1b566d5bf2ab2e10
7
+ data.tar.gz: cf9c42b17299bae6b8176de40f0a1853b97698ea500f7a98255dcbd0ccc69428736b7a576872ec37c8a8999b40b9bc1f0b0e7fea4c20422756288d96f65b4e13
@@ -91,20 +91,10 @@ module Motion::Project
91
91
  @config.resources_dirs << resources_dir.to_s
92
92
 
93
93
  # TODO replace this all once Xcodeproj has the proper xcconfig parser.
94
- if (xcconfig = self.pods_xcconfig) && ldflags = xcconfig.to_hash['OTHER_LDFLAGS']
95
- lib_search_paths = xcconfig.to_hash['LIBRARY_SEARCH_PATHS'] || ""
94
+ if (xcconfig = self.pods_xcconfig_hash) && ldflags = xcconfig['OTHER_LDFLAGS']
95
+ lib_search_paths = xcconfig['LIBRARY_SEARCH_PATHS'] || ""
96
96
  lib_search_paths.gsub!('$(PODS_ROOT)', "-L#{@config.project_dir}/#{PODS_ROOT}")
97
97
 
98
- framework_search_paths = xcconfig.to_hash['FRAMEWORK_SEARCH_PATHS']
99
- if framework_search_paths
100
- framework_search_paths.scan(/\"([^\"]+)\"/) do |search_path|
101
- path = search_path.first.gsub!(/(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/, "#{@config.project_dir}/#{PODS_ROOT}")
102
- @config.framework_search_paths << path if path
103
- end
104
- end
105
-
106
- @config.frameworks.concat(ldflags.scan(/-framework\s+([^\s]+)/).map { |m| m[0] })
107
- @config.frameworks.uniq!
108
98
  @config.libs.concat(ldflags.scan(/-l([^\s]+)/).map { |m|
109
99
  if lib_search_paths.length == 0 || File.exist?("/usr/lib/lib#{m[0]}.dylib")
110
100
  "/usr/lib/lib#{m[0]}.dylib"
@@ -112,9 +102,34 @@ module Motion::Project
112
102
  "#{lib_search_paths} -ObjC -l#{m[0]}"
113
103
  end
114
104
  })
105
+ @config.libs.uniq!
106
+
107
+ framework_search_paths = []
108
+ if xcconfig['FRAMEWORK_SEARCH_PATHS']
109
+ xcconfig['FRAMEWORK_SEARCH_PATHS'].scan(/\"([^\"]+)\"/) do |search_path|
110
+ path = search_path.first.gsub!(/(\$\(PODS_ROOT\))|(\$\{PODS_ROOT\})/, "#{@config.project_dir}/#{PODS_ROOT}")
111
+ framework_search_paths << path if path
112
+ end
113
+ end
114
+ @config.framework_search_paths.concat(framework_search_paths)
115
+
116
+ frameworks = ldflags.scan(/-framework\s+([^\s]+)/).map { |m| m[0] }
117
+ @config.frameworks.concat(frameworks)
118
+ @config.frameworks.uniq!
119
+
120
+ if @config.deploy_platform == 'MacOSX'
121
+ framework_search_paths.each do |framework_search_path|
122
+ frameworks.each do |framework|
123
+ path = File.join(framework_search_path, "#{framework}.framework")
124
+ if File.exist?(path)
125
+ @config.embedded_frameworks << path
126
+ end
127
+ end
128
+ end
129
+ end
130
+
115
131
  @config.weak_frameworks.concat(ldflags.scan(/-weak_framework\s+([^\s]+)/).map { |m| m[0] })
116
132
  @config.weak_frameworks.uniq!
117
- @config.libs.uniq!
118
133
  end
119
134
  end
120
135
 
@@ -161,11 +176,12 @@ module Motion::Project
161
176
  end
162
177
 
163
178
  # TODO this probably breaks in cases like resource bundles etc, need to test.
179
+ #
164
180
  def install_resources
165
181
  FileUtils.mkdir_p(resources_dir)
166
182
  resources.each do |file|
167
183
  begin
168
- FileUtils.cp_r file, resources_dir if file.exist?
184
+ FileUtils.cp_r(file, resources_dir) if file.exist?
169
185
  rescue ArgumentError => exc
170
186
  unless exc.message =~ /same file/
171
187
  raise
@@ -174,13 +190,17 @@ module Motion::Project
174
190
  end
175
191
  end
176
192
 
193
+ HEADERS_ROOT = File.join(PODS_ROOT, 'Headers')
194
+
177
195
  def copy_cocoapods_env_and_prefix_headers
178
196
  headers = Dir.glob(["#{PODS_ROOT}/*.h", "#{PODS_ROOT}/*.pch"])
179
197
  headers.each do |header|
180
198
  src = File.basename(header)
181
199
  dst = src.sub(/\.pch$/, '.h')
182
- unless File.exist?("#{PODS_ROOT}/Headers/____#{dst}")
183
- FileUtils.cp("#{PODS_ROOT}/#{src}", "#{PODS_ROOT}/Headers/____#{dst}")
200
+ dst_path = File.join(HEADERS_ROOT, "____#{dst}")
201
+ unless File.exist?(dst_path)
202
+ FileUtils.mkdir_p(HEADERS_ROOT)
203
+ FileUtils.cp(File.join(PODS_ROOT, src), dst_path)
184
204
  end
185
205
  end
186
206
  end
@@ -206,6 +226,15 @@ module Motion::Project
206
226
  Xcodeproj::Config.new(path) if path.exist?
207
227
  end
208
228
 
229
+ def pods_xcconfig_hash
230
+ if xcconfig = pods_xcconfig
231
+ xcconfig.to_hash
232
+ end
233
+ end
234
+
235
+ # Do not copy `.framework` bundles, these should be handled through RM's
236
+ # `embedded_frameworks` config attribute.
237
+ #
209
238
  def resources
210
239
  resources = []
211
240
  File.open(Pathname.new(@config.project_dir) + PODS_ROOT + 'Pods-resources.sh') { |f|
@@ -213,7 +242,9 @@ module Motion::Project
213
242
  if matched = line.match(/install_resource\s+(.*)/)
214
243
  path = (matched[1].strip)[1..-2]
215
244
  path.sub!("${BUILD_DIR}/${CONFIGURATION}${EFFECTIVE_PLATFORM_NAME}", ".build")
216
- resources << Pathname.new(@config.project_dir) + PODS_ROOT + path
245
+ unless File.extname(path) == '.framework'
246
+ resources << Pathname.new(@config.project_dir) + PODS_ROOT + path
247
+ end
217
248
  end
218
249
  end
219
250
  }
@@ -232,7 +263,8 @@ namespace :pod do
232
263
  $stderr.puts '[!] The COCOCAPODS_NO_UPDATE env variable has been deprecated, use COCOAPODS_NO_REPO_UPDATE instead.'
233
264
  ENV['COCOAPODS_NO_REPO_UPDATE'] = '1'
234
265
  end
235
- Pod::SourcesManager.update(nil, true) unless ENV['COCOAPODS_NO_REPO_UPDATE']
266
+ show_output = !ENV['COCOAPODS_NO_REPO_UPDATE_OUTPUT']
267
+ Pod::SourcesManager.update(nil, show_output) unless ENV['COCOAPODS_NO_REPO_UPDATE']
236
268
  end
237
269
 
238
270
  desc "Download and integrate newly added pods"
@@ -24,6 +24,6 @@
24
24
 
25
25
  module Motion::Project
26
26
  class CocoaPods
27
- VERSION = '1.4.1'
27
+ VERSION = '1.4.2'
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.4.1
4
+ version: 1.4.2
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-04-15 00:00:00.000000000 Z
11
+ date: 2014-05-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods