-
Notifications
You must be signed in to change notification settings - Fork 77
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
Add experimental device_and_simulator
rule
#507
Conversation
c0798b2
to
3f1bf9f
Compare
Ideally we wouldn't need another rule for this, but when applying the split transition (which is needed in order to get both simulator and device builds in the same build graph) we can't see any details of the target the transition is being applied to. And we can't blindly apply the transition, because rules that don't have the rules_apple transition (mainly Maybe there is a way, either in Starlark or Either way, I think we should take this change as is, but think about ways to improve the UX of the API. |
Ohh, also, if a rule doesn't have a |
a739882
to
188caa9
Compare
This rule is experimental because it might not be the right API to enable proper device support, but it's better to get something out there so we can iterate on the support. Also updated the multiplatform example to use the `device_and_simulator` rule. Of note, the `//examples/multiplatform/Tool` target is not included in `//examples/multiplatform:device_targets`, as it would generated two configurations of the same binary (because the `swift_binary` doesn't have the rules_apple transition). It's things like this that make me feel this API isn't quite done yet.
188caa9
to
5c22623
Compare
def device_and_simulator(*, name, **kwargs): | ||
_device_and_simulator( | ||
name = name, | ||
testonly = True, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this set to test only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it can depend on tests.
Fixes #285, #438.
This rule is experimental because it might not be the right API to enable proper device support, but it's better to get something out there so we can iterate on the support.
Also updated the multiplatform example to use the
device_and_simulator
rule. Of note, the//examples/multiplatform/Tool
target is not included in//examples/multiplatform:device_targets
, as it would generate two configurations of the same binary (because theswift_binary
doesn't have the rules_apple transition). It's things like this that make me feel this API isn't quite done yet.