소스 검색

Fix go example test.

It needs "-I" flag to find imported file google/protobuf/timestamp.proto
Feng Xiao 8 년 전
부모
커밋
8136ccb296
2개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 3 3
      examples/Makefile
  2. 1 1
      tests.sh

+ 3 - 3
examples/Makefile

@@ -22,12 +22,12 @@ clean:
 	rmdir com 2>/dev/null || true
 
 protoc_middleman: addressbook.proto
-	protoc --cpp_out=. --java_out=. --python_out=. addressbook.proto
+	protoc $$PROTO_PATH --cpp_out=. --java_out=. --python_out=. addressbook.proto
 	@touch protoc_middleman
 
 protoc_middleman_go: addressbook.proto
-	mkdir tutorial # make directory for go package
-	protoc --go_out=tutorial addressbook.proto
+	mkdir -p tutorial # make directory for go package
+	protoc $$PROTO_PATH --go_out=tutorial addressbook.proto
 	@touch protoc_middleman_go
 
 add_person_cpp: add_person.cc protoc_middleman

+ 1 - 1
tests.sh

@@ -129,7 +129,7 @@ build_golang() {
   export PATH="$GOPATH/bin:$PATH"
   go get github.com/golang/protobuf/protoc-gen-go
 
-  cd examples && make gotest && cd ..
+  cd examples && PROTO_PATH="-I../src -I." make gotest && cd ..
 }
 
 use_java() {