Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

Commit

Permalink
improve scripts for tools
Browse files Browse the repository at this point in the history
  • Loading branch information
kamilsk committed Jan 1, 2020
1 parent 674c089 commit 85324b0
Show file tree
Hide file tree
Showing 325 changed files with 39,253 additions and 1,704 deletions.
31 changes: 19 additions & 12 deletions tools/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,39 @@

SHELL = /bin/bash -euo pipefail

GO = GOPRIVATE=$(GOPRIVATE) GOFLAGS=$(GOFLAGS) go

BINPATH = $(shell dirname $(PWD))/bin
GO111MODULE = on
GOFLAGS = -mod=vendor
GOPRIVATE =
GOPRIVATE = go.octolab.net
GOPROXY = direct
MODULE = $(shell go list -m)
MODULE = $(shell $(GO) list -m)

export PATH := $(BINPATH):$(PATH)

.PHONY: env
env:
@echo "BINPATH: $(BINPATH)"
@echo "GO111MODULE: $(shell go env GO111MODULE)"
@echo "GOFLAGS: $(strip $(shell go env GOFLAGS))"
@echo "GOPRIVATE: $(strip $(shell go env GOPRIVATE))"
@echo "GOPROXY: $(strip $(shell go env GOPROXY))"
@echo "GO111MODULE: $(shell $(GO) env GO111MODULE)"
@echo "GOFLAGS: $(strip $(shell $(GO) env GOFLAGS))"
@echo "GOPRIVATE: $(strip $(shell $(GO) env GOPRIVATE))"
@echo "GOPROXY: $(strip $(shell $(GO) env GOPROXY))"
@echo "MODULE: $(MODULE)"

.PHONY: clean
clean:
@$(GO) clean -cache -modcache -testcache

.PHONY: deps
deps:
@GOPRIVATE=$(GOPRIVATE) go mod tidy && go mod vendor

.PHONY: update
update:
@GOPRIVATE=$(GOPRIVATE) go get -mod= -u all
@$(GO) mod tidy && $(GO) mod vendor

.PHONY: install
install:
@GOPRIVATE=$(GOPRIVATE) ROOT=$(dir $(BINPATH)) go generate ./tools.go
@ROOT=$(dir $(BINPATH)) $(GO) generate ./tools.go

.PHONY: update
update: GODEPS=$(shell $(GO) mod edit -json | gojq '.Require[] | select(.Indirect != true) | .Path')
update:
@go get -mod= -u $(GODEPS)
7 changes: 6 additions & 1 deletion tools/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ module github.com/kamilsk/egg/tools
go 1.11

require (
github.com/fastly/go-utils v0.0.0-20180712184237-d95a45783239 // indirect
github.com/golang/mock v1.3.1
github.com/golangci/golangci-lint v1.21.0
github.com/golangci/golangci-lint v1.22.2
github.com/itchyny/gojq v0.7.0
github.com/jehiah/go-strftime v0.0.0-20171201141054-1d33003b3869 // indirect
github.com/lestrrat-go/strftime v1.0.1 // indirect
github.com/tebeka/strftime v0.1.3 // indirect
golang.org/x/tools v0.2.2
)

Expand Down
77 changes: 67 additions & 10 deletions tools/go.sum

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions tools/tools.go

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

47 changes: 47 additions & 0 deletions tools/vendor/github.com/alecthomas/participle/.golangci.yml

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

19 changes: 19 additions & 0 deletions tools/vendor/github.com/alecthomas/participle/COPYING

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

Loading

0 comments on commit 85324b0

Please sign in to comment.