File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11/.gopath
22/bin
3- /libexec
4- /log
5- /repositories
63/vendor
Original file line number Diff line number Diff line change 1+ PACKAGE := github.com/github/git-sizer
12ROOTDIR := $(abspath $(CURDIR ) )
2- export ROOTDIR
3+ GOPATH := $(ROOTDIR ) /.gopath
4+ export GOPATH
35
46GO := $(CURDIR ) /script/go
57GOFMT := $(CURDIR ) /script/gofmt
68
7- BIN := libexec
8-
9- GOBIN := $(abspath $(BIN ) )
10- export GOBIN
9+ BIN := bin
1110
1211GOFLAGS := \
1312 --tags "static" \
1413 -ldflags "-X main.BuildVersion=$(shell git rev-parse HEAD) -X main.BuildDescribe=$(shell git describe --tags --always --dirty) "
1514GO_CMDS := \
1615 $(BIN ) /git-sizer
1716GO_PKGS := $(shell cd .gopath/src; find github.com/github/git-sizer/ -type f -name '* .go' | xargs -n1 dirname | sort -u)
18- SHELL_CMDS :=
19- RUBY_CMDS :=
20- DEPS := \
21- github.com/stretchr/testify
2217GO_SRCS := $(shell find src -type f -name '* .go')
2318
24- TEST_SH_RUNNERS := 2
25-
2619.PHONY : all
27- all : $(GO_CMDS ) $(SHELL_CMDS ) $(RUBY_CMDS )
28-
29- libexec/% : bin/% $(GO_SRCS )
30- $(GO ) install $(GOFLAGS ) github.com/github/git-sizer/$*
20+ all : $(GO_CMDS )
3121
32- .PRECIOUS : bin/%
33- bin/% : src/shim.sh
34- mkdir -p bin
35- cp $< bin/$*
36- chmod +x bin/$*
22+ $(BIN ) /% : $(GO_SRCS ) | $(BIN )
23+ $(GO ) build $(GOFLAGS ) -o $@ $(PACKAGE ) /$*
3724
38- .PHONY : $(SHELL_CMDS )
39- $(SHELL_CMDS ) : $(BIN ) /% : bin/% .sh
40- cp $< $@
41-
42- .PHONY : $(RUBY_CMDS )
43- $(RUBY_CMDS ) : $(BIN ) /% : bin/% .rb
44- cp $< $@
45-
46- .PHONY : deps
47- deps :
48- $(GO ) get $(DEPS )
25+ $(BIN ) :
26+ mkdir -p $(BIN )
4927
5028.PHONY : test
51- test : gotest shtest
29+ test : gotest
5230
5331.PHONY : gotest
5432gotest :
5533 $(GO ) test -timeout 60s $(GOFLAGS ) $(GO_PKGS )
5634
57- .PHONY : shtest
58- shtest : libexec/git-sizer
59- ls -1 test/test-* .sh | xargs -I % -P $(TEST_SH_RUNNERS ) -n 1 $(SHELL ) % --batch
60-
6135.PHONY : gofmt
6236gofmt :
6337 find src test -name " *.go" -print0 | xargs -0 $(GOFMT ) -l -w | sed -e ' s/^/Fixing /'
7246
7347.PHONY : clean
7448clean :
75- rm -rf bin libexec
49+ rm -rf bin
Original file line number Diff line number Diff line change 44
55cd $( dirname " $0 " ) /..
66
7+ export ROOTDIR=" $( pwd) "
8+ export GOPATH=" $ROOTDIR /.gopath"
9+
710if [[ " $( uname -s) " = " Darwin" ]]; then
811 brew bundle
912fi
1013script/ensure-go-installed
1114
12- rm -f .gopath/src/github.com/github/git-sizer
13- mkdir -p .gopath/src/github.com/github
14- ln -s " $PWD /src" .gopath/src/github.com/github/git-sizer
15+ go get -u github.com/golang/dep/cmd/dep
16+
17+ BASE=" $GOPATH /src/github.com/github/git-sizer"
18+ rm -f " $BASE "
19+ mkdir -p $( dirname " $BASE " )
20+ ln -s " $( pwd) /src" " $BASE "
1521
16- make deps
22+ (
23+ cd $BASE
24+ " $GOPATH /bin/dep" ensure
25+ " $GOPATH /bin/dep" prune
26+ )
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
55# Is go installed, and at least 1.7?
66go_ok () {
77 case " $( go version 2> /dev/null | sed -n ' s/.*go\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' | head -n 1) " in
8- " " |0.* |1.[0123456 ])
8+ " " |0.* |1.[012345678 ])
99 false ;;
1010 * )
1111 true ;;
@@ -14,7 +14,7 @@ go_ok() {
1414
1515# If a local go is installed, use it.
1616set_up_vendored_go () {
17- GO_VERSION=go1.8.1
17+ GO_VERSION=go1.9.2
1818 VENDORED_GOROOT=" $ROOTDIR /vendor/$GO_VERSION /go"
1919 if [ -x " $VENDORED_GOROOT /bin/go" ]; then
2020 export GOROOT=" $VENDORED_GOROOT "
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ # Gopkg.toml example
2+ #
3+ # Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md
4+ # for detailed Gopkg.toml documentation.
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments