Looking at the readme for google-fhir it says to run bazel build
, which works, however none of the protocol files have been compiled.
Running protoc --proto_path=. --java_out=. proto/stu3/resources.proto
returns a bunch of error about other protos not being found. This goes backwards until 'descriptor.proto' which is not a proto in the folder. None of the protocol files in that directory will manually compile into java files.
*On another note, I was able to take other example protos from other sources and compile those successfully.
UPDATE
Running the command protoc --proto_path=proto/stu3/ --java_out=target proto/stu3/resources.proto
from the google-fhir base directory returns the following output:
~/fhir-master$ protoc --proto_path=proto/stu3/ --java_out=target proto/stu3/resources.proto
proto/stu3/annotations.proto: File not found.
proto/stu3/codes.proto: File not found.
proto/stu3/datatypes.proto: File not found.
resources.proto: Import "proto/stu3/annotations.proto" was not found or had errors.
resources.proto: Import "proto/stu3/codes.proto" was not found or had errors.
resources.proto: Import "proto/stu3/datatypes.proto" was not found or had errors.
resources.proto:84:5: "String" is not defined.
resources.proto:87:14: "Extension" is not defined.
resources.proto:90:14: "Extension" is not defined.
resources.proto:94:5: "Reference" is not defined.
resources.proto:97:5: "PositiveInt" is not defined.
...
...
Those files are definitely located in the same proto directory.
UPDATE 2
Well, this definitely doesn't work right out of the box. Moving the files around, I was able to generate the target folder with a bunch of Java files. However, trying to compile them, I get errors for files that don't exist:
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.
! Also, I don't see these file here: https://github.com/google/protobuf/tree/master/java/core/src/main/java/com/google/protobuf