-
Notifications
You must be signed in to change notification settings - Fork 379
Dep Support #113
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
Dep Support #113
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/vendor | ||
/dep | ||
/protoc | ||
/protoc-gen-go | ||
/csi.a | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# Refer to https://github.com/toml-lang/toml for detailed TOML docs. | ||
|
||
# The following packages are required because they're either build | ||
# tools or are dependencies only if the "csi" package is already | ||
# generated. However, if the "csi" package is removed (a valid | ||
# condition), a "dep ensure" will not fetch the dependencies it | ||
# no longer sees in the project's dependency graph. Including the | ||
# dependencies in the "required" list ensures they're always | ||
# downloaded. | ||
required = [ | ||
"github.com/golang/protobuf/protoc-gen-go", | ||
"golang.org/x/net/context", | ||
"google.golang.org/grpc" | ||
] | ||
|
||
[[constraint]] | ||
branch = "master" | ||
name = "github.com/golang/protobuf" | ||
|
||
[[constraint]] | ||
branch = "master" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same |
||
name = "golang.org/x/net" | ||
|
||
[[constraint]] | ||
name = "google.golang.org/grpc" | ||
version = "1.6.0" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,15 +15,33 @@ endif | |
export GOPATH | ||
|
||
|
||
################################################################################ | ||
## DEP ## | ||
################################################################################ | ||
|
||
DEP ?= ./dep | ||
DEP_VER ?= 0.3.1 | ||
DEP_BIN := dep-$$GOHOSTOS-$$GOHOSTARCH | ||
DEP_URL := https://github.com/golang/dep/releases/download/v$(DEP_VER)/$$DEP_BIN | ||
|
||
$(DEP): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't spend much time designing makefiles, but a little iffy in automatically installing a binary for people. We can add how to get |
||
GOVERSION=$$(go version | awk '{print $$4}') && \ | ||
GOHOSTOS=$$(echo $$GOVERSION | awk -F/ '{print $$1}') && \ | ||
GOHOSTARCH=$$(echo $$GOVERSION | awk -F/ '{print $$2}') && \ | ||
DEP_BIN="$(DEP_BIN)" && \ | ||
DEP_URL="$(DEP_URL)" && \ | ||
curl -sSLO $$DEP_URL && \ | ||
chmod 0755 "$$DEP_BIN" && \ | ||
mv -f "$$DEP_BIN" "$@" | ||
|
||
vendor: | $(DEP) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe a compromise would be a if we want to stay friendly, we could also have a target There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Or we merge as is and handle it later since this adds value without detracting from any. This needs to be deterministic, period. Or bindings could be off since the tool used to grab the eps may influence the eps. |
||
$(DEP) ensure -v -vendor-only | ||
|
||
|
||
######################################################################## | ||
## PROTOC ## | ||
######################################################################## | ||
|
||
# Only set PROTOC_VER if it has an empty value. | ||
ifeq (,$(strip $(PROTOC_VER))) | ||
PROTOC_VER := 3.5.1 | ||
endif | ||
|
||
PROTOC_VER ?= 3.5.1 | ||
PROTOC_OS := $(shell uname -s) | ||
ifeq (Darwin,$(PROTOC_OS)) | ||
PROTOC_OS := osx | ||
|
@@ -57,10 +75,9 @@ $(PROTOC): | |
# This is the recipe for getting and installing the go plug-in | ||
# for protoc | ||
PROTOC_GEN_GO_PKG := github.com/golang/protobuf/protoc-gen-go | ||
PROTOC_GEN_GO := protoc-gen-go | ||
$(PROTOC_GEN_GO): | ||
go get -d $(PROTOC_GEN_GO_PKG) && \ | ||
go build -o "$@" $(PROTOC_GEN_GO_PKG) | ||
PROTOC_GEN_GO := ./protoc-gen-go | ||
$(PROTOC_GEN_GO): | vendor | ||
go build -o "$@" ./vendor/$(PROTOC_GEN_GO_PKG) | ||
|
||
|
||
######################################################################## | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we target a specific revision? These can be updated periodically if needed.