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

*: vendor tool migrate to glide #1743

Merged
merged 8 commits into from
Sep 21, 2016
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
  •  
  •  
  •  
31 changes: 5 additions & 26 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ LDFLAGS += -X "github.com/pingcap/tidb/util/printer.TiDBGitHash=$(shell git rev-

TARGET = ""

.PHONY: all build install update parser clean todo test gotest interpreter server goyacc dev benchkv
.PHONY: all build install update parser clean todo test gotest interpreter server dev benchkv check

default: server buildsucc

Expand All @@ -32,24 +32,17 @@ all: dev server install benchkv
dev: parser build benchkv test check

build:
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) build
rm -rf vendor

install:
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) install ./...
rm -rf vendor

TEMP_FILE = temp_parser_file

goyacc:
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) build -o bin/goyacc github.com/pingcap/tidb/parser/goyacc
rm -rf vendor
$(GO) build -o bin/goyacc parser/goyacc/main.go

parser: goyacc
rm -rf parser/scanner.go
bin/goyacc -o /dev/null -xegen $(TEMP_FILE) parser/parser.y
bin/goyacc -o parser/parser.go -xe $(TEMP_FILE) parser/parser.y 2>&1 | egrep "(shift|reduce)/reduce" | awk '{print} END {if (NR > 0) {print "Find conflict in parser.y. Please check y.output for more information."; system("rm -f $(TEMP_FILE)"); exit 1;}}'
rm -f $(TEMP_FILE)
Expand All @@ -75,7 +68,7 @@ check:
@echo "vet --shadow"
@ go tool vet --shadow $(FILES) 2>&1 | awk '{print} END{if(NR>0) {exit 1}}'
@echo "golint"
@ golint ./... 2>&1 | grep -vE 'LastInsertId|NewLexer|\.pb\.go' | awk '{print} END{if(NR>0) {exit 1}}'
@ golint ./... 2>&1 | grep -vE 'vendor|LastInsertId|NewLexer|\.pb\.go' | awk '{print} END{if(NR>0) {exit 1}}'
@echo "gofmt (simplify)"
@ gofmt -s -l -w $(FILES) 2>&1 | awk '{print} END{if(NR>0) {exit 1}}'

Expand All @@ -96,46 +89,32 @@ todo:
test: gotest

gotest:
rm -rf vendor && ln -s _vendor/vendor vendor
@export log_level=error;\
$(GO) test -cover $(PACKAGES)
rm -rf vendor

race:
rm -rf vendor && ln -s _vendor/vendor vendor
@export log_level=debug; \
dirs=`go list ./... | grep -vE 'vendor' | awk '{sub("github.com/pingcap/tidb/",""); print}'`;\
for dir in $$dirs; do \
cd $$dir;\
go test -race | awk 'END{if($$1=="FAIL") {exit 1}}' || exit 1;\
cd -;\
done;
rm -rf vendor

tikv_integration_test:
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) test ./store/tikv/. -with-tikv=true
rm -rf vendor

interpreter:
rm -rf vendor && ln -s _vendor/vendor vendor
@cd interpreter && $(GO) build -ldflags '$(LDFLAGS)'
rm -rf vendor

server: parser
server: parser
ifeq ($(TARGET), "")
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) build -ldflags '$(LDFLAGS)' -o bin/tidb-server tidb-server/main.go
rm -rf vendor
else
rm -rf vendor && ln -s _vendor/vendor vendor
$(GO) build -ldflags '$(LDFLAGS)' -o '$(TARGET)' tidb-server/main.go
rm -rf vendor
endif

benchkv:
rm -rf vendor && ln -s _vendor/vendor vendor
benchkv:
$(GO) build -ldflags '$(LDFLAGS)' -o bin/benchkv benchkv/main.go
rm -rf vendor


Loading