From ac8735945c328baae84c754d684f2440b5679078 Mon Sep 17 00:00:00 2001 From: Denis Arh Date: Wed, 11 Jul 2018 20:32:19 +0200 Subject: [PATCH] Add deps & protoc to makefile Took 11 minutes --- Makefile | 14 ++++++++++++++ dep.sh | 9 --------- 2 files changed, 14 insertions(+), 9 deletions(-) delete mode 100755 dep.sh diff --git a/Makefile b/Makefile index c58d51f16..005f085c8 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ .PHONY: build SPEC=$(GOPATH)/bin/spec +PROTOC=$(GOPATH)/bin/protoc-gen-go build: docker build --rm -t $(shell cat .project) . @@ -8,6 +9,19 @@ build: $(SPEC): go get github.com/titpetric/spec/cmd/spec +$(PROTOC): + go get -u github.com/golang/protobuf/protoc-gen-go + spec: $(SPEC) cd sam/docs/src && $(SPEC) cd sam/ && php _gen.php + +protobuf: $(PROTOC) + # @todo this needs work (it hangs and outputs nothing) + $(PROTOC) --go_out=plugins=grpc:. -I. sam/chat/*.proto + +dep: + dep ensure -v + +dep.update: + dep ensure -update -v diff --git a/dep.sh b/dep.sh deleted file mode 100755 index 020a37559..000000000 --- a/dep.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -e -PROJECT=$(<.project) - -if [ -d "vendor" ]; then - docker run --rm -v $(pwd):/go/src/github.com/$PROJECT -w /go/src/github.com/$PROJECT -e GOOS=${OS} -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang dep ensure -update -v -else - docker run --rm -v $(pwd):/go/src/github.com/$PROJECT -w /go/src/github.com/$PROJECT -e GOOS=${OS} -e GOARCH=${ARCH} -e CGO_ENABLED=0 -e GOARM=7 titpetric/golang dep init -fi