Skip to content

Commit

Permalink
Delete the xcode_scheme_settings rule
Browse files Browse the repository at this point in the history
Summary: We no longer need it, see details in D67810387.

Reviewed By: manicaesar

Differential Revision: D67830178

fbshipit-source-id: f53b64585127f950dd72075367b04003e25573c1
  • Loading branch information
chatura-atapattu authored and facebook-github-bot committed Jan 6, 2025
1 parent 89aaa18 commit 81cbf45
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 61 deletions.
59 changes: 0 additions & 59 deletions prelude/ide_integrations/xcode/scheme_settings.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -5,64 +5,5 @@
# License, Version 2.0 found in the LICENSE-APACHE file in the root directory
# of this source tree.

load("@prelude//user:rule_spec.bzl", "RuleRegistrationSpec")

_execution_types = ["launch", "test", "profile"]

XcodeSchemeSettingsInfo = provider(
fields = {
"json": provider_field(Artifact),
},
)

XCODE_SCHEME_SETTINGS_ATTR_NAME = "xcode_scheme_settings"
XCODE_SCHEME_SETTINGS_ATTR_TYPE = attrs.option(attrs.source(), default = None, doc = "Optional settings to set on schemes when this target is represented in Xcode.")

def _impl(ctx: AnalysisContext) -> list[Provider]:
data = {}
for execution_type in _execution_types:
execution_settings = getattr(ctx.attrs, execution_type, None)
if execution_settings:
data[execution_type] = execution_settings

scheme_settings_json = ctx.actions.write_json("scheme_settings.json", data)

return [DefaultInfo(default_output = scheme_settings_json), XcodeSchemeSettingsInfo(json = scheme_settings_json)]

def _attribs():
"""
Example:
xcode_scheme_settings(
name = "ExampleSchemeSettings",
launch = {
"command_line_arguments": [
("-NSDoubleLocalizedStrings YES", False),
],
"environment_variables": [
("IDELogRedirectionPolicy", "oslogToStdio", False)
],
},
)
"""

command_line_argument_attr = attrs.tuple(attrs.string(), attrs.bool(), doc = "The command line argument and whether it is enabled by default. Example: ('-NSDoubleLocalizedStrings YES', False)")
environment_variable_attr = attrs.tuple(attrs.string(), attrs.string(), attrs.bool(), doc = "The environment variable (key, value) and whether it is enabled by default. Example: ('IDELogRedirectionPolicy', 'oslogToStdio', False)")
setting_type = attrs.enum(["command_line_arguments", "environment_variables"])

execution_attr = attrs.dict(
setting_type,
attrs.one_of(
attrs.list(command_line_argument_attr, default = []),
attrs.list(environment_variable_attr, default = []),
),
)

attribs = {execution_type: attrs.option(execution_attr, default = None, doc = "Xcode {} scheme settings".format(execution_type)) for execution_type in _execution_types}
return attribs

registration_spec = RuleRegistrationSpec(
name = "xcode_scheme_settings",
impl = _impl,
attrs = _attribs(),
)
2 changes: 0 additions & 2 deletions prelude/user/all.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ load("@prelude//apple/user:apple_xcframework.bzl", _apple_xcframework_spec = "re
load("@prelude//apple/user:resource_group_map.bzl", _resource_group_map_spec = "registration_spec")
load("@prelude//cxx/user:cxx_toolchain_override.bzl", _cxx_toolchain_override_spec = "cxx_toolchain_override_registration_spec")
load("@prelude//cxx/user:link_group_map.bzl", _link_group_map_spec = "registration_spec")
load("@prelude//ide_integrations/xcode:scheme_settings.bzl", _xcode_scheme_settings_spec = "registration_spec")
load(":cxx_headers_bundle.bzl", _cxx_headers_bundle_spec = "registration_spec")
load(":extract_archive.bzl", _extract_archive_spec = "registration_spec")
load(":write_file.bzl", _write_file_spec = "registration_spec")
Expand All @@ -48,7 +47,6 @@ _all_specs = [
_apple_simulators_spec,
_write_file_spec,
_mockingbird_mock_spec,
_xcode_scheme_settings_spec,
]

rules = {
Expand Down

0 comments on commit 81cbf45

Please sign in to comment.