Skip to content

Commit

Permalink
Added googleapis submodule. Setup protoc scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzware committed Sep 24, 2018
0 parents commit 39eacef
Show file tree
Hide file tree
Showing 118 changed files with 29,928 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "googleapis"]
path = googleapis
url = https://github.com/googleapis/googleapis.git
40 changes: 40 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
ADS_VERSION=v0
PROTO_ROOT_DIR=googleapis/
PROTO_SRC_DIR=/google/ads/googleads/$(ADS_VERSION)/**/*.proto
PROTO_OUT_DIR=$$GOPATH/src/github.com/kritzware/google-ads-go/protos/
PKG_PATH=paths=import
PROTOC_GO_ARGS=--go_out=plugins=grpc,$(PKG_PATH):$(PROTO_OUT_DIR)

ENTRY=main.go
BIN=gads

build:
go build -o $$GOPATH/bin/$(BIN) $(ENTRY)

run:
go run $(ENTRY)

run-debug:
GODEBUG=http2debug=2 GRPC_GO_LOG_SEVERITY_LEVEL=info GRPC_GO_LOG_VERBOSITY_LEVEL=2 go run $(ENTRY)

.SILENT protos:
echo "converting protos for version $(ADS_VERSION)"
for file in $(PROTO_ROOT_DIR)$(PROTO_SRC_DIR); do \
echo "converting proto $$(basename $$file)"; \
protoc -I=$(PROTO_ROOT_DIR) $(PROTOC_GO_ARGS) $$file; \
done; \
echo "built proto files to $$(basename $(PROTO_OUT_DIR))"

clean-protos:
rm -rf protos/*

.PHONY: protos

# proto:
# protoc -I=$(SRC_DIR) --go_out=plugins=grpc:$(PROTO_OUT_DIR) $(SRC_DIR)$(SRC_INPUT)

# .SILENT protos: clean-protos
# echo "converting all protos in $(SRC_INPUT)"; \
# for file in $(SRC_DIR)$(SRC_INPUT); do \
# protoc -I=$(SRC_DIR) --go_out=plugins=grpc,$(PKG_PATH):$(PROTO_OUT_DIR) $$file; \
# done; \
1 change: 1 addition & 0 deletions googleapis
Submodule googleapis added at 444cd8
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package main

// services "github.com/kritzware/google-ads-go/protos/google/ads/googleads/v0/services"

func main() {

}
Loading

0 comments on commit 39eacef

Please sign in to comment.