Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
I'm opening this based on our discussion in #2640.
@paxbun can you take a look at the new Swift code and tell me if you think this would work for Gobley?
This is a new way for binding generators to load the CIs, Configs, metadata, etc. I'm hoping that this can replace the
generate_bindingsandgenerate_external_bindingsfunctions, as well some other functions likelibrary_mode::find_components.The goal for the new design is to let bindings generators drive the process instead of a function like
generate_external_bindings. The advantage of this is that it's easier to customize and we don't need to keep adding new hook methods. It also feels simpler overall to me. See #2640 for a discussion of this.If we adopt this new system, then I think we can use it to remove a bunch of duplicate code. We can keep around the old functions for backwards-compatibility, but I think they can just be wrappers around
BindgenLoader. Also, we should figure out a nice way to hook this up to the pipeline code.Made
uniffi-bindgen-swiftuse the new system. This was mostly to test the code and to serve as an example, but a nice side-benefit is thatuniffi-bindgen-swiftnow can handle UDL files. I also added auniffi-bindgen-swiftbinary file to go with theuniffi-bindgenbinary.