-
Notifications
You must be signed in to change notification settings - Fork 264
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 support for macos in apple_*_xcframework
rules
#2459
base: master
Are you sure you want to change the base?
Conversation
d8a3282
to
83af71b
Compare
apple_*_xcframework
rules
df2c4f8
to
a330f7f
Compare
a330f7f
to
113bdd4
Compare
113bdd4
to
99d9b18
Compare
if environment_plist: | ||
input_files.append(environment_plist) | ||
forced_plists.append(environment_plist.path) |
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.
These aren't created for the macos
platform (e.g. environment_plist
is None
here)
if not hasattr(attr, platform_type): | ||
platform_attr = getattr(attr, platform_type, None) |
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.
Use getattr
with a None
default instead of hasattr
which will still return true even when ios
for example is the default value of {}
, this was causing a apple_xcframework
with only a macos
attr to also go through this transition for the ios
platform.
With getattr
we correctly get the value, for example the empty dict {}
, which then matches on the if not
check (it's an empty dict which is falsy), where hasattr
would've returned true since the ios
attr is technically available.
99d9b18
to
ef3a48c
Compare
This commit adds a `macos` attr to both the `apple_xcframework` and `apple_static_xcframework` rules. This allows building for multiple architectures and platforms. The new `macos` attr is a `string_list` (unlike the `ios` attr which is a dict for the simulator/device split). Example: ```starlark apple_xcframework( name = "ios_and_macos_dynamic_xcframework", bundle_id = "com.google.example", extension_safe = True, infoplists = [ "//test/starlark_tests/resources:Info.plist", ], ios = { "simulator": ["x86_64"], "device": ["arm64"], }, macos = [ "arm64", "x86_64", ], minimum_os_versions = { "ios": common.min_os_ios.baseline, "macos": common.min_os_macos.baseline, }, public_hdrs = [ "//test/starlark_tests/resources:shared.h", ], tags = common.fixture_tags, deps = [":fmwk_lib"], ) ``` Fixes #1475
ef3a48c
to
56c6864
Compare
This commit adds a
macos
attr to both theapple_xcframework
andapple_static_xcframework
rules.This allows building for multiple architectures and platforms.
The new
macos
attr is astring_list
(unlike theios
attr which is a dict for the simulator/device split).Example:
Fixes #1475