gpt4 book ai didi

java - Protobuf 问题 (alexeyxo/protobuf-swift)

转载 作者:行者123 更新时间:2023-11-30 13:50:28 28 4
gpt4 key购买 nike

我收到了一个项目,其中 Java .proto 文件被转换为 Swift 1.0。现在我将在 Swift 2.0 中得到相同的结果。我已阅读有关如何安装 Protobuf 编译器( https://github.com/alexeyxo/protobuf-swift )的说明,但在我看来它们并不清楚,这就是为什么我有几个问题:

  1. 为什么他们要求在您的项目中添加 ./src/ProtocolBuffers/ProtocolBuffers.xcodeproj
  2. 他们在“编译“.proto”文件”中询问。使用命令 protoc person.proto --swift_out="./" 这还不够。我有几个相互依赖的 .proto 文件,当我尝试对单个 .proto 文件运行此命令时,我得到以下信息:

    ruslans-imac:桌面 ruslan$ protoc Commands.proto --swift_out="./"MobileStartup.proto:找不到文件。TaskListPortion.proto:找不到文件。Commands.proto:导入“MobileStartup.proto”未找到或有错误。Commands.proto:导入“TaskListPortion.proto”未找到或有错误。Commands.proto:225:14:“ContainerType”未定义。Commands.proto:226:14:“FocusEnum”未定义。Commands.proto:230:14:“OffsetDateMessage”未定义。Commands.proto:231:14:“OffsetDateMessage”未定义。Commands.proto:254:14:“OffsetDateMessage”未定义。Commands.proto:279:14:“LinkTypeEnum”未定义。Commands.proto:297:14:“FocusEnum”未定义。Commands.proto:312:14:“OffsetDateTimeMessage”未定义。Commands.proto:317:14:“FocusEnum”未定义。Commands.proto:318:14:“OffsetDateMessage”未定义。Commands.proto:322:14:“FocusEnum”未定义。Commands.proto:324:14:“OffsetDateMessage”未定义。Commands.proto:344:14:“OffsetDateMessage”未定义。Commands.proto:348:14:“OffsetDateMessage”未定义。Commands.proto:352:14:“OffsetDateMessage”未定义。

我认为应该存在某种方法来对文件进行分组并一次性编译它们。

最佳答案

如果您是 alexeyxo/protobuf-swift 的新手,请注意它是基于 Google 的 Protocol Buffers 构建的,因此请阅读 google 的有关如何使用它的文章,您会找到您想要的内容。

关于java - Protobuf 问题 (alexeyxo/protobuf-swift),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34355936/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com