Skip to content

Commit 6974d32

Browse files
committed
Add Makefile and a note in README.md
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent ff6a888 commit 6974d32

File tree

3 files changed

+69
-0
lines changed

3 files changed

+69
-0
lines changed

hack/tools/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
vendor/

hack/tools/Makefile

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Copyright 2020 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
export GO111MODULE=on
16+
17+
GOBIN ?= $(shell go env GOPATH)/bin
18+
DEP_PROGS=\
19+
$(GOBIN)/buildozer\
20+
$(GOBIN)/gazelle\
21+
$(GOBIN)/golint\
22+
$(GOBIN)/gotestsum\
23+
$(GOBIN)/kazel\
24+
$(GOBIN)/misspell\
25+
$(GOBIN)/prettybench\
26+
$(GOBIN)/staticcheck\
27+
28+
.PHONY: all
29+
all: clean build
30+
31+
.PHONY: clean
32+
clean:
33+
rm -f $(DEP_PROGS)
34+
rm -rf vendor/
35+
36+
.PHONY: build
37+
build: $(DEP_PROGS)
38+
39+
.PHONY: deps
40+
deps:
41+
go mod vendor
42+
43+
$(GOBIN)/buildozer: deps
44+
go install github.com/bazelbuild/buildtools/buildozer
45+
46+
$(GOBIN)/gazelle: deps
47+
go install github.com/bazelbuild/bazel-gazelle/cmd/gazelle
48+
49+
$(GOBIN)/golint: deps
50+
go install golang.org/x/lint/golint
51+
52+
$(GOBIN)/gotestsum: deps
53+
go install gotest.tools/gotestsum
54+
55+
$(GOBIN)/kazel: deps
56+
go install k8s.io/repo-infra/cmd/kazel
57+
58+
$(GOBIN)/misspell: deps
59+
go install github.com/client9/misspell/cmd/misspell
60+
61+
$(GOBIN)/prettybench: deps
62+
go install github.com/cespare/prettybench
63+
64+
$(GOBIN)/staticcheck: deps
65+
go install honnef.co/go/tools/cmd/staticcheck

hack/tools/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
This directory contains a stub go module used to track version of development
22
tools like the ones needed for updating bazel BUILD files.
3+
4+
Run `make build` to download the dependencies, build the binaries and add
5+
them to your `$GOBIN` directory.

0 commit comments

Comments
 (0)