xcframework_converter 0.3.1 → 0.3.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 +4 -4
- data/lib/arm2sim.swift +4 -2
- data/lib/xcframework_converter/arm_patcher.rb +2 -0
- data/lib/xcframework_converter/version.rb +1 -1
- data/lib/xcframework_converter.rb +24 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b4026adcb50f4a5beae016b1df87c2b95c84062d3ddb5f4aa480127ef334d0ef
|
4
|
+
data.tar.gz: 6b4b75587762fa609056196b16c2560065db7351924dafe4915ca158a10fb1d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c9460cf57bfb886843148ae1353759c57149ff4de6d1963f363e094354bf2290277e1c4bc409c259ee968a65cee3f97190754717d0a9ad4871dac957276705fe
|
7
|
+
data.tar.gz: 0c63408a190166c3f9ca44de4734497e91ff57c1574738647e3eebe7ca6a07deba9d6deacb16a9fcc04d8e39e7f80cd8989c3b8d146a5c501e6f796646a66d9b
|
data/lib/arm2sim.swift
CHANGED
@@ -77,8 +77,10 @@ enum Transmogrifier {
|
|
77
77
|
|
78
78
|
let offsetSections = sections.map { section -> section_64 in
|
79
79
|
var section = section
|
80
|
-
section.
|
81
|
-
|
80
|
+
if section.flags != S_ZEROFILL {
|
81
|
+
section.offset += UInt32(offset)
|
82
|
+
section.reloff += section.reloff > 0 ? UInt32(offset) : 0
|
83
|
+
}
|
82
84
|
return section
|
83
85
|
}
|
84
86
|
|
@@ -56,7 +56,9 @@ module XCFrameworkConverter
|
|
56
56
|
file = MachO::MachOFile.new(object_file)
|
57
57
|
sdk_version = file[:LC_VERSION_MIN_IPHONEOS].first.version_string.to_i
|
58
58
|
`xcrun swift \"#{arm2sim_path}\" \"#{object_file}\" \"#{sdk_version}\" \"#{sdk_version}\"`
|
59
|
+
$stderr.printf '.'
|
59
60
|
end
|
61
|
+
$stderr.puts
|
60
62
|
`cd \"#{extracted_path_dir}\" ; ar crv \"#{extracted_path}\" *.o`
|
61
63
|
|
62
64
|
`xcrun lipo \"#{slice.binary_path}\" -replace arm64 \"#{extracted_path}\" -output \"#{slice.binary_path}\"`
|
@@ -42,10 +42,12 @@ module XCFrameworkConverter
|
|
42
42
|
before_rename.map { |f| pod_path.join(f) }
|
43
43
|
end.flatten.uniq
|
44
44
|
|
45
|
-
|
45
|
+
remember_spec_as_patched(spec) unless frameworks_to_convert.empty?
|
46
46
|
|
47
47
|
remove_troublesome_xcconfig_items(spec)
|
48
48
|
end
|
49
|
+
|
50
|
+
warn "Specs with patched XCFrameworks: #{@patched_specs.sort.join(', ')}"
|
49
51
|
end
|
50
52
|
|
51
53
|
def convert_xcframeworks_if_present(frameworks_to_convert)
|
@@ -61,12 +63,27 @@ module XCFrameworkConverter
|
|
61
63
|
end
|
62
64
|
|
63
65
|
def remove_troublesome_xcconfig_items(spec)
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
spec.attributes_hash[
|
68
|
-
|
69
|
-
|
66
|
+
xcconfigs = %w[
|
67
|
+
pod_target_xcconfig
|
68
|
+
user_target_xcconfig
|
69
|
+
].map { |key| spec.attributes_hash[key] }.compact
|
70
|
+
|
71
|
+
xcconfigs.each do |xcconfig|
|
72
|
+
# some pods put these as a way to NOT support arm64 sim
|
73
|
+
# may stop working if a pod decides to put these in a platform proxy
|
74
|
+
excluded_arm = xcconfig['EXCLUDED_ARCHS[sdk=iphonesimulator*]']&.include?('arm64')
|
75
|
+
not_inlcuded_arm = xcconfig['VALID_ARCHS[sdk=iphonesimulator*]'] && !xcconfig['VALID_ARCHS[sdk=iphonesimulator*]'].include?('arm64')
|
76
|
+
|
77
|
+
remember_spec_as_patched(spec) if excluded_arm || not_inlcuded_arm
|
78
|
+
|
79
|
+
xcconfig.delete('EXCLUDED_ARCHS[sdk=iphonesimulator*]')
|
80
|
+
xcconfig.delete('VALID_ARCHS[sdk=iphonesimulator*]')
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
def remember_spec_as_patched(spec)
|
85
|
+
@patched_specs ||= Set.new
|
86
|
+
@patched_specs << spec.root.name
|
70
87
|
end
|
71
88
|
end
|
72
89
|
end
|
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.3.
|
4
|
+
version: 0.3.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: 2022-01-
|
11
|
+
date: 2022-01-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cocoapods
|