xcframework_converter 0.1.0 → 0.1.1

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: 261230f022e462a9840a009590e212c543833902b44795f80476971ff828dae7
4
- data.tar.gz: 5a383fe7e654d79ea3d292a6369e4ba1d1b177c03f8967c9d6ec4fca2d942563
3
+ metadata.gz: 73791ebb8115008970a6beb4f8365313af86757023c0e04046410be09c58bf11
4
+ data.tar.gz: d4f69fa6eba4f1f501b6dd382719efeb8a3ece77926b2b39a79c8e09e8ff2206
5
5
  SHA512:
6
- metadata.gz: c284b721156bc30b0e818d8048513c023c2e931cb659d7211959f356c08f36f133a61494078edb35b24b490ccd6b15b5c71d7c61b1a42b6da14adab664517700
7
- data.tar.gz: 2be83f317ea5fa0e2e108ac81cbfbfaf1095c5738559555fafabcf0f215efaf1c08308f6f01b6fd337b1a190bc319367c7634e6a00a73a0ccbf029edd7471683
6
+ metadata.gz: 33020857576ceb88146c5fed0d793e28daaf653f06ba904eb4f24a9cc56cf504edc7152aab68b249ab026d0e2f89aca32b2890d0e80b1f74613933f35da3d7e8
7
+ data.tar.gz: 8130336cd0406ee3386cf3b89fc2bf687d7b2ae20bacc46cb82986b5058f925e4a89e3f2b4c7ca0a0ddc5b5faf4275e70eb4f238929eaf0fc6344554b0723941
data/README.md CHANGED
@@ -1,9 +1,9 @@
1
- # XcframeworkConverter
2
-
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/xcframework_converter`. To experiment with that code, run `bin/console` for an interactive prompt.
4
-
5
- TODO: Delete this and the text above, and describe your gem
1
+ # XCFrameworkConverter
2
+ [![Gem](https://img.shields.io/gem/v/xcframework_converter.svg)](https://rubygems.org/gems/xcframework_converter)
3
+ [![Twitter: @igormaka](https://img.shields.io/badge/contact-@igormaka-blue.svg?style=flat)](https://twitter.com/igormaka)
4
+ [![License](https://img.shields.io/badge/license-MIT-green.svg?style=flat)](./LICENSE.txt)
6
5
 
6
+ This little gem allows to take an ancient `.framework` (static or dynamic), and turn it into a fully fledged `.xcframework`. In addition, it will patch the binary to add an `arm64` simulator slice. There's also a CocoaPods patcher that allows this to operate without customizing the `Podfile` dependencies.
7
7
  ## Installation
8
8
 
9
9
  Add this line to your application's Gemfile:
@@ -22,17 +22,40 @@ Or install it yourself as:
22
22
 
23
23
  ## Usage
24
24
 
25
- TODO: Write usage instructions here
25
+ ### CLI
26
+
27
+ ```bash
28
+ xcfconvert <path/to/Framework.framework>
29
+ ```
30
+
31
+ ### CocoaPods
32
+ In your podfile:
33
+ ```ruby
34
+ require 'xcframework_converter'
35
+ # Define your dependencies...
36
+ pre_install do |installer|
37
+ XCFrameworkConverter.convert_frameworks_to_xcframeworks!(installer)
38
+ end
39
+ ```
40
+
41
+ This will achieve two things:
42
+
43
+ 1. When a pod with vendored `.framework`-s is added, they will be converted to `.xcframework`-s.
44
+ 2. Upon each `pod install`, the corresponding pod specifications will be patched so that the project will consume the `.xcframework`-s correctly.
45
+
46
+ ## Is it reliable?
47
+ Sort of. The software is provided as is, with no guarantees of correctnes. It's meant to be a workaround. For the correct solution, ask the framework vendor for an update. However, PRs are welcome.
26
48
 
27
- ## Development
49
+ ## How does it work?
50
+ An XCFramework is basically a bundle of folders.
28
51
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
52
+ The tool will create the folder and its subfolders, write the correct `Info.plist`, and clean up the relevant fat binary files so that they contain only the relevant architectures.
30
53
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).
54
+ Additionally, the tool will create a new, patched `arm64` binary for the iOS Simulator. For that, it uses the code and knowledge of [Bogo Giertler](https://github.com/bogo). The binary patching code is embedded in the gem. For more info, check Bogo's blog for the posts on how to patch a [static library](https://bogo.wtf/arm64-to-sim.html) and a [dynamic library](https://bogo.wtf/arm64-to-sim-dylibs.html).
32
55
 
33
56
  ## Contributing
34
57
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/xcframework_converter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/xcframework_converter/blob/master/CODE_OF_CONDUCT.md).
58
+ Pull requests are welcome on GitHub at https://github.com/igor-makarov/XCFrameworkConverter. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/igor-makarov/XCFrameworkConverter/blob/master/CODE_OF_CONDUCT.md).
36
59
 
37
60
  ## License
38
61
 
@@ -40,4 +63,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
40
63
 
41
64
  ## Code of Conduct
42
65
 
43
- Everyone interacting in the XcframeworkConverter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/xcframework_converter/blob/master/CODE_OF_CONDUCT.md).
66
+ Everyone interacting in the XcframeworkConverter project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/igor-makarov/XCFrameworkConverter/blob/master/CODE_OF_CONDUCT.md).
@@ -76,6 +76,10 @@ module XCFrameworkConverter
76
76
  when :static
77
77
  patch_arm_binary_static(slice)
78
78
  end
79
+
80
+ slice.path.glob('**/arm64*.swiftinterface').each do |interface_file|
81
+ `sed -i '' -E 's/target arm64-apple-ios([0-9.]+) /target arm64-apple-ios\\1-simulator /g' "#{interface_file}"`
82
+ end
79
83
  end
80
84
 
81
85
  def patch_arm_binary_dynamic(slice)
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module XCFrameworkConverter
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  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.1.0
4
+ version: 0.1.1
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-07-19 00:00:00.000000000 Z
11
+ date: 2021-08-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cocoapods