xcframework_converter 0.1.1 → 0.1.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
  SHA256:
3
- metadata.gz: 73791ebb8115008970a6beb4f8365313af86757023c0e04046410be09c58bf11
4
- data.tar.gz: d4f69fa6eba4f1f501b6dd382719efeb8a3ece77926b2b39a79c8e09e8ff2206
3
+ metadata.gz: c41a9ff61dd6eb5eb00492d2ed59d9a235a3d3085189bff9351d9d6ab175e548
4
+ data.tar.gz: b9784bac37bb57065f29a70bb8ec4a7ae19f6a6716375018d2253bb0d6c362cf
5
5
  SHA512:
6
- metadata.gz: 33020857576ceb88146c5fed0d793e28daaf653f06ba904eb4f24a9cc56cf504edc7152aab68b249ab026d0e2f89aca32b2890d0e80b1f74613933f35da3d7e8
7
- data.tar.gz: 8130336cd0406ee3386cf3b89fc2bf687d7b2ae20bacc46cb82986b5058f925e4a89e3f2b4c7ca0a0ddc5b5faf4275e70eb4f238929eaf0fc6344554b0723941
6
+ metadata.gz: f0b0c2d69c02d311046d6dcb2e465d0fe18b7e34409cf423f29fe473117232ab3b39c623a90709586d79d1b5caeb2d5be20986bd730b44e2b3da9809338cb7c0
7
+ data.tar.gz: dcab8fdcf810162e00b70b214bd43c41c61b852e294689c819c1d03a456bed13068cd16e7f9956cff42a19871ac1b8c97a6e77c6273686ef8f524fc69b8c09ec
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XCFrameworkConverter
4
- VERSION = '0.1.1'
4
+ VERSION = '0.1.2'
5
5
  end
@@ -17,30 +17,34 @@ module XCFrameworkConverter
17
17
  class << self
18
18
  def convert_frameworks_to_xcframeworks!(installer)
19
19
  installer.analysis_result.specifications.each do |spec|
20
- next unless spec.attributes_hash['vendored_frameworks']
20
+ next if spec.source && spec.local?
21
21
 
22
- frameworks = Array(spec.attributes_hash['vendored_frameworks'])
23
- unconverted_frameworks = frameworks.select { |f| File.extname(f) == '.framework' }
24
- next if unconverted_frameworks.empty?
25
- next if spec.local?
22
+ frameworks_to_convert = spec.available_platforms.map do |platform|
23
+ consumer = Pod::Specification::Consumer.new(spec, platform)
24
+ before_rename = consumer.vendored_frameworks.select { |f| File.extname(f) == '.framework' }
25
+ next [] if before_rename.empty?
26
+
27
+ after_rename = before_rename.map { |f| Pathname.new(f).sub_ext('.xcframework').to_s }
28
+ proxy = Pod::Specification::DSL::PlatformProxy.new(spec, platform.symbolic_name)
29
+ proxy.vendored_frameworks = consumer.vendored_frameworks - before_rename + after_rename
30
+ before_rename
31
+ end.flatten.uniq
32
+
33
+ next if frameworks_to_convert.empty?
26
34
 
27
35
  pod_path = installer.sandbox.pod_dir(Pod::Specification.root_name(spec.name))
28
- convert_xcframeworks_if_present(pod_path)
36
+ convert_xcframeworks_if_present(frameworks_to_convert.map { |f| pod_path.join(f) })
29
37
 
30
- converted_frameworks = unconverted_frameworks.map do |path|
31
- Pathname.new(path).sub_ext('.xcframework').to_s
32
- end
33
- spec.attributes_hash['vendored_frameworks'] = frameworks - unconverted_frameworks + converted_frameworks
34
38
  # some pods put these as a way to NOT support arm64 sim
39
+ # may stop working if a pod decides to put these in a platform proxy
35
40
  spec.attributes_hash['pod_target_xcconfig']&.delete('EXCLUDED_ARCHS[sdk=iphonesimulator*]')
36
41
  spec.attributes_hash['user_target_xcconfig']&.delete('EXCLUDED_ARCHS[sdk=iphonesimulator*]')
37
42
  end
38
43
  end
39
44
 
40
- def convert_xcframeworks_if_present(pod_path)
41
- unconverted_paths = Dir[pod_path.join('**/*.framework')] - Dir[pod_path.join('**/*.xcframework/**/*')]
42
- unconverted_paths.each do |path|
43
- convert_framework_to_xcframework(path)
45
+ def convert_xcframeworks_if_present(frameworks_to_convert)
46
+ frameworks_to_convert.each do |path|
47
+ convert_framework_to_xcframework(path) if Dir.exist?(path)
44
48
  end
45
49
  end
46
50
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xcframework_converter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Igor Makarov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-08-01 00:00:00.000000000 Z
11
+ date: 2021-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods