Skip to content

Commit

Permalink
Manage dependencies via Godep
Browse files Browse the repository at this point in the history
Embrace the future and use Go 1.6's vendor support via Godep.

Go 1.5 users should `export GO15VENDOREXPERIMENT=1`
  • Loading branch information
sean- committed Feb 13, 2016
1 parent 13bfad9 commit 25b0971
Show file tree
Hide file tree
Showing 1,095 changed files with 303,443 additions and 30 deletions.
33 changes: 8 additions & 25 deletions GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
GOTOOLS = github.com/mitchellh/gox golang.org/x/tools/cmd/stringer \
github.com/jteeuwen/go-bindata/... github.com/elazarl/go-bindata-assetfs/...
DEPS = $(shell go list -f '{{range .TestImports}}{{.}} {{end}}' ./...)
PACKAGES = $(shell go list ./...)
PACKAGES=$(shell go list ./... | grep -v '^github.com/hashicorp/consul/vendor/')
VETARGS?=-asmdecl -atomic -bool -buildtags -copylocks -methods \
-nilfunc -printf -rangeloops -shift -structtags -unsafeptr
VERSION?=$(shell awk -F\" '/^const Version/ { print $$2; exit }' version.go)

all: deps format
all: format
@mkdir -p bin/
@bash --norc -i ./scripts/build.sh

Expand All @@ -26,30 +23,16 @@ cov:
gocov test ./... | gocov-html > /tmp/coverage.html
open /tmp/coverage.html

deps:
@echo "--> Installing build dependencies"
@go get -v $(GOTOOLS)
@go get -d -v ./... $(DEPS)

updatedeps: deps
go get -u -v $(GOTOOLS)
go list ./... \
| xargs go list -f '{{join .Deps "\n"}}' \
| grep -v github.com/hashicorp/consul \
| grep -v '/internal/' \
| sort -u \
| xargs go get -f -u -v

test: deps
test:
@$(MAKE) vet
@./scripts/verify_no_uuid.sh
@./scripts/test.sh

cover: deps
cover:
./scripts/verify_no_uuid.sh
go list ./... | xargs -n1 go test --cover

format: deps
format:
@echo "--> Running go fmt"
@go fmt $(PACKAGES)

Expand All @@ -65,12 +48,12 @@ vet:
fi

# generate runs `go generate` to build the dynamically generated source files
generate: deps
generate:
find . -type f -name '.DS_Store' -delete
go generate ./...

# generates the static web ui
static-assets: deps
static-assets:
@echo "--> Generating static assets"
@go-bindata-assetfs -pkg agent -prefix pkg ./pkg/web_ui/...
@mv bindata_assetfs.go command/agent
Expand All @@ -82,4 +65,4 @@ web:
web-push:
./scripts/website_push.sh

.PHONY: all bin dev dist cov deps test vet web web-push generate test-nodep static-assets
.PHONY: all bin dev dist cov test vet web web-push generate static-assets
195 changes: 195 additions & 0 deletions Godeps/Godeps.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions Godeps/Readme

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
# This script builds the application from source for multiple platforms.
set -e

export GO15VENDOREXPERIMENT=1

# Get the parent directory of where this script is.
SOURCE="${BASH_SOURCE[0]}"
while [ -h "$SOURCE" ] ; do SOURCE="$(readlink "$SOURCE")"; done
Expand All @@ -20,10 +22,6 @@ GIT_DESCRIBE=$(git describe --tags)
XC_ARCH=${XC_ARCH:-"386 amd64 arm"}
XC_OS=${XC_OS:-"solaris darwin freebsd linux windows"}

# Install dependencies
echo "==> Getting dependencies..."
go get ./...

# Delete the old dir
echo "==> Removing old directory..."
rm -f bin/*
Expand Down
2 changes: 2 additions & 0 deletions scripts/dist.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#!/usr/bin/env bash
set -e

export GO15VENDOREXPERIMENT=1

# Get the version from the command line
VERSION=$1
if [ -z $VERSION ]; then
Expand Down
4 changes: 3 additions & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env bash

export GO15VENDOREXPERIMENT=1

# Create a temp dir and clean it up on exit
TEMPDIR=`mktemp -d -t consul-test.XXX`
trap "rm -rf $TEMPDIR" EXIT HUP INT QUIT TERM
Expand All @@ -10,4 +12,4 @@ go build -o $TEMPDIR/consul || exit 1

# Run the tests
echo "--> Running tests"
go list ./... | PATH=$TEMPDIR:$PATH xargs -n1 go test
go list ./... | grep -v ^github.com/hashicorp/consul/vendor/ | PATH=$TEMPDIR:$PATH xargs -n1 go test
45 changes: 45 additions & 0 deletions vendor/github.com/DataDog/datadog-go/statsd/README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 25b0971

Please sign in to comment.