forked from twitchtv/twirp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
60 lines (44 loc) · 1.65 KB
/
Makefile
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
RETOOL=$(CURDIR)/_tools/bin/retool
PATH := ${PWD}/bin:${PWD}/ENV/bin:${PATH}
DOCKER_RELEASE_IMAGE := golang:1.12.0-stretch
.DEFAULT_GOAL := all
all: setup test_all
.PHONY: test test_all test_core test_clients test_go_client test_python_client generate release_gen
# Phony commands:
generate:
PATH=$(CURDIR)/_tools/bin:$(PATH) GOBIN="${PWD}/bin" go install -v ./protoc-gen-...
$(RETOOL) do go generate ./...
test_all: setup test_core test_clients
test_core: generate
$(RETOOL) do errcheck -blank ./internal/twirptest
go test -race $(shell go list ./... | grep -v /vendor/ | grep -v /_tools/)
test_clients: test_go_client test_python_client
test_go_client: generate build/clientcompat build/gocompat
./build/clientcompat -client ./build/gocompat
test_python_client: generate build/clientcompat build/pycompat
./build/clientcompat -client ./build/pycompat
setup:
./install_proto.bash
GOPATH=$(CURDIR)/_tools go install github.com/twitchtv/retool/...
$(RETOOL) build
release_gen:
git clean -xdf
docker run \
--volume "$(CURDIR):/go/src/github.com/twitchtv/twirp" \
--workdir "/go/src/github.com/twitchtv/twirp" \
$(DOCKER_RELEASE_IMAGE) \
internal/release_gen.sh
# Actual files for testing clients:
./build:
mkdir build
./build/gocompat: ./build
go build -o build/gocompat ./clientcompat/gocompat
./build/clientcompat: ./build
go build -o build/clientcompat ./clientcompat
./build/venv: ./build
virtualenv ./build/venv
./build/venv/bin/pycompat.py: ./build/venv
./build/venv/bin/pip install --upgrade ./clientcompat/pycompat
./build/pycompat: ./build/venv/bin/pycompat.py
cp ./clientcompat/pycompat/pycompat.sh ./build/pycompat
chmod +x ./build/pycompat