在批处理文件中运行时,未定义“ google.protobuf.Timestamp”

时间:2019-07-23 08:58:33

标签: batch-file import proto protoc

您好,我在一个文件夹中有一个批处理文件集合,我需要遍历一个批处理文件来以doxygen格式记录每个原型文件。这部分不是问题,我可以很好地转换每个文件,但是任何包含include语句的原型文件都有问题,导入导致我的批处理文件脚本“ google.protobuf.Timestamp”未定义错误。将Timestamp.proto存储在本地,但是我不确定这是否是正确的方法吗?如果是,我如何调整脚本以使其正常工作。

我尝试使用时间戳的本地路径,但是当我尝试在脚本中使用“ google.protobuf.Timestamp”时,出现如下错误。

批处理脚本:

@echo off
set proto_files=
for /F %%i in ('dir /b *.proto') do (
   call set "proto_files=%%proto_files%% %%folder%%%%i"
)

echo %proto_files%
call protoc --doc_out=html,index.html:convertedProtoFiles %proto_files%

导致问题的原始脚本:

//
// .proto file to define the TimeSynchronisation interface that allows client/server to synchronise their times.
syntax = "proto3";

package tracker.pb.timesynchronisation;

// import "google/protobuf/timestamp.proto";

import "C:/Users/emartin/go/src/github.com/gogo/protobuf/protobuf/timestamp.proto"; // NEW tryed to fix error

service TimeSynchronisationService
{   
   /** Some code documentation that is not required to be displayed
   */
   rpc pollRoundTripTime(ClientRoundTripTime) returns (ServerRoundTripTime);
}
   /** Some code documentation that is not required to be displayed
   */
message ClientRoundTripTime
{
   google.protobuf.Timestamp client_send_time = 1;  // The time the client sent this message.
}

message ServerRoundTripTime
{
   google.protobuf.Timestamp client_send_time = 1;  // The time in the ClientRoundTripTime message the server is responding to.
   google.protobuf.Timestamp server_send_time = 2;  // The time the server received the request and replied.
}

0 个答案:

没有答案