-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from davidovich/fix-scaffold-module-name
remove submodule name in generated go.mod
- Loading branch information
Showing
7 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
bin | ||
build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,12 @@ | ||
SHELL=/bin/bash | ||
|
||
HAS_PACKR2 := $(shell command -v packr2) | ||
HAS_PACKR2 := $(shell command -v packr2) | ||
HAS_GOBIN := $(shell command -v gobin) | ||
HAS_GOCOVERUTIL := $(shell command -v gocoverutil) | ||
|
||
ifndef HAS_GOBIN | ||
$(shell GO111MODULE=off go get -u github.com/myitcv/gobin 2>/dev/null) | ||
endif | ||
|
||
export GO111MODULE := on | ||
|
||
|
@@ -9,7 +15,10 @@ PACKR_FILE := pkg/scaffold/scaffold-packr.go | |
|
||
ASSETS := $(shell find templates/scaffold) | ||
|
||
all: test $(PACK_FILE) $(SCAFFOLD_BIN) | ||
all: $(PACKR_FILE) test $(SCAFFOLD_BIN) | ||
|
||
.PHONY: bin | ||
bin: $(PACKR_FILE) $(SCAFFOLD_BIN) | ||
|
||
.PHONY: $(SCAFFOLD_BIN) | ||
$(SCAFFOLD_BIN): $(PACKR_FILE) | ||
|
@@ -22,9 +31,34 @@ ifndef HAS_PACKR2 | |
endif | ||
packr2 | ||
|
||
GO_TESTS := pkg internal cmd | ||
COVERAGE := $(foreach t,$(GO_TESTS),build/coverage/report/$(t)) | ||
MERGED_COVERAGE := build/coverage/report/cover.merged.out | ||
HTML_COVERAGE := build/coverage/html/index.html | ||
|
||
.PHONY: test | ||
test: | ||
go test -cover -v ./... | ||
test: output-coverage | ||
|
||
.PHONY: output-coverage | ||
output-coverage: $(MERGED_COVERAGE) $(HTML_COVERAGE) | ||
go tool cover -func=$< | ||
|
||
$(MERGED_COVERAGE): $(COVERAGE) | ||
ifndef HAS_GOCOVERUTIL | ||
gobin github.com/AlekSi/[email protected] | ||
endif | ||
$(call msg,Generating merged coverage report) | ||
gocoverutil -coverprofile=$@ merge $^ | ||
|
||
$(HTML_COVERAGE): $(MERGED_COVERAGE) | ||
@mkdir -p $(@D) | ||
go tool cover -html=$< -o $@ | ||
|
||
.PHONY: $(COVERAGE) | ||
$(COVERAGE): | ||
@mkdir -p $(@D) | ||
$(call msg,--> Testing $(@F)...) | ||
go test ./$(@F)/... --cover -coverprofile $@ -v | ||
|
||
.PHONY: clean | ||
clean: | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
module {{ .ModName }}/{{.SummonerName}} | ||
module {{ .ModName }} |