Bug: rules_ios apple_framework does not support SwiftUI Previews in rules_xcodeproj #2612
Labels
3rd party rules
Related to rules other than Bazel core, rules_apple, or rules_swift
bug
Something isn't working
Milestone
Description
SwiftUI Previews do not work for
rules_ios
apple_framework
targets inrules_xcodeproj
. This can be seen in the existingrules_ios
example in the repo by using theContentView.swift
file in theUI
module.By default, the swift files in the
apple_framework
target only show as included for the static library target created byrules_ios
, not the framework target. This prevents the preview from working since it needs to be a part of the framework target.If I manually add the the SwiftUI preview file to the framework target and select that framework as the current scheme in my xcodeproj, I receive an error.
I also tried adding
link_dynamic = True
to the UIapple_framework
target and resolving the Info.plist issues that came with that, but I still received the same error.Thanks so much!
Reproduction steps
You can use the
rules_ios
example in this repo with theContentView.swift
SwiftUI preview in the UI module, and follow the steps I tried above to see the outputs.Expected behavior
It would be awesome if SwiftUI Previews were supported with minimal configuration needed in
rules_ios
apple_framework
targets that are used inrules_xcodeproj
.rules_xcodeproj version
1.9.1
Xcode version
14.2
Bazel version
6.2.1
rules_apple version
No response
rules_swift version
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: