Skip to content

Commit 2951a9a

Browse files
author
Ben Walker
committed
storage: Add 'make local'
This will compile without any docker containers, using a locally installed protoc. BEWARE - every version of protoc generates different output, so don't check in generated output from this option. Signed-off-by: Ben Walker <[email protected]>
1 parent 4011ff0 commit 2951a9a

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

storage/Makefile

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ COMMON_VERSION := v1
88
# Make a variable named ','. Used to pass arguments to functions that contain a comma
99
, := ,
1010

11+
define protoc_compile
12+
mkdir -p $(CURRENT_VERSION)/gen/$(1)
13+
protoc --proto_path=../common/$(COMMON_VERSION) --proto_path=$(CURRENT_VERSION) --proto_path=googleapis \
14+
--$(1)_out=$(CURRENT_VERSION)/gen/$(1) \
15+
$(2) \
16+
$(CURRENT_VERSION)/*.proto
17+
endef
18+
1119
define docker_compile
1220
rm -rf ./$(CURRENT_VERSION)/gen/$(1)
1321
mkdir -p ./$(CURRENT_VERSION)/gen/$(1)
@@ -62,3 +70,21 @@ googleapis/google:
6270

6371
clean:
6472
rm -rf googleapis
73+
74+
local: python_local cpp_local go_local java_local doc_local
75+
76+
python_local: googleapis/google
77+
$(call protoc_compile,python,)
78+
79+
cpp_local: googleapis/google
80+
$(call protoc_compile,cpp,)
81+
82+
go_local: googleapis/google
83+
$(call protoc_compile,go,)
84+
mv $(CURRENT_VERSION)/gen/go/github.com/opiproject/opi-api/storage/$(CURRENT_VERSION)/gen/go/* $(CURRENT_VERSION)/gen/go/
85+
86+
java_local: googleapis/google
87+
$(call protoc_compile,java,)
88+
89+
doc_local: googleapis/google
90+
$(call protoc_compile,doc,--doc_opt=markdown$(,)autogen.md)

0 commit comments

Comments
 (0)