Skip to content

Commit

Permalink
Replace usages of to_json() with json.encode(..) (#2433)
Browse files Browse the repository at this point in the history
struct.to_json() is deprecated and is being removed.

This replaces usages of it with the builtin json module.
  • Loading branch information
c-mita authored Mar 19, 2024
1 parent cc39679 commit 8096c8d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions apple/internal/entitlements_support.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def _extract_signing_info(
)
actions.write(
output = control_file,
content = struct(**control).to_json(),
content = json.encode(struct(**control)),
)

apple_support.run(
Expand Down Expand Up @@ -305,7 +305,7 @@ def _process_entitlements(
)
actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)

resource_actions.plisttool_action(
Expand Down Expand Up @@ -344,7 +344,7 @@ def _process_entitlements(
)
actions.write(
output = simulator_control_file,
content = simulator_control.to_json(),
content = json.encode(simulator_control),
)

resource_actions.plisttool_action(
Expand Down
2 changes: 1 addition & 1 deletion apple/internal/partials/debug_symbols.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _generate_dsym_info_plist(
)
actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)

resource_actions.plisttool_action(
Expand Down
2 changes: 1 addition & 1 deletion apple/internal/processor.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ def _bundle_partial_outputs_files(
)
actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)

bundletool_inputs = input_files + [control_file] + extra_input_files
Expand Down
4 changes: 2 additions & 2 deletions apple/internal/resource_actions/plist.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ def merge_resource_infoplists(
)
actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)

plisttool_action(
Expand Down Expand Up @@ -379,7 +379,7 @@ def merge_root_infoplists(
)
actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)

plisttool_action(
Expand Down
2 changes: 1 addition & 1 deletion apple/versioning.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def _apple_bundle_version_impl(ctx):
)
ctx.actions.write(
output = control_file,
content = control.to_json(),
content = json.encode(control),
)
inputs.append(control_file)

Expand Down

0 comments on commit 8096c8d

Please sign in to comment.