1
0
mirror of https://github.com/go-micro/go-micro.git synced 2025-05-19 21:23:04 +02:00

36 lines
709 B
Go
Raw Normal View History

2021-08-30 16:48:57 +02:00
package template
// Makefile is the Makefile template used for new projects.
var Makefile = `GOPATH:=$(shell go env GOPATH)
.PHONY: init
init:
@go get -u google.golang.org/protobuf/proto
@go install github.com/golang/protobuf/protoc-gen-go@latest
2021-10-13 09:52:05 +01:00
@go install github.com/asim/go-micro/cmd/protoc-gen-micro/v4@latest
2021-08-30 16:48:57 +02:00
.PHONY: proto
proto:
@protoc --proto_path=. --micro_out=. --go_out=:. proto/{{.Service}}.proto
2021-08-30 16:48:57 +02:00
.PHONY: update
update:
@go get -u
2021-08-30 16:48:57 +02:00
.PHONY: tidy
tidy:
@go mod tidy
2021-08-30 16:48:57 +02:00
.PHONY: build
build:
@go build -o {{.Service}}{{if .Client}}-client{{end}} *.go
2021-08-30 16:48:57 +02:00
.PHONY: test
test:
@go test -v ./... -cover
2021-08-30 16:48:57 +02:00
.PHONY: docker
docker:
@docker build -t {{.Service}}{{if .Client}}-client{{end}}:latest .
2021-08-30 16:48:57 +02:00
`