Skip to content

Commit

Permalink
Merge pull request #76 from masutaka/migrate-to-statik
Browse files Browse the repository at this point in the history
Migrate go-bindata to statik
  • Loading branch information
masutaka authored May 4, 2019
2 parents 90b4bb2 + 09df859 commit b0b9ec6
Show file tree
Hide file tree
Showing 7 changed files with 95 additions and 237 deletions.
49 changes: 43 additions & 6 deletions Gopkg.lock

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

4 changes: 4 additions & 0 deletions Gopkg.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,7 @@
[[constraint]]
branch = "v2"
name = "gopkg.in/yaml.v2"

[[constraint]]
name = "github.com/rakyll/statik"
version = "0.1.6"
22 changes: 11 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
NAME := github-nippou
SRCS := $(shell find . -type f ! -path ./lib/bindata.go -name '*.go' ! -name '*_test.go')
SRCS := $(shell find . -type f ! -path ./statik/statik.go -name '*.go' ! -name '*_test.go')
CONFIGS := $(wildcard config/*)
VERSION := v$(shell grep 'const Version ' lib/version.go | sed -E 's/.*"(.+)"$$/\1/')
PACKAGES := $(shell go list ./...)
Expand All @@ -12,7 +12,7 @@ all: $(NAME)

# Install dependencies for development
.PHONY: deps
deps: dep go-bindata
deps: dep statik
dep ensure

.PHONY: dep
Expand All @@ -21,17 +21,17 @@ ifeq ($(shell command -v dep 2> /dev/null),)
go get github.com/golang/dep/cmd/dep
endif

.PHONY: go-bindata
go-bindata:
ifeq ($(shell command -v go-bindata 2> /dev/null),)
go get github.com/jteeuwen/go-bindata/...
.PHONY: statik
statik:
ifeq ($(shell command -v statik 2> /dev/null),)
go get github.com/rakyll/statik
endif

# Build binary
$(NAME): lib/bindata.go $(SRCS)
$(NAME): statik/statik.go $(SRCS)
go build -o $(NAME)

lib/bindata.go: $(CONFIGS)
statik/statik.go: $(CONFIGS)
go generate

# Install binary to $GOPATH/bin
Expand All @@ -46,15 +46,15 @@ clean:

# Test for development
.PHONY: test
test: lib/bindata.go
test: statik/statik.go
go test -v $(PACKAGES)

# Test for CI
.PHONY: test-all
test-all: deps-test-all vet lint test

.PHONY: deps-test-all
deps-test-all: dep go-bindata golint lib/bindata.go
deps-test-all: dep statik golint statik/statik.go
dep ensure

.PHONY: golint
Expand Down Expand Up @@ -103,7 +103,7 @@ cross-build: deps-cross-build
gox -os="darwin linux windows" -arch="386 amd64" -output "pkg/{{.OS}}_{{.Arch}}/{{.Dir}}"

.PHONY: deps-cross-build
deps-cross-build: deps lib/bindata.go gox
deps-cross-build: deps statik/statik.go gox

.PHONY: gox
gox:
Expand Down
Loading

0 comments on commit b0b9ec6

Please sign in to comment.