Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

Commit 4e7c4ce

Browse files
Privacy Sandbox Teamcopybara-github
authored andcommitted
feat: Support imports in declarative API
Bug: b/414425806 Change-Id: I7c5ac2937b4557812fd7d4663b2c0b004d95b044 GitOrigin-RevId: c078b3310ace966155757a3ce078f85132deaaa4
1 parent 917d654 commit 4e7c4ce

3 files changed

Lines changed: 7 additions & 0 deletions

File tree

apis/privacysandbox/apis/roma/app_api/v1/options.proto

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ message RomaServiceAnnotation {
6363
// cpp_host_process_callback_includes would contain
6464
// `foo/bar/foobar_native_functions.h`.
6565
repeated string cpp_host_process_callback_includes = 6;
66+
// import strings for the generate protobuf spec
67+
repeated string proto_imports = 9;
6668
}
6769

6870
message RomaFunctionAnnotation {

src/roma/tools/api_plugin/roma_api.bzl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -995,6 +995,7 @@ def roma_byob_sdk(
995995
exclude_tools = False,
996996
guide_intro_text = _default_guide_intro,
997997
generated_proto_path = "",
998+
proto_deps = [],
998999
**kwargs):
9991000
"""
10001001
Top-level macro for the Roma BYOB SDK.
@@ -1030,6 +1031,7 @@ def roma_byob_sdk(
10301031
proto_library(
10311032
name = name + "_proto",
10321033
srcs = [":{}.proto".format(name)],
1034+
deps = proto_deps,
10331035
)
10341036
cc_proto_library(
10351037
name = name + "_cc_proto",

src/roma/tools/api_plugin/tmpl/byob/app/udf_interface.proto.tmpl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ package {{$svcopts.CppNamespace | replace "::" "." }};
3535
{{ if len $svcopts.CsharpNamespace }}option csharp_namespace = "{{ $svcopts.CsharpNamespace }}";{{ end }}
3636
{{ if len $svcopts.GoPackage }}option go_package = "{{ $svcopts.GoPackage }}";{{ end }}
3737

38+
{{- range $import := $svcopts.ProtoImports}}
39+
import "{{$import}}";
40+
{{- end}}
3841

3942
{{- range $rpc := $svc.MethodsWithOption "privacysandbox.apis.roma.app_api.v1.roma_rpc_annotation"}}
4043
{{- $rpcopts := index $rpc.Options "privacysandbox.apis.roma.app_api.v1.roma_rpc_annotation" }}

0 commit comments

Comments
 (0)