Skip to content

Commit b01a01d

Browse files
committed
introduce Go Modules
1 parent 56264df commit b01a01d

File tree

5 files changed

+47
-40
lines changed

5 files changed

+47
-40
lines changed

Makefile

+40-21
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,62 @@
1+
VERSION = $(shell godzil show-version)
12
CURRENT_REVISION = $(shell git rev-parse --short HEAD)
23
BUILD_LDFLAGS = "-X github.com/Songmu/timeout.revision=$(CURRENT_REVISION)"
34
ifdef update
45
u=-u
56
endif
67

7-
deps:
8-
go get ${u} -d -v ./...
9-
10-
test-deps:
11-
go get ${u} -d -v -t ./...
12-
13-
devel-deps: test-deps
14-
go get ${u} golang.org/x/lint/golint
15-
go get ${u} github.com/mattn/goveralls
16-
go get ${u} github.com/motemen/gobump/cmd/gobump
17-
go get ${u} github.com/Songmu/goxz/cmd/goxz
18-
go get ${u} github.com/Songmu/ghch/cmd/ghch
19-
go get ${u} github.com/tcnksm/ghr
8+
export GO111MODULE=on
209

10+
.PHONY: deps
11+
deps:
12+
go get ${u} -d -v
13+
14+
.PHONY: devel-deps
15+
devel-deps: deps
16+
GO111MODULE=off go get ${u} \
17+
golang.org/x/lint/golint \
18+
github.com/mattn/goveralls \
19+
github.com/Songmu/goxz/cmd/goxz \
20+
github.com/Songmu/gocredits/cmd/gocredits \
21+
github.com/Songmu/godzil/cmd/godzil \
22+
github.com/tcnksm/ghr
23+
24+
.PHONY: test
2125
test: deps
2226
go test
2327

28+
.PHONY: lint
2429
lint: devel-deps
2530
go vet
2631
golint -set_exit_status
2732

33+
.PHONY: cover
2834
cover: devel-deps
2935
goveralls
3036

37+
.PHONY: build
3138
build: deps
3239
go build -ldflags=$(BUILD_LDFLAGS) ./cmd/goxz
3340

34-
crossbuild: devel-deps
35-
$(eval ver = $(shell gobump show -r))
36-
goxz -pv=v$(ver) -build-ldflags=$(BUILD_LDFLAGS) \
37-
-d=./dist/v$(ver) ./cmd/go-timeout
41+
.PHONY: install
42+
install: build
43+
mv go-timeout "$(shell go env GOPATH)/bin"
44+
45+
.PHONY: bump
46+
bump: devel-deps
47+
godzil release
48+
49+
CREDITS: devel-deps go.sum
50+
gocredits -w
51+
52+
.PHONY: crossbuild
53+
crossbuild: CREDITS
54+
goxz -pv=v$(VERSION) -build-ldflags=$(BUILD_LDFLAGS) \
55+
-d=./dist/v$(VERSION) ./cmd/go-timeout
3856

39-
release:
40-
_tools/releng
41-
_tools/upload_artifacts
57+
.PHONY: upload
58+
upload:
59+
ghr v$(VERSION) dist/v$(VERSION)
4260

43-
.PHONY: test deps test-deps devel-deps lint cover crossbuild release
61+
.PHONY: release
62+
release: bump crossbuild upload

_tools/releng

-13
This file was deleted.

_tools/upload_artifacts

-6
This file was deleted.

go.mod

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module github.com/Songmu/timeout
2+
3+
go 1.12
4+
5+
require github.com/Songmu/wrapcommander v0.0.0-20190209161912-6edabfc62ab9

go.sum

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
github.com/Songmu/wrapcommander v0.0.0-20190209161912-6edabfc62ab9 h1:xu3B8iDZtpXl0meW/UVpgDLh/Oo0tlpBz7o7UZF9fxA=
2+
github.com/Songmu/wrapcommander v0.0.0-20190209161912-6edabfc62ab9/go.mod h1:BcurWRA8LPJdt1oyizpcpwYRDc11reXN3WnrbAnvdHE=

0 commit comments

Comments
 (0)