Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate go-bindata to statik #76

Merged
merged 6 commits into from
May 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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