|
1 | 1 | use std::{env, path::PathBuf};
|
2 | 2 |
|
| 3 | +use tonic_prost_build::Config; |
| 4 | + |
3 | 5 | static ALWAYS_SERDE: &str = "#[cfg_attr(not(feature = \"serde_serialize\"), \
|
4 | 6 | derive(::serde::Serialize, ::serde::Deserialize))]";
|
5 | 7 |
|
6 | 8 | fn main() -> Result<(), Box<dyn std::error::Error>> {
|
7 | 9 | println!("cargo:rerun-if-changed=./protos");
|
8 | 10 | let out = PathBuf::from(env::var("OUT_DIR").unwrap());
|
9 | 11 | let descriptor_file = out.join("descriptors.bin");
|
10 |
| - tonic_build::configure() |
| 12 | + tonic_prost_build::configure() |
11 | 13 | // We don't actually want to build the grpc definitions - we don't need them (for now).
|
12 | 14 | // Just build the message structs.
|
13 | 15 | .build_server(false)
|
@@ -96,29 +98,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
96 | 98 | "coresdk.external_data.LocalActivityMarkerData.backoff",
|
97 | 99 | "#[serde(with = \"opt_duration\")]",
|
98 | 100 | )
|
99 |
| - .extern_path( |
100 |
| - ".google.protobuf.Any", |
101 |
| - "::prost_wkt_types::Any" |
102 |
| - ) |
103 |
| - .extern_path( |
104 |
| - ".google.protobuf.Timestamp", |
105 |
| - "::prost_wkt_types::Timestamp" |
106 |
| - ) |
107 |
| - .extern_path( |
108 |
| - ".google.protobuf.Duration", |
109 |
| - "::prost_wkt_types::Duration" |
110 |
| - ) |
111 |
| - .extern_path( |
112 |
| - ".google.protobuf.Value", |
113 |
| - "::prost_wkt_types::Value" |
114 |
| - ) |
115 |
| - .extern_path( |
116 |
| - ".google.protobuf.FieldMask", |
117 |
| - "::prost_wkt_types::FieldMask" |
118 |
| - ) |
119 | 101 | .file_descriptor_set_path(descriptor_file)
|
120 |
| - .skip_debug("temporal.api.common.v1.Payload") |
121 |
| - .compile_protos( |
| 102 | + .skip_debug(["temporal.api.common.v1.Payload"]) |
| 103 | + .compile_with_config( |
| 104 | + { |
| 105 | + let mut c = Config::new(); |
| 106 | + c.enable_type_names(); |
| 107 | + c |
| 108 | + }, |
122 | 109 | &[
|
123 | 110 | "./protos/local/temporal/sdk/core/core_interface.proto",
|
124 | 111 | "./protos/api_upstream/temporal/api/workflowservice/v1/service.proto",
|
|
0 commit comments