有关背景信息,请参阅:How to compile google-fhir proto files
使用protoc编译时似乎缺少.java文件。我在这里看不到这些文件:https://github.com/google/protobuf/tree/master/java/core/src/main/java/com/google/protobuf。当然,protoc会生成其他文件,例如Patient.java,它们不在上面的链接文件夹中。我只需要它来编译。
symbol: class CodeableConcept
location: package com.google.fhir.stu3.proto
./PlanDefinition.java:30950: error: cannot find symbol
public com.google.fhir.stu3.proto.CodeableConceptOrBuilder getJurisdictionOrBuilder(
^
symbol: class CodeableConceptOrBuilder
location: package com.google.fhir.stu3.proto
./PlanDefinition.java:30956: error: cannot find symbol
private java.util.List<com.google.fhir.stu3.proto.CodeableConcept> topic_;
^
symbol: class CodeableConcept
location: package com.google.fhir.stu3.proto
./PlanDefinition.java:30964: error: cannot find symbol
public java.util.List<com.google.fhir.stu3.proto.CodeableConcept> getTopicList() {
^
symbol: class CodeableConcept
location: package com.google.fhir.stu3.proto
./PlanDefinition.java:30974: error: cannot find symbol
public java.util.List<? extends com.google.fhir.stu3.proto.CodeableConceptOrBuilder>
.... ^
100 errors.
更新
运行examples / protogen / generate-proto.sh会返回:
FAILED: Build did NOT complete successfully
generate-descriptors.sh: line 29: ../../bazel-bin/java/ProtoGenerator: No such file or directory
看起来bazel没能正确运行,因为ProtoGenerator不在榛子箱中。我在存在BUILD文件的根目录中运行bazel build
。它抱怨了一个工作空间,我被告知要创建一个空的WORKSPACE文件。完成后,没有错误,并且创建了bazel-bin。是否有其他参数而不是bazel build
。另外,我认为除了proto / stu3中的文件之外我还看到了多个BUILD文件,但也许我错了。