-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
68 lines (49 loc) · 1.99 KB
/
Copy pathMakefile
File metadata and controls
68 lines (49 loc) · 1.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
PKG = github.com/kooksee/markview
COMMIT = $(shell git rev-parse --short HEAD)
BUILD_LDFLAGS = "-s -w -X $(PKG)/version.Revision=$(COMMIT)"
MARP = pnpm dlx @marp-team/marp-cli
SLIDES_FILE ?= docs/slides/tech-talk-template.md
SLIDES_THEME ?= docs/slides/theme-markview.css
SLIDES_PDF ?= docs/slides/tech-talk-template.pdf
SLIDES_PPTX ?= docs/slides/tech-talk-template.pptx
default: test
ci: depsdev generate test
slides-preview:
$(MARP) $(SLIDES_FILE) --theme-set $(SLIDES_THEME) --preview
slides-pdf:
$(MARP) $(SLIDES_FILE) --theme-set $(SLIDES_THEME) --pdf -o $(SLIDES_PDF)
slides-pptx:
$(MARP) $(SLIDES_FILE) --theme-set $(SLIDES_THEME) --pptx -o $(SLIDES_PPTX)
generate:
go generate ./internal/static/
test:
cd frontend && sh scripts/pnpm-install-safe.sh && pnpm run test:coverage
go test ./... -coverprofile=coverage.out -covermode=count -count=1
build: generate
go build -ldflags=$(BUILD_LDFLAGS) -trimpath -o markview .
install: generate
go install -ldflags=$(BUILD_LDFLAGS) -trimpath .
dev: build
./markview -p 16275 --foreground $(ARGS)
screenshot: build
cd frontend && pnpm run screenshots
lint:
cd frontend && sh scripts/pnpm-install-safe.sh && pnpm run lint
golangci-lint run ./...
go vet -vettool=`which gostyle` -gostyle.config=$(PWD)/.gostyle.yml ./...
fmt:
cd frontend && sh scripts/pnpm-install-safe.sh && pnpm run fmt
fmt-check:
cd frontend && sh scripts/pnpm-install-safe.sh && pnpm run fmt:check
depsdev:
go install github.com/Songmu/gocredits/cmd/gocredits@latest
go install github.com/k1LoW/gostyle@latest
credits: depsdev generate
go mod download
gocredits -w .
cd frontend && MARKVIEW_BUILD_CREDITS=1 pnpm run build
printf "\n================================================================\n\n" >> CREDITS
cat frontend/CREDITS_FRONTEND >> CREDITS
prerelease_for_tagpr: credits
git add CHANGELOG.md CREDITS go.mod go.sum
.PHONY: default ci generate test build dev screenshot lint fmt fmt-check depsdev credits prerelease_for_tagpr slides-preview slides-pdf slides-pptx