-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTaskfile.yml
29 lines (28 loc) · 1.13 KB
/
Taskfile.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
version: '2'
vars:
GIT_COMMIT:
sh: git describe --match=NeVeRmAtCh --always --abbrev=7 --dirty
GIT_BRANCH:
sh: git rev-parse --abbrev-ref HEAD
PACKAGE: "github.com/raghur/fuzzy-denite"
LDFLAGS: "-ldflags=\"-X {{.PACKAGE}}/lib.Version={{.GIT_COMMIT}} -X {{.PACKAGE}}/lib.Branch={{.GIT_BRANCH}}\""
tasks:
dev:
cmds:
- pip install --user grpcio grpcio-tools
- go get -u github.com/golang/protobuf/protoc-gen-go
gen:
cmds:
- protoc -I . api.proto --go_out=plugins=grpc:lib
- python3 -m grpc_tools.protoc -I. --python_out=rplugin/python3 --grpc_python_out=rplugin/python3/ api.proto
- cp rplugin/python3/api_* scratch
build:
deps: [gen]
cmds:
- '{{if eq OS "windows"}}go build -tags windows -o fuzzy-denite.exe {{.LDFLAGS}} main.go{{else}}echo ""{{end}}'
- '{{if eq OS "linux"}}go build -o fuzzy-denite {{.LDFLAGS}} main.go{{else}}echo ""{{end}}'
rel:
deps: [gen]
cmds:
- GOOS=windows GOARCH=amd64 go build -tags windows {{.LDFLAGS}} -o fuzzy-denite-win-amd64.exe main.go
- GOOS=linux GOARCH=amd64 go build {{.LDFLAGS}} -o fuzzy-denite-linux-amd64 main.go