cocoapods-binary 0.4.1 → 0.4.2

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
  SHA256:
3
- metadata.gz: c8b8187b94eb261901bdf3928c51898d18cf5311b4982df4b8f32f3f55503979
4
- data.tar.gz: 0d7c322deb6c7d748d4baa1984bc35998667223a1bb01551384de1e66f1e8d99
3
+ metadata.gz: 7ebe2820b8d3d2cabfc7a79d7e57644b5df906fb5f61fb7c136e3aa9ea22b19b
4
+ data.tar.gz: 7d0c1a5aff106c377d73f9b53fec4ea8780dbfc52f9b37da045bfa57c1ea7bfa
5
5
  SHA512:
6
- metadata.gz: 389815bb325e9d6552d47d719e371e5da8aa87d461dd43c5044cfa42e9d948539beeb4e422f7d87550448b99a4731fa7807586f683846b6036fa716f477cbca5
7
- data.tar.gz: 6516ee84a6669411f0f2351afed475959249b76c82fb5718b90d74d441801980cd60b5c9b42de693f35ab3e857558efed7cb6ae74e7065b44b7be4293a2ee09e
6
+ metadata.gz: c2ca624a8759c99d8f0ab69ffab1c1373de433c2e6613ba6c5e302515dfb3b42f562de56f6858b3668470cd86270ff0ad53b89033dcbf5c9757730fc9d57e931
7
+ data.tar.gz: feadddc03f4594a08782f29d53ef101c4d3a78a2aeaa253c8e9b6777991477995f3b8a191770571c3958472e12335b51a54a2ddd2580d3cbb1ade46a3ad0a0d4
@@ -55,7 +55,7 @@ module Pod
55
55
  walk(real_file_folder) do |child|
56
56
  source = child
57
57
  # only make symlink to file and `.framework` folder
58
- if child.directory? and child.extname == ".framework"
58
+ if child.directory? and [".framework", ".dSYM"].include? child.extname
59
59
  mirror_with_symlink(source, real_file_folder, target_folder)
60
60
  next false # return false means don't go deeper
61
61
  elsif child.file?
@@ -167,6 +167,32 @@ module Pod
167
167
  spec.attributes_hash["vendored_frameworks"] = original_vendored_frameworks
168
168
  spec.attributes_hash["source_files"] = []
169
169
 
170
+ # to remove the resurce bundle target.
171
+ # When specify the "resource_bundles" in podspec, xcode will generate a bundle
172
+ # target after pod install. But the bundle have already built when the prebuit
173
+ # phase and saved in the framework folder. We will treat it as a normal resource
174
+ # file.
175
+ # https://github.com/leavez/cocoapods-binary/issues/29
176
+ if spec.attributes_hash["resource_bundles"]
177
+ bundle_names = spec.attributes_hash["resource_bundles"].keys
178
+ spec.attributes_hash["resource_bundles"] = nil
179
+ spec.attributes_hash["resources"] ||= []
180
+ spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
181
+ end
182
+
183
+ # to remove the resurce bundle target.
184
+ # When specify the "resource_bundles" in podspec, xcode will generate a bundle
185
+ # target after pod install. But the bundle have already built when the prebuit
186
+ # phase and saved in the framework folder. We will treat it as a normal resource
187
+ # file.
188
+ # https://github.com/leavez/cocoapods-binary/issues/29
189
+ if spec.attributes_hash["resource_bundles"]
190
+ bundle_names = spec.attributes_hash["resource_bundles"].keys
191
+ spec.attributes_hash["resource_bundles"] = nil
192
+ spec.attributes_hash["resources"] ||= []
193
+ spec.attributes_hash["resources"] += bundle_names.map{|n| n+".bundle"}
194
+ end
195
+
170
196
  # to avoid the warning of missing license
171
197
  spec.attributes_hash["license"] = {}
172
198
  end
@@ -217,8 +243,9 @@ module Pod
217
243
  # ---- this is added by cocoapods-binary ---
218
244
  # Readlink cannot handle relative symlink well, so we override it to a new one
219
245
  # If the path isn't an absolute path, we add a realtive prefix.
246
+ old_read_link=`which readlink`
220
247
  readlink () {
221
- path=`/usr/bin/readlink $1`;
248
+ path=`$old_read_link $1`;
222
249
  if [ $(echo "$path" | cut -c 1-1) = '/' ]; then
223
250
  echo $path;
224
251
  else
@@ -227,6 +254,10 @@ module Pod
227
254
  }
228
255
  # ---
229
256
  SH
257
+
258
+ # patch the rsync for copy dSYM symlink
259
+ script = script.gsub "rsync --delete", "rsync --copy-links --delete"
260
+
230
261
  patch + script
231
262
  end
232
263
  end
@@ -64,6 +64,18 @@ Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_conte
64
64
 
65
65
  Pod::UI.puts "🚀 Prebuild frameworks"
66
66
 
67
+ # Fetch original installer (which is running this pre-install hook) options,
68
+ # then pass them to our installer to perform update if needed
69
+ # Looks like this is the most appropriate way to figure out that something should be updated
70
+
71
+ update = nil
72
+ repo_update = nil
73
+
74
+ include ObjectSpace
75
+ ObjectSpace.each_object(Pod::Installer) { |installer|
76
+ update = installer.update
77
+ repo_update = installer.repo_update
78
+ }
67
79
 
68
80
  # control features
69
81
  Pod.is_prebuild_stage = true
@@ -80,13 +92,14 @@ Pod::HooksManager.register('cocoapods-binary', :pre_install) do |installer_conte
80
92
  prebuild_podfile = Pod::Podfile.from_ruby(podfile.defined_in_file)
81
93
 
82
94
  # install
83
- binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile , nil)
95
+ lockfile = installer_context.lockfile
96
+ binary_installer = Pod::Installer.new(prebuild_sandbox, prebuild_podfile, lockfile)
84
97
 
85
- if binary_installer.have_exact_prebuild_cache?
98
+ if binary_installer.have_exact_prebuild_cache? && !update
86
99
  binary_installer.install_when_cache_hit!
87
100
  else
88
- binary_installer.repo_update = false
89
- binary_installer.update = false
101
+ binary_installer.update = update
102
+ binary_installer.repo_update = repo_update
90
103
  binary_installer.install!
91
104
  end
92
105
 
@@ -126,10 +126,11 @@ module Pod
126
126
  if target.static_framework? and !target.resource_paths.empty?
127
127
  framework_path = output_path + target.framework_name
128
128
  standard_sandbox_path = sandbox.standard_sanbox_path
129
- path_objects = target.resource_paths.select{|f| f.start_with? "${PODS_ROOT}"}.map do |path|
129
+ path_objects = target.resource_paths.map do |path|
130
130
  object = Prebuild::Passer::ResourcePath.new
131
131
  object.real_file_path = framework_path + File.basename(path)
132
- object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s)
132
+ object.target_file_path = path.gsub('${PODS_ROOT}', standard_sandbox_path.to_s) if path.start_with? '${PODS_ROOT}'
133
+ object.target_file_path = path.gsub("${PODS_CONFIGURATION_BUILD_DIR}", standard_sandbox_path.to_s) if path.start_with? "${PODS_CONFIGURATION_BUILD_DIR}"
133
134
  object
134
135
  end
135
136
  Prebuild::Passer.resources_to_copy_for_static_framework[target.name] = path_objects
@@ -1,3 +1,3 @@
1
1
  module CocoapodsBinary
2
- VERSION = "0.4.1"
2
+ VERSION = "0.4.2"
3
3
  end
@@ -11,13 +11,16 @@ module Pod
11
11
 
12
12
  ## --- option for setting using prebuild framework ---
13
13
  def parse_prebuild_framework(name, requirements)
14
+ should_prebuild = Pod::Podfile::DSL.prebuild_all
15
+
14
16
  options = requirements.last
15
- return requirements unless options.is_a?(Hash)
17
+ if options.is_a?(Hash) && options[Pod::Prebuild.keyword] != nil
18
+ should_prebuild = options.delete(Pod::Prebuild.keyword)
19
+ requirements.pop if options.empty?
20
+ end
16
21
 
17
- should_prebuild_framework = options.delete(Pod::Prebuild.keyword)
18
22
  pod_name = Specification.root_name(name)
19
- set_prebuild_for_pod(pod_name, should_prebuild_framework)
20
- requirements.pop if options.empty?
23
+ set_prebuild_for_pod(pod_name, should_prebuild)
21
24
  end
22
25
 
23
26
  def set_prebuild_for_pod(pod_name, should_prebuild)
@@ -24,7 +24,7 @@ def build_for_iosish_platform(sandbox,
24
24
 
25
25
  other_options = []
26
26
  if bitcode_enabled
27
- other_options += ['OTHER_CFLAGS="-fembed-bitcode"']
27
+ other_options += ['BITCODE_GENERATION_MODE=bitcode']
28
28
  end
29
29
  xcodebuild(sandbox, target_label, device, deployment_target, other_options)
30
30
  xcodebuild(sandbox, target_label, simulator, deployment_target, other_options + ['ARCHS=x86_64', 'ONLY_ACTIVE_ARCH=NO'])
@@ -53,6 +53,17 @@ def build_for_iosish_platform(sandbox,
53
53
  FileUtils.cp_r simulator_swiftmodule_path + "/.", device_swiftmodule_path
54
54
  end
55
55
 
56
+ # handle the dSYM files
57
+ device_dsym = "#{device_framwork_path}.dSYM"
58
+ if File.exist? device_dsym
59
+ # lipo the simulator dsym
60
+ tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft"
61
+ lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}`
62
+ puts lipo_log unless File.exist?(tmp_lipoed_binary_path)
63
+ FileUtils.mv tmp_lipoed_binary_path, "#{device_framwork_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true
64
+ FileUtils.mv device_dsym, output_path, :force => true
65
+ end
66
+
56
67
  # output
57
68
  output_path.mkpath unless output_path.exist?
58
69
  FileUtils.mv device_framwork_path, output_path, :force => true
@@ -134,4 +145,3 @@ module Pod
134
145
 
135
146
  end
136
147
  end
137
-
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocoapods-binary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - leavez
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-03 00:00:00.000000000 Z
11
+ date: 2019-03-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods