A tool to generate all the binding files needed in a Xamarin binding library from a Cocoapods library. The generated binding files are both the fat libraries and definitions files (ApiDefinitions.cs and Structs.cs/StructAndEnums.cs) used later by the Binding library.
- Swift libraries ✅
- ObjectiveC libraries ✅
- Pods with dependencies ✅
- Pods from external sources ✅
- Xcode Command Line tools (can be downloaded in Xcode or from here)
- Cocoapods
- ObjectiveSharpie
Simply clone this repository.
To start using the tool, go to the repo folder and run this command:
sh build -p YOUR_POD_NAME
Optionally, you can specify both -s
(subspecs, separated by commas) and -l
(links to external sources, separated by commas) option.
Since Swift libraries are not officialy supported by Xamarin, the process of bulding these binding files is slightly different. First, you have to mark all the classes/structs/enums that you want to expose to the binding library with the
@objc
attribute. After doing so, you can start using the tool.
Once it finishes, you will get this output:
▸ Installing Pods... ✅
▸ Building libraries... ✅
▸ Creating fat libraries... ✅
▸ Creating binding files... ✅
SUCCESSFULLY COMPLETED 🚀
The output is similar but during the building, besides creating the binding files, these are normalized (thanks to SwiftClassify) with the correct names. Finally all the Swift libraries required by the binding library are listed.
▸ Installing Pods... ✅
▸ Building libraries... ✅
▸ Creating fat libraries... ✅
▸ Creating binding files... ✅
▸ Normalizing binding files... ✅
▸ Add these Swift libraries to your Xamarin App with NuGet:
AVFoundation
Core
CoreAudio
CoreFoundation
CoreGraphics
CoreImage
CoreLocation
CoreMedia
Darwin
Dispatch
Foundation
Metal
ObjectiveC
Photos
QuartzCore
UIKit
os
simd
SUCCESSFULLY COMPLETED 🚀