Skip to content

Commit beb7399

Browse files
committed
Depify
...though there are no actual deps right now.
1 parent 8431d2e commit beb7399

8 files changed

Lines changed: 40 additions & 138 deletions

File tree

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
/.gopath
22
/bin
3-
/libexec
4-
/log
5-
/repositories
63
/vendor

Makefile

Lines changed: 11 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,37 @@
1+
PACKAGE := github.com/github/git-sizer
12
ROOTDIR := $(abspath $(CURDIR))
2-
export ROOTDIR
3+
GOPATH := $(ROOTDIR)/.gopath
4+
export GOPATH
35

46
GO := $(CURDIR)/script/go
57
GOFMT := $(CURDIR)/script/gofmt
68

7-
BIN := libexec
8-
9-
GOBIN := $(abspath $(BIN))
10-
export GOBIN
9+
BIN := bin
1110

1211
GOFLAGS := \
1312
--tags "static" \
1413
-ldflags "-X main.BuildVersion=$(shell git rev-parse HEAD) -X main.BuildDescribe=$(shell git describe --tags --always --dirty)"
1514
GO_CMDS := \
1615
$(BIN)/git-sizer
1716
GO_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
2217
GO_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
5432
gotest:
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
6236
gofmt:
6337
find src test -name "*.go" -print0 | xargs -0 $(GOFMT) -l -w | sed -e 's/^/Fixing /'
@@ -72,4 +46,4 @@ govet:
7246

7347
.PHONY: clean
7448
clean:
75-
rm -rf bin libexec
49+
rm -rf bin

script/bootstrap

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,23 @@ set -e
44

55
cd $(dirname "$0")/..
66

7+
export ROOTDIR="$(pwd)"
8+
export GOPATH="$ROOTDIR/.gopath"
9+
710
if [[ "$(uname -s)" = "Darwin" ]]; then
811
brew bundle
912
fi
1013
script/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+
)

script/ensure-go-installed

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ ROOTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/.." && pwd )"
55
# Is go installed, and at least 1.7?
66
go_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.
1616
set_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"

script/vendor

Lines changed: 0 additions & 58 deletions
This file was deleted.

src/Gopkg.lock

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Gopkg.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
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.

src/shim.sh

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)