Skip to content

Commit 29e5e38

Browse files
committed
fix: only generate services from the current file
1 parent e2cf903 commit 29e5e38

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/compilerlib/pb_codegen_all.ml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ let generate_mutable_records (self : ocaml_mod) ocaml_types : unit =
128128
| _ -> ())
129129
ocaml_types
130130

131-
let generate_service_struct service sc : unit =
131+
let generate_service_struct (service : Ot.service) sc : unit =
132+
Pb_logger.log "Generating code for service %s\n" service.service_name;
132133
Pb_codegen_services.gen_service_struct service sc
133134

134135
let generate_service_sig service sc : unit =

src/ocaml-protoc/ocaml_protoc_compilation.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,16 @@ let compile cmdline cmd_line_files_options : Ot.proto * _ =
9494
(compilation unit) *)
9595
let typed_proto =
9696
{
97-
typed_proto with
9897
Tt.proto_types =
9998
List.filter
10099
(function
101100
| { Tt.file_name; _ } :: _ when file_name = proto_file_name -> true
102101
| _ -> false)
103102
typed_proto.proto_types;
103+
proto_services =
104+
List.filter
105+
(fun s -> s.Tt.service_file_name = proto_file_name)
106+
typed_proto.proto_services;
104107
}
105108
in
106109

0 commit comments

Comments
 (0)