From 2ccea6496efc054c21c5ed397f3caff8d4992957 Mon Sep 17 00:00:00 2001 From: Joe Richey Date: Thu, 2 Mar 2017 10:15:23 -0800 Subject: metadata: introduce protobuf structures This commit adds in the metadata package. The primary purpose of this package is to provide the on-disk metadata structures in the form of protocol buffers. This includes: - Policy metadata structure - Protector metadata structure - Config file structure - All necessary sub-structures (wrapped keys, parameters, etc) This commit also adds in an example usage of the Config structure, which represents the structure of the global config file. All the package does at this point is convert between the Config structure and a JSON representation. Here we introduce govendor, which is described more in the README. This means we will have all of our Go dependencies in the vendor subdirectory. This means we will have no Go source dependencies, only dependencies on the build tools (Go and govendor). The README describes this in detail. Note that we commit the generated files. see: https://blog.golang.org/generate Change-Id: Iaacd46666b5d3e4e865a0f4045dd63ed7e3d6f96 --- Makefile | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b891387..0c38d91 100644 --- a/Makefile +++ b/Makefile @@ -29,10 +29,10 @@ ifdef LDFLAGS GOFLAGS += --ldflags '-extldflags "$(LDFLAGS)"' endif -.PHONY: default all $(NAME) go lint format install clean +.PHONY: default all $(NAME) go update lint format install clean default: $(NAME) -all: format lint go $(NAME) +all: update go format lint $(NAME) $(NAME): @mkdir -p $(BUILD_DIR) @@ -40,18 +40,23 @@ $(NAME): # Makes sure go files build and tests pass go: - go build $(GOFLAGS) ./... - go test $(GOFLAGS) ./... + govendor generate $(GOFLAGS) +local + govendor build $(GOFLAGS) +local + govendor test $(GOFLAGS) +local + +update: + @govendor fetch +external +vendor +missing + @govendor remove +unused lint: - @golint ./... || true - @go vet ./... + @golint $$(go list ./... | grep -v vendor) | grep -v "pb.go" || true + @govendor vet +local format: - go fmt ./... + @govendor fmt +local install: - go install $(GOFLAGS) ./... + govendor install $(GOFLAGS) +local clean: rm -rf $(BUILD_DIR) -- cgit v1.2.3