From 7c26c3ac144a3fd9f860f4b1930f4f9d5abbd042 Mon Sep 17 00:00:00 2001 From: Andrey Smirnov Date: Wed, 26 Feb 2014 16:24:54 +0400 Subject: [PATCH] Fix all dependencies in Gomfile. --- .gitignore | 3 +++ Gomfile | 22 ++++++++++++++++++++++ Makefile | 48 ++++++++++++++++++------------------------------ 3 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 Gomfile diff --git a/.gitignore b/.gitignore index 7a8d3eef..35894ecb 100644 --- a/.gitignore +++ b/.gitignore @@ -26,3 +26,6 @@ coverage.html coverage*.out *.pyc + +vendor/ +bin/ \ No newline at end of file diff --git a/Gomfile b/Gomfile new file mode 100644 index 00000000..fff5b6b1 --- /dev/null +++ b/Gomfile @@ -0,0 +1,22 @@ +gom 'code.google.com/p/go-uuid/uuid', :commit => '5fac954758f5' +gom 'code.google.com/p/go.crypto/ssh/terminal', :commit => '7aa593ce8cea' +gom 'code.google.com/p/gographviz', :commit => '212766062629' +gom 'code.google.com/p/snappy-go/snappy', :commit => '12e4b4183793' +gom 'github.com/cheggaaa/pb', :commit => '74be7a1388046f374ac36e93d46f5d56e856f827' +gom 'github.com/gonuts/commander', :commit => 'f8ba4e959ca914268227c3ebbd7f6bf0bb35541a' +gom 'github.com/gonuts/flag', :commit => '741a6cbd37a30dedc93f817e7de6aaf0ca38a493' +gom 'github.com/mkrautz/goar', :commit => '36eb5f3452b1283a211fa35bc00c646fd0db5c4b' +gom 'github.com/syndtr/goleveldb/leveldb', :commit => '527a7b286bd095794af6c519627b7ed3d8fd067a' +gom 'github.com/ugorji/go/codec', :commit => '71c2886f5a673a35f909803f38ece5810165097b' +gom 'github.com/wsxiaoys/terminal/color', :commit => '5668e431776a7957528361f90ce828266c69ed08' + +group :test do + gom 'launchpad.net/gocheck' +end + +group :development do + gom 'github.com/golang/lint/golint' + gom 'github.com/mattn/goveralls' + gom 'github.com/axw/gocov/gocov' + gom 'code.google.com/p/go.tools/cmd/cover' +end \ No newline at end of file diff --git a/Makefile b/Makefile index ef61bc84..89682665 100644 --- a/Makefile +++ b/Makefile @@ -1,64 +1,52 @@ GOVERSION=$(shell go version | awk '{print $$3;}') - -ifeq ($(TRAVIS), true) -GOVERALLS?=$(HOME)/gopath/bin/goveralls -SRCPATH?=$(HOME)/gopath/src -BINPATH=$(HOME)/gopath/bin -else -GOVERALLS?=goveralls -SRCPATH?=$(GOPATH)/src -BINPATH?=$(GOPATH)/bin -endif +PACKAGES=database debian files http utils +ALL_PACKAGES=aptly cmd console database debian files http utils +BINPATH=$(abspath ./bin) +GOM_ENVIRONMENT=-test ifeq ($(GOVERSION), go1.2) TRAVIS_TARGET=coveralls -PREPARE_LIST=cover-prepare +GOM_ENVIRONMENT+=-development else TRAVIS_TARGET=test -PREPARE_LIST= endif all: test check system-test -prepare: $(PREPARE_LIST) - go get -d -v ./... - go get launchpad.net/gocheck - -cover-prepare: - go get github.com/golang/lint/golint - go get github.com/mattn/goveralls - go get github.com/axw/gocov/gocov - go get code.google.com/p/go.tools/cmd/cover +prepare: + mkdir -p $(BINPATH) + gom $(GOM_ENVIRONMENT) install coverage.out: rm -f coverage.*.out - for i in database debian files http utils; do go test -coverprofile=coverage.$$i.out -covermode=count ./$$i; done + for i in $(PACKAGES); do gom test -coverprofile=coverage.$$i.out -covermode=count ./$$i; done echo "mode: count" > coverage.out grep -v -h "mode: count" coverage.*.out >> coverage.out rm -f coverage.*.out coverage: coverage.out - go tool cover -html=coverage.out + gom exec go tool cover -html=coverage.out rm -f coverage.out check: - go tool vet -all=true . - golint . + gom exec go tool vet -all=true $(ALL_PACKAGES:%=./%) + gom exec golint $(ALL_PACKAGES:%=./%) system-test: -ifeq ($(GOVERSION), go1.2) +ifeq ($(GOVERSION),$(filter $(GOVERSION),go1.2 devel)) if [ ! -e ~/aptly-fixture-db ]; then git clone https://github.com/aptly-dev/aptly-fixture-db.git ~/aptly-fixture-db/; fi endif if [ ! -e ~/aptly-fixture-pool ]; then git clone https://github.com/aptly-dev/aptly-fixture-pool.git ~/aptly-fixture-pool/; fi - go install - PATH=$(BINPATH):$(PATH) python system/run.py --long + gom build -o $(BINPATH)/aptly + PATH=$(BINPATH)/:$(PATH) python system/run.py --long travis: $(TRAVIS_TARGET) system-test test: - go test -v ./... -gocheck.v=true + gom test -v $(PACKAGES:%=./%) -gocheck.v=true coveralls: coverage.out - @$(GOVERALLS) -service travis-ci.org -coverprofile=coverage.out -repotoken $(COVERALLS_TOKEN) + gom build -o $(BINPATH)/goveralls github.com/mattn/goveralls + gom exec $(BINPATH)/goveralls -service travis-ci.org -coverprofile=coverage.out -repotoken $(COVERALLS_TOKEN) .PHONY: coverage.out \ No newline at end of file