Skip to content

Commit

Permalink
Update usage of to_json to json.encode (#872)
Browse files Browse the repository at this point in the history
`to_json` was removed from `struct` in latest Bazel versions. This is
backwards compatible from Bazel 6+
  • Loading branch information
luispadron authored May 10, 2024
1 parent 02d67cd commit 70e2438
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion rules/plists.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def write_info_plists_if_needed(name, plists):
write_file(
name = plist_name,
out = plist_name + ".plist",
content = [struct(**plist).to_json()],
content = [json.encode(struct(**plist))],
)
written_plists.append(plist_name)
else:
Expand Down
2 changes: 1 addition & 1 deletion rules/precompiled_apple_resource_bundle.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ def _precompiled_apple_resource_bundle_impl(ctx):
)
ctx.actions.write(
output = bundletool_instructions_file,
content = bundletool_instructions.to_json(),
content = json.encode(bundletool_instructions),
)
bundletool_experimental = apple_mac_toolchain_info.bundletool_experimental

Expand Down
2 changes: 1 addition & 1 deletion rules/test/lldb/lldb_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _ios_breakpoint_test_wrapper(name, application, cmds, test_spec, sdk, device
write_file(
name = name + "_test_spec",
out = name + ".test_spec.json",
content = [test_spec.to_json()],
content = [json.encode(test_spec)],
)

lldbinit_deps = ["@build_bazel_rules_ios//rules/test/lldb:breakpoint.py"]
Expand Down

0 comments on commit 70e2438

Please sign in to comment.