我收到了一个将JavaSWIFT1.0转换为.proto文件的项目。现在,我将得到同样的,但在SWIFT2.0。我读过关于如何安装Protobuf (https://github.com/alexeyxo/protobuf-swift)的说明,但在我看来它们似乎不清楚,这就是为什么我有几个问题:
Add ./src/ProtocolBuffers/ProtocolBuffers.xcodeproj in your projectprotoc person.proto --swift_out="./"是不够的。我有几个相互依赖的.proto文件,当我试图对单个.proto文件运行这个命令时,会得到以下内容:
ruslans-imac:桌面ruslan$ commands.proto --MobileStartup.proto_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“。我认为应该有某种方法将文件分组并同时编译它们。
发布于 2015-12-23 11:39:32
如果你对alexeyxo/protobuf很陌生,请注意,它是建立在Google的协议缓冲区的基础上的,所以阅读google关于如何使用它的文章,你会发现你正在寻找的东西。
https://stackoverflow.com/questions/34355936
复制相似问题