-
Notifications
You must be signed in to change notification settings - Fork 261
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consuming .xcframework #851
Comments
FWIW up to this point there hasn't been any work AFAIK on supporting xcframeworks. I would love to hear if others are working on this. |
There's some work currently in progress to develop a rule to produce an .xcframework bundle (with the goal of replacing We aren't working on anything to consume them, however. Interestingly, writing a single rule/macro to generalize consuming an .xcframework bundle wouldn't be straightforward. The internal directory names that include the platform, architectures, and simulator/device variant aren't strict requirements; Xcode may generate them in a certain way today, but all that really matters is the information in the Info.plist that maps those values to the correct .framework subdirectory. As far as Xcode is concerned, you could have It's not even safe to assume things like "well maybe iOS simulator frameworks will always be So that leaves us with basically what you've done; manually using † Maybe you could do this as a repository rule, where you could read the plist file and dynamically generate a framework import BUILD target from that, but it would require you to make each .xcframework a separate "repository", which may be inconvenient. That isn't something we'd work on. |
@allevato does it change anything that i am using entirely google code and this is a problem getting firebase to work with iOS and bazel? they distribute their code via i suppose not |
@sgammon Assuming the internal directory names are known beforehand, how are you handling building for multiple cpus? (e.g. with |
@sgammon Have you manage to add Firebase to Bazel project? |
@vchernyshov It is very possible to add Firebase to an iOS Project Infra/Pods:apple_xcframework_import.bzl (You will need to make config definitions for //Infra/Defs:development and //Infra/Defs:release, those are up to you to define)
WORKSPACE
//Infra/Pods/Firebase:BUILD
|
@tinder-maxwellelliott thanks a lot for you help But what do you mean: I'm not very familiar with Bazel so might ask very simple questions) I have managed to add Firebase with commented: I need to add Firestore as well but got the error when build the project: /var/tmp/_bazel_vchernyshov/8432bf40a9c3dc219067a8a2fb9ccda3/execroot/main/Infra/Pods/Firebase/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_i386_x86_64-simulator/BoringSSL-GRPC.framework/Modules/module.modulemap:1:28: Expected '{' to start module 'BoringSSL' /var/tmp/_bazel_vchernyshov/8432bf40a9c3dc219067a8a2fb9ccda3/execroot/main/Infra/Pods/Firebase/FirebaseFirestore/BoringSSL-GRPC.xcframework/ios-arm64_i386_x86_64-simulator/BoringSSL-GRPC.framework/Modules/module.modulemap:1:28: Expected module declaration |
@tinder-maxwellelliott I have manage to fix part of issues by removing module.modulemap files. |
First: Are you running your build with the flag Here is a simple way to create those defines definitions, the idea here is that we only want to target certain architectures for different build configs:
Also you should not remove the module map files, I did not have to do that to make this work |
Hello
rules_apple
authors,I am trying to use a
.xcframework
in an iOS app project (specifically, Firebase's static library, which contains.xcframework
s for various components).Is there a supported way to do this? I had tried via
apple_static_framework_import
, but found it rejecting anything not ending in.framework
. So, examining the structure of an.xcframework
, I tried:i am using this like so:
which roughly translates to:
is this the right way to consume
.xcframework
s?The text was updated successfully, but these errors were encountered: