Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go modules #232

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ build
npm-debug.log

/release
.idea
_tools
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ go:
- 1.12.x
- 1.13.x
- tip
env:
- GO111MODULE=on
script:
- go install ./...
- go test -race ./...
56 changes: 0 additions & 56 deletions Gopkg.lock

This file was deleted.

29 changes: 0 additions & 29 deletions Gopkg.toml

This file was deleted.

42 changes: 32 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,21 +1,43 @@
RETOOL=$(CURDIR)/_tools/bin/retool
PATH := ${PWD}/bin:${PWD}/ENV/bin:${PATH}
DOCKER_RELEASE_IMAGE := golang:1.12.0-stretch
DOCKER_RELEASE_IMAGE := golang:1.14.0-stretch
.DEFAULT_GOAL := all

all: setup test_all
TOOLS_BIN ?= $(CURDIR)/_tools/bin
PROTOC_PATH ?= $(CURDIR)/_tools

.PHONY: test test_all test_core test_clients test_go_client test_python_client generate release_gen
PROTOBUF_VERSION ?= 3.11.0

ifeq ($(UNAME_S),Darwin)
PROTOC_URL = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VERSION)/protoc-$(PROTOBUF_VERSION)-osx-x86_64.zip
else
PROTOC_URL = https://github.com/protocolbuffers/protobuf/releases/download/v$(PROTOBUF_VERSION)/protoc-$(PROTOBUF_VERSION)-linux-x86_64.zip
endif

all: protoc setup test_all

.PHONY: protoc test test_all test_core test_clients test_go_client test_python_client generate release_gen

protoc:
@if [ ! -d $(PROTOC_PATH) ]; then\
mkdir -p $(PROTOC_PATH)/bin;\
fi

@if [ ! -f $(PROTOC_PATH)/bin/protoc ]; then\
echo "Installing $(PROTOC_URL) to $(PROTOC_PATH)";\
curl -o protoc.zip -sSL $(PROTOC_URL);\
unzip -u protoc.zip -d $(PROTOC_PATH);\
rm -rf protoc.zip;\
fi

# Phony commands:
generate:
PATH=$(CURDIR)/_tools/bin:$(PATH) GOBIN="${PWD}/bin" go install -v ./protoc-gen-...
$(RETOOL) do go generate ./...
GOBIN="${PWD}/bin" go install -v ./protoc-gen-...
PATH=$(TOOLS_BIN):$(PATH) go generate ./...

test_all: setup test_core test_clients

test_core: generate
$(RETOOL) do errcheck -blank ./internal/twirptest
GOBIN=$(TOOLS_BIN) errcheck -blank ./internal/twirptest
go test -race $(shell go list ./... | grep -v /vendor/ | grep -v /_tools/)

test_clients: test_go_client test_python_client
Expand All @@ -27,9 +49,9 @@ 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
GOBIN=$(TOOLS_BIN) go install github.com/golang/protobuf/protoc-gen-go
GOBIN=$(TOOLS_BIN) go install github.com/kisielk/errcheck
GOBIN=$(TOOLS_BIN) go install github.com/gogo/protobuf/protoc-gen-gofast

release_gen:
git clean -xdf
Expand Down
3 changes: 0 additions & 3 deletions _tools/.gitignore

This file was deleted.

169 changes: 0 additions & 169 deletions _tools/src/github.com/gogo/protobuf/gogoproto/doc.go

This file was deleted.

Loading