Skip to content

Commit 70e2438

Browse files
authored
Update usage of to_json to json.encode (#872)
`to_json` was removed from `struct` in latest Bazel versions. This is backwards compatible from Bazel 6+
1 parent 02d67cd commit 70e2438

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

rules/plists.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def write_info_plists_if_needed(name, plists):
110110
write_file(
111111
name = plist_name,
112112
out = plist_name + ".plist",
113-
content = [struct(**plist).to_json()],
113+
content = [json.encode(struct(**plist))],
114114
)
115115
written_plists.append(plist_name)
116116
else:

rules/precompiled_apple_resource_bundle.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def _precompiled_apple_resource_bundle_impl(ctx):
164164
)
165165
ctx.actions.write(
166166
output = bundletool_instructions_file,
167-
content = bundletool_instructions.to_json(),
167+
content = json.encode(bundletool_instructions),
168168
)
169169
bundletool_experimental = apple_mac_toolchain_info.bundletool_experimental
170170

rules/test/lldb/lldb_test.bzl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ def _ios_breakpoint_test_wrapper(name, application, cmds, test_spec, sdk, device
8181
write_file(
8282
name = name + "_test_spec",
8383
out = name + ".test_spec.json",
84-
content = [test_spec.to_json()],
84+
content = [json.encode(test_spec)],
8585
)
8686

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

0 commit comments

Comments
 (0)